You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by "Kai R. Emde" <em...@emedea.de> on 2006/11/28 23:09:00 UTC

BUG ? - lucene multisearcher / sorting

Hello,
 
we have one problem with the sort routine. We use the multisearcher function
over severall index.
The result will be sorted by the booknumber, but the produced list isn't
sorted correct. There are 300 hits from book a, then 150 from book b, 95
hits book 3, but then there are 1,2,3 hits of book a, 1 hit of book b. 
Is there a general problem? 
 
Thank's for a reply,
 
best regards 

kai



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: BUG ? - lucene multisearcher / sorting

Posted by Daniel Naber <lu...@danielnaber.de>.
On Friday 01 December 2006 15:16, Kai R. Emde wrote:

> When we search "material" as an example, we found 207 hits in the the
> index. When we search this index in the multisearcher, with 3 index,
> there 206 hits contiguous and one after the next. OK bookA1, bookA2,
> bookA3 ... bookA206, bookB1, bookB2, bookb3 ... bookB6, bookA207,
> bookC1, bookC2 --

What do the fields really look like? If they contain non-numbers, Lucene 
probably sorts non-numerically (i.e. 1, 10, 11, 12, ..., 2). Also, there 
might be strange behavior if you sort on fields that are tokenized (not 
sure if that gives an exception). Not sure if anybody can help you unless 
you post a real self-contained testcase that either creates the index 
itself or put up a small index somewhere to reproduce the issue.

Regards
 Daniel

-- 
http://www.danielnaber.de

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


AW: BUG ? - lucene multisearcher / sorting

Posted by "Kai R. Emde" <em...@emedea.de>.
Thanks for the reply,

I try to explain what's happens -

we use lucene 2.0 - is a little difficult to show a case, but it seems that
the problem began, when the hits of one index reach 200 and above.
At this moment at the end of the list there are like bits lost, of this
index 1,2,3 hits.
When we search "material" as an example, we found 207 hits in the the index.
When we search this index in the multisearcher, with 3 index, there 206 hits
contiguous and one after the next. OK bookA1, bookA2, bookA3 ... bookA206,
bookB1, bookB2, bookb3 ... bookB6, bookA207, bookC1, bookC2 -- 

Here is the code with the multisearcher -

	MultiSearcher searcher = getSearcher(indexDirList);
            
	if (searcher != null) {
		Analyzer analyzer = new GermanAnalyzer();
		QueryParser qp = new QueryParser("contents", analyzer);
//$NON-NLS-1$
		try {
			query = qp.parse(queryInput);
		} catch (ParseException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		try {
		  	hits = searcher.search(query, new Sort (new
SortField[] {
				new SortField("bookisbn"),
SortField.FIELD_SCORE //$NON-NLS-1$
		   }));
		 } catch (IOException e) {
			// TODO Auto-generated catch block
		  e.printStackTrace();
		  }                        // run the query
		   		
	   hitsResult = Messages.getString("Result.24")+ hits.length() +
Messages.getString("Result.25"); //$NON-NLS-1$ //$NON-NLS-2$

Regards
Kai


-----Ursprüngliche Nachricht-----
Von: Daniel Naber [mailto:lucenelist2005@danielnaber.de] 
Gesendet: Donnerstag, 30. November 2006 00:23
An: java-user@lucene.apache.org
Betreff: Re: BUG ? - lucene multisearcher / sorting


On Tuesday 28 November 2006 23:09, Kai R. Emde wrote:

> we have one problem with the sort routine. We use the multisearcher 
> function over severall index.

Does that also happens when you're not using MultiSearcher? Could you post 
a small test case that demonstrates this problem? To my knowledge, there's 
no known bug (but lucene 1.4 had problems with relevance sorting when 
using MultiSearcher).

Regards
 Daniel

-- 
http://www.danielnaber.de

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: BUG ? - lucene multisearcher / sorting

Posted by Daniel Naber <lu...@danielnaber.de>.
On Tuesday 28 November 2006 23:09, Kai R. Emde wrote:

> we have one problem with the sort routine. We use the multisearcher
> function over severall index.

Does that also happens when you're not using MultiSearcher? Could you post 
a small test case that demonstrates this problem? To my knowledge, there's 
no known bug (but lucene 1.4 had problems with relevance sorting when 
using MultiSearcher).

Regards
 Daniel

-- 
http://www.danielnaber.de

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org