How to remove deleted records from the main sphinx index?

I have a site that uses the main / delta indexing scheme for sphinx. main is restored daily, the delta is rebuilt every 5 minutes. This works well for indexing newly submitted items.

The problem is that the elements needed to be dropped from the index as often as they were added, and, as a rule, the dropped elements are older, so they are already in the main index. Thus, after the item is deleted, they are still displayed in the search results for up to 24 hours (up to 1 hour, when the main part is rebuilt).

How can I solve this problem?

+3
source share
3 answers

. sql_query_killlist http://sphinxsearch.com/docs/current.html#conf-sql-query-killlist

-:

sql_query_killlist = select id from mytable where updated > @last_delta_update
+2

Sphinx , , " ". 1.10 .

http://www.sphinxsearch.com/docs/current.html#rt-indexes

. 24 , . , , , .

0

One option is to define an attribute in the index, and then change its value to “ignore” certain documents. For example, my indexes have the flag_ignore attribute. All search queries are filtered, so only documents that have the flag_ignore = 0 are matched. When the document should disappear right now from the index, I call Sphinx-> UpdateAttributes () and set the value to 1, which will lead to the disappearance of the document from any next search.

0
source

Source: https://habr.com/ru/post/1768888/


All Articles