Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-03-2008, 01:53 PM
Junior Member
 
Join Date: Mar 2008
Posts: 4
Default to many results for myfield:100020100000002484

Hi,
i created a lucene indix with the java API. Now i want to search on the created index with the Zend API. The index contains a document with the field <my_criteria.link> and the value '100020100000002484'.
If i search
PHP Code:
$term  = new Zend_Search_Lucene_Index_Term('100020100000002484''my_criteria.link');
$query = new Zend_Search_Lucene_Search_Query_Term($term);
$hits  $index->find($query); 
everything works fine.
But the seach for a lower ID like '100020100000002482'
PHP Code:
$term  = new Zend_Search_Lucene_Index_Term('100020100000002482''my_criteria.link');
... 
the same document will be found!
BUT with
PHP Code:
$term  = new Zend_Search_Lucene_Index_Term('100020100000002472''my_criteria.link');
... 
i got no results (as expected ).
Can anyone tell me why the document is found by the second string ?
I use the lukeall.jar application to check the created Index and test the querys and it looks fine.
Thanks,
Ralf

Last edited by rahy : 03-03-2008 at 02:04 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-04-2008, 10:50 AM
Junior Member
 
Join Date: Mar 2008
Posts: 4
Default

Hi all,
i found the error in the class: Zend_Search_Lucene_Index_SegmentInfo (/library/Zend/Search/Lucene/Index/SegmentInfo.php) in line 690:
There must be an '===' operator insead of '=='
i changed the line from
PHP Code:
        if ($termFieldNum == $searchField && $termValue == $term->text) { 
to
PHP Code:
        if ($termFieldNum === $searchField && $termValue === $term->text) { 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-04-2008, 05:16 PM
xentek's Avatar
Senior Member
 
Join Date: Feb 2008
Posts: 112
Default

You should submit this as a patch, if it hasn't already been addressed in 1.5 RC1, etc.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 11:35 PM.