You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Rasik Pandey <ra...@ajlsm.com> on 2004/05/25 15:45:34 UTC

RE : ReSorting

Erik,

> No, re-sorting without re-running a search is not possible (at
> least
> not easily).

It would be nice to be able to provide different views of Hits based on different sort criteria without touching the index for a second time as the "desired" results have already been returned. What do you mean by "not easily"?

>Why not just re-run a search with a different
> sort?

Of course that is one solution, but maybe not the most solid. As theoretically, an index at time A is not necessarily the same index at time B. If the use case requires the most update data from the index then your solution would suffice, but if a quasi snap-shot of a set of results needed to be kept, it wouldn’t solve the problem.

Regards,
Rasik  



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


Re: RE : ReSorting

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On May 25, 2004, at 9:45 AM, Rasik Pandey wrote:
> Erik,
>
>> No, re-sorting without re-running a search is not possible (at
>> least
>> not easily).
>
> It would be nice to be able to provide different views of Hits based 
> on different sort criteria without touching the index for a second 
> time as the "desired" results have already been returned. What do you 
> mean by "not easily"?

Actually, after thinking about it a bit more, it would be impossible to 
re-sort Hits after a search.  The new sorting infrastructure is 
extremely efficient with resources, and does not keep more than it 
needs to around.  So you could not change the field it is sorted on 
without re-searching.

If all you were going to do is reverse a sort, you could walk the Hits 
backwards instead of re-sorting or re-searching.

I still say your best bet (and surely not slow?) is to re-search.

>> Why not just re-run a search with a different
>> sort?
>
> Of course that is one solution, but maybe not the most solid. As 
> theoretically, an index at time A is not necessarily the same index at 
> time B. If the use case requires the most update data from the index 
> then your solution would suffice, but if a quasi snap-shot of a set of 
> results needed to be kept, it wouldn’t solve the problem.

Again, this is not correct if you keep the IndexReader or IndexSearcher 
around.

	Erik



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


Re: RE : ReSorting

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On May 25, 2004, at 10:19 AM, Rasik Pandey wrote:
>
>>> Why not just re-run a search with a different sort?
>>> but if a quasi snap-shot of a set of results needed to be
>>> kept, it wouldn’
>>> t solve the problem.
>>
>> If you kept hold of the same IndexReader, as I understand it,
>> changes to
>> the index would not be reflected.
>
> This seems like it would have some serious performance implications.

No, it doesn't have serious performance implications to keep an 
IndexReader (or IndexSearcher as the case may be) around.  And in fact 
it is how you'd perform different sorts on the same Query and ensure 
you get the same set of hits back.

	Erik


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


RE : ReSorting

Posted by Rasik Pandey <ra...@ajlsm.com>.
>> Why not just re-run a search with a different sort?
>> but if a quasi snap-shot of a set of results needed to be
>> kept, it wouldn’
>> t solve the problem.
> 
> If you kept hold of the same IndexReader, as I understand it,
> changes to
> the index would not be reflected.

This seems like it would have some serious performance implications.

Regards,
RBP

 



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


Re: ReSorting

Posted by Sam Hough <sa...@redspr.com>.

>>Why not just re-run a search with a different sort?
> but if a quasi snap-shot of a set of results needed to be kept, it wouldn’
t solve the problem.

If you kept hold of the same IndexReader, as I understand it, changes to
the index would not be reflected.



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