R
R
romany42018-11-16 11:56:32
Sphinx
romany4, 2018-11-16 11:56:32

Sphinx. How to organize a search exception from the main index when updating rt?

There are 3 indexes

index sql_client_inter_comment_index
{
        source                          = client_inter_comment
        path                            = /var/lib/sphinxsearch/indexes/client_inter_comment_sql
        .....
}

index rt_client_inter_comment_index
{
        type                            = rt
        path                            = /var/lib/sphinxsearch/indexes/client_inter_comment_rt
        rt_field                        = comment
        ....
        rt_mem_limit                    = 128M
}

index client_inter_comment_index
{
        type                            = distributed
        local                           = sql_client_inter_comment_index
        local                           = rt_client_inter_comment_index
}

The application always accesses the distributed index
select * from client_inter_comment_index ....
Situation
There is an entry in the main index
+------+---------+----------------+---------+
| id   | comp_id | comp_client_id | comment |
+------+---------+----------------+---------+
|   1 |       1 |             47 | тестирование   |

Rt-index is still empty.
Further, this record is edited through the application, so, let's say "testing" is replaced by "acceptance".
After editing this entry in the rt-index, we have
+------+---------+----------------+------ ---+
| id | comp_id | comp_client_id | comment |
+------+---------+----------------+---------+
| 1 | 1 | 47 | acceptance |
Indexing of the main index occurs once a day, as well as resetting the rt-index.
Question
How, when searching for the phrase "testing", do not return a record with id = 1, until the moment of reindexing?
select * from client_inter_comment_index where MATCH ('@тестирование*');

The query above will honestly return the row with id =1, but the data for this row has been changed, and these changes are stored in the rt-index

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Puma Thailand, 2018-11-16
@opium

Store everything in the rt index

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question