lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Rutherglen <jason.rutherg...@gmail.com>
Subject Re: Lucene SORT does a sort on entire index..how do I filter SORT?
Date Fri, 21 Aug 2009 16:53:16 GMT
Take a look at contrib/spatial.

On Fri, Aug 21, 2009 at 7:00 AM, javaguy44<javaguy44@yahoo.com> wrote:
>
> Hi,
>
> I'm currently looking at sorting in lucene, and to get started I took a look
> at the distance sorting example from the Lucene in Action book.
>
> Working through the test DistanceSortingTest, I've noticed that performing
> the SORT ends up sorting the whole index!
>
> To test this I did the following:
>  - added a few more lines in setup()
>    addPoint(writer, "Nico's Fish Shop", "fishmongerie", 10, 10);
>    addPoint(writer, "Nico's Fish Shop deux", "fishmongerie", 10, 10);
>
>  - I added a log statement to DistanceComparatorSource in the
> while(termDocs.next()) loop
>  - I ran DistanceSortingTest.testNearesRestaurantToHome and to my surprise I
> had 6 sorts / log lines of output in while(termDocs.next()) loop
>
> DistanceSortingTest.testNearesRestaurantToHome searches by the query term
> new TermQuery(new Term("type", "restaurant")).  As such shouldn't the index
> be filtered first (to 4 documents) before the DistanceSort occurs?
>
> Obviously this is not ideal in a million+ document index and assuming you
> had 100, 200 records that were hit based on the term.
>
> Would appreciate someone's input / advice on how to filter first
> --
> View this message in context: http://www.nabble.com/Lucene-SORT-does-a-sort-on-entire-index..how-do-I-filter-SORT--tp25080365p25080365.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message