Best way to perform online reindexing of tables to search on Zend_Search_Lucene

I use Zend_Search_Lucene for full-text search of records in several different tables in my application. I just implemented this functionality, and currently the index is based on the first use of search functions after deploying the application. This, obviously, is not what I would like in production.

I am looking for an easy way to perform indexing as part of the application deployment logic, and then perform an incremental index of added / updated records every half hour or so.

What should I look for to implement this?

Thanks for any help you can provide.

+3
source share
1 answer

No need to index other than deployment. Here I propose a solution.

Make the default directory in your application say searchdata. Inside this path, separate paths are created for different types of data (for example, for cities, a folder like city_index). Inside the configuration file (your application), specify these paths. Write php scripts so that they read the table data and make the index. These scripts use the config paths to create the index. Write a script wizard that runs all of these scripts.

Run these scripts on your server once. This search continues (use configuration paths to search). (No indexing on first search)

, , ( ) db, . , . , .

+1

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


All Articles