A
A
Anton Kuzmichev2013-09-13 11:59:51
Sphinx
Anton Kuzmichev, 2013-09-13 11:59:51

Setting up search for frequently changing data in Sphinx?

Happy holiday everyone!
There is some array of data on which you want to organize a search, according to a variety of criteria.
Realizing that the sphinx's forte is still full-text search, and in my case it is not required, I nevertheless conducted tests that unequivocally confirmed that "must be taken."
It remains to design a scheme for working and updating indexes.
So,
Data (some specifics: tens of thousands of ads) lies in the muscle, where the whole range of CRUD operations regularly occurs with them. It is possible to delay the relevance of the index within 5 minutes.
How to organize a normal index? Will the scheme "main index updated at 00:00 + delta index for today, updated every 5 minutes" ensure that the changed data is updated? How did you do a similar task if you once faced such a task?
I must say right away that for some reason I cannot yet use RT indexes for the task - it will not be possible to quickly remake the application so that, along with executing queries to mysql, it sends them to sphinx. Although, if there is a way to set up a kind of “replication” of several tables, where the master will be the muscle, and the slave will be the sphinx, I will even consider this option.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Anton Kuzmichev, 2013-09-30
@Assargin

In general, I decided with the help of a delta index. Main index (once a day), delta index + merge it into the main one (every 3 minutes). new and updated documents appear in the main index themselves, but to throw out the deleted ones, I defined sql_query_killlist in the delta index. Thanks to all!

P
Puma Thailand, 2013-09-13
@opium

What is your changed data, if you changed yesterday's data, then of course the delta index will not take them into account, or you need to change them in some special way, that is, make a new announcement.

I
impass, 2013-09-14
@impass

for some reason, I still cannot use RT indexes for the task - it will not be possible to quickly remake the application so that, along with executing queries to mysql, it sends them to sphinx

theoretically, you can simply make a trigger to update tables (s) + hook up the Sphinx server through the FEDERATED storage engine

A
Anton Kuzmichev, 2013-09-13
@Assargin

This number will not work with the main mysql database)
I also looked at the topic of index merging:
highload.com.ua/index.php/2009/11/30/sphinxsearch-index-merging/
It turns out to “update” in the main index existing document, you need this document to be in the delta index, and plus specify a filter when merging to remove deleted and modified documents from the main index.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question