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 WATHELET Thomas <th...@europarl.europa.eu> on 2007/11/08 13:18:53 UTC

Sorting with MultiSearcher

Hi,
I have few Indexes with the same structure.
I'm using MultiSearcher to search into those indexes and when I try to
sort the result by field the result is sort by field and by index (we
have all results from index1 and then index2,...) but I would like to
have the result sorted on the all resultset
Is it possible?
Piece of code i'm using to do it:
Sort sort = new Sort(new SortField(field, SortField.STRING,
orderDirect));

MultiSearcher search=...

Hits hit = searcher.search(query, sort);

Thanks in advence.


RE: Sorting with MultiSearcher

Posted by WATHELET Thomas <th...@europarl.europa.eu>.
I'm using Lucene core 2.2.0
The field i'm trying to sort is not presente in each documents into the
index. I add the field only if I have a metadata for it
Maybee it's the problem?
My field is untokenized store and indexed. 

-----Original Message-----
From: Mark Miller [mailto:markrmiller@gmail.com] 
Sent: 08 November 2007 13:22
To: java-user@lucene.apache.org
Subject: Re: Sorting with MultiSearcher

Any other info or code snippets? I sort on multisearchers all the time 
and have never seen that behavior.

- Mark (sorting on multisearchers since Lucene 1.4 <g>)

WATHELET Thomas wrote:
> Hi,
> I have few Indexes with the same structure.
> I'm using MultiSearcher to search into those indexes and when I try to
> sort the result by field the result is sort by field and by index (we
> have all results from index1 and then index2,...) but I would like to
> have the result sorted on the all resultset
> Is it possible?
> Piece of code i'm using to do it:
> Sort sort = new Sort(new SortField(field, SortField.STRING,
> orderDirect));
>
> MultiSearcher search=...
>
> Hits hit = searcher.search(query, sort);
>
> Thanks in advence.
>
>
>   

---------------------------------------------------------------------
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: Sorting with MultiSearcher

Posted by Mark Miller <ma...@gmail.com>.
Any other info or code snippets? I sort on multisearchers all the time 
and have never seen that behavior.

- Mark (sorting on multisearchers since Lucene 1.4 <g>)

WATHELET Thomas wrote:
> Hi,
> I have few Indexes with the same structure.
> I'm using MultiSearcher to search into those indexes and when I try to
> sort the result by field the result is sort by field and by index (we
> have all results from index1 and then index2,...) but I would like to
> have the result sorted on the all resultset
> Is it possible?
> Piece of code i'm using to do it:
> Sort sort = new Sort(new SortField(field, SortField.STRING,
> orderDirect));
>
> MultiSearcher search=...
>
> Hits hit = searcher.search(query, sort);
>
> Thanks in advence.
>
>
>   

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