3

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.

divyanshch
  • 390
  • 5
  • 15

1 Answers1

2

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.

Assem
  • 11,574
  • 5
  • 59
  • 97
  • 1
    Thank you for the answer. You are correct so after a little more research on my part. In order to update the index you have to open the index and then do the commits rather than creating a new index every time. Splitting the two files for searching and indexing is necessary also as they perform two completely different tasks. – divyanshch Dec 02 '15 at 12:42