Issue

ZF-955: No results for some queries after upgrading

Issue Type: Bug Created: 2007-02-23T09:55:23.000+0000 Last Updated: 2007-07-05T14:43:51.000+0000 Status: Resolved Fix version(s): Reporter: Marin Krkac (mkrkac) Assignee: Alexander Veremyev (alexander) Tags: - Zend_Search_Lucene

Related issues: - ZF-1002

Attachments:

Description

After upgrading from 0.7 to 0.8 I'm getting no results for some queries (simple, one word only).

I don't know exactly what interface changes have been made, maybe I'm doing something wrong. It would be nice to have a short migration guide, like there is for Zend_Controller.

The only things I changed are: - new Zend_Search_Lucene($indexPath); => Zend_Search_Lucene::open($indexPath); - new Zend_Search_Lucene($indexPath, true); => Zend_Search_Lucene::create($indexPath);

I tried re-indexing everything multiple times with different analyzers, it didn't help. After the re-indexing, the index is not optimized (except for the auto-optimization). If I optimize it with Zend_Search_Lucene I start getting some results for those queries, but some of the results are wrong. If I re-index everything and optimize it with Luke, it appears to be working correctly.

I know the description is not very helpful but I was unable to find any other clues. I'm using PHP 5.2.1.

Comments

Posted by Alexander Veremyev (alexander) on 2007-02-26T11:48:36.000+0000

Could you give an example of queries and index itself (attach it to the issue or put it somewhere and give an url)?

Posted by Marin Krkac (mkrkac) on 2007-02-26T14:44:40.000+0000

Here are two samples: - sample1 - sample2

The sample queries you could try are "creole" and "dottie". Both indexes return 5 results for "creole" and 2 results for "dottie" in ZF 0.7.

In ZF 0.8, both indexes return no results for either "creole" or "dottie".

If I optimize the first index with Zend_Search_Lucene in ZF 0.8, I get 5 results for "creole" and 2 results for "dottie", but some of the results are wrong. If I optimize it with Luke or PyLucene, the results are correct.

If I optimize the second index with either Zend_Search_Lucene in ZF 0.8 or Luke or PyLucene, the results are correct.

Posted by Alexander Veremyev (alexander) on 2007-03-02T06:56:21.000+0000

Just fixed this. Very stupid bug :I

If I optimize the first index with Zend_Search_Lucene in ZF 0.8, I get 5 results for "creole" and 2 results for "dottie", but some of the results are wrong. If I optimize it with Luke or PyLucene, the results are correct.

Please remember, that Zend_Search_Lucene searches through all fields by default.

Use:

$index->find('registeredName:creole')

or

Zend_Search_Lucene::setDefaultSearchField('registeredName');

$index->find('creole');

to get the same result as Java Lucene.

Posted by Marin Krkac (mkrkac) on 2007-03-02T09:56:40.000+0000

I'm sorry, I forgot to mention that I'm using Zend_Search_Lucene::setDefaultSearchField('registeredName');.

If I optimize the first index (sample1) with Zend_Search_Lucene from SVN, I still get the correct number of results with some of them being wrong. Luke is also giving me the same results (correct number of results, but some of them are wrong).

But if I re-index everything, I can't find any more problems. I'm getting the correct results no matter if the index is optimized or not and no matter what I'm using to optimize it.

Thank you.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2017 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts