divyanshch
divyanshch

Reputation: 400

Whoosh indexing

When indexing and searching for query words in whoosh does the program index every time it is ran? I am making a web interface with it so it can display certain results to the user. To do so I am using php to call the python file in the html. I have 1GB of data to index so is it going to take a long time everytime I run the file or the first time will be long and the rest significantly faster than the first due to the fact the program won't need to index all documents from start.

Upvotes: 3

Views: 707

Answers (1)

Assem
Assem

Reputation: 12107

In your python code, you should separate the Indexer from the Searcher. Configure your php file to call the Searcher only; run the indexer manually from time to time when there is new data added or old data altered.

The key idea is index only when you really need it ; not at every search operation.

Upvotes: 2

Related Questions