|
|||
|
I was testing on the Zend_Search_Lucene, and I can't get this work properly, here is some of my testing code
I call this function in my indexAction PHP Code:
PHP Code:
Index contains 0 documents. Search for 'framework' returned 0 hits When I check my indexing folder, I saw some files being created segements.gen _2.cfs and some other segements Can someone tell me what have I done wrong or any suggestion, thanks for any help! [ Note: the $this->_index is from Zend_Search_Lucene::create('/path/to/index'); ] Last edited by iroy2000 : 03-17-2008 at 11:07 PM. |
|
||||
|
Quote:
I created a static method that I can call to create/open my index: Replace $GLOBALS['index_path'] with your real system path (I'm loading mine up from my config file). PHP Code:
Also, this tool can be handy to test your index out, though I think there are some differences between the two (result sets may vary, but is a decent enough way to test some things - just test them in your Zend_Search_Lucene as well): http://www.getopt.org/luke/
__________________
- xentek |
|
|||
|
Thanks for the reply, very helpful.
I tried to make a getSearchIndex() and it works. But now there's another problem... The first time I run, it calls the "create()", and after that it calls "open()". It all make sense here. So I tried to reload several times for testing, but each time of reload, it adds more "same" queries into the indexing. Do I need to delete them before updating, or there is a better way to solve that problem?? |
|
||||
|
It's probably a good idea to delete what got started, and then run the getSearchIndex() method to create it the first time.
Then start to index your documents, and get your index filled with data. Use the Luke tool to ensure the index is readable and you can run a couple of queries against it for known data to ensure it's working. Once you have your index populated, move on to creating your front end search methods and use them to use Zend_Search_Lucene to query your index. Once you're getting some hits back, dress up your results page, and you should be good to go.
__________________
- xentek |
![]() |
| Thread Tools | |
| Display Modes | |
|
|