Hello,

I have a few questions about the ordering of search results:

1) Given a query, are the Documents contained in the Hits object that is
returned by IndexSearcher.search(Query query) guaranteed to be in the
same order from one call to the next (assuming the index has not been
updated in the meantime)?
2) Assuming I don't use the IndexSearcher.search(Query query, Sort sort)
method, is the ordering of Documents in the Hits object predictable at
all?
3) Short of using the IndexSearcher.search(Query query, Sort sort), is
there any way to influence the ordering of the Documents in the Hits
object?  E.g. is there anything that I can do when creating and/or
updating the index that will guarantee a certain ordering of results at
query time?

For what it's worth, we're using Lucene in conjuction w/ a relational
database.  Our index has an 'id' field that maps to a row in a
relational database table.  Since Lucene queries are so quick we've
found performance to be much better if we do a pure Lucene query to find
the docs we need then do a simple SQL query with a "where id in (...)"
clause.   We've also wrapped this in an interface that implements a
relational-like limit/offset functionality.  So it's important to us
that at the very least the query returns results in the same order each
time.  Ideally, we'd like to order the results on a String field we have
on each document.  This actually works, however it slows things down a
bit.  This is understandable, course -- and I'm actually very impressed
how quickly it does perform -- however, we're trying to squeeze as many
cycles as possible out it to give the best user experience.   Just
wondering if there is anything else we might try.

thanks,

Bill



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

Reply via email to