lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Rowe <sar...@syr.edu>
Subject Re: Sorting with Parallelreader fails
Date Tue, 25 Jul 2006 19:00:30 GMT
neils wrote:
> Hi,
>  
> i have 3 indexfiles which i access over a parallelreader.
>  
> When i make a search, everything works fine, but....when i want to make a
> search and sorting by a special
> column i get an error.

You need to say exactly what the error is, right?  Or else we won't
know, hmmmm?  And then our "help" might need more quotation marks around
it to denote the vanishingly lower expectations we hold for it to
actually be that, do you see?????

> Here is my code:
>  
> Schnipp....
> Dim field As SortField = New SortField("Streetname")
> Dim sortByName As Sort = New Sort(Field)
> 
> Dim queri As Query = QueryParser.Parse(q, "Streetname", New
> StandardAnalyzer)
> 
> hits = searcher.Search(queri, sortByName)
> 
> ...Schnapp

And, por supuesto, posting what appears to be Visual Basic code
(presumably to be used with Lucene.Net) to an explicitly *Java* list
(dude, the name of the list is "java-user") may be prove fruitful than
you might hope....

> Is there something wrong or is there a bug in parallelreader... ?

I'm guessing that you're using the StandardAnalyzer to construct the
field values over which you want to sort.  This can emit multiple terms
in a single Field value, which is a no-no (for Lucene Sort, anyway).
From
<http://lucene.apache.org/java/docs/api/org/apache/lucene/search/Sort.html>:

     The fields used to determine sort order must
     be carefully chosen. Documents must contain a
     single term in such a field, and the value of
     the term should indicate the document's
     relative position in a given sort order. The
     field must be indexed, but should not be
     tokenized, and does not need to be stored...

Of course, maybe there is a problem with ParallelReader.  Have you
tested against a single index without changing anything else, to confirm
that this is actually the case?

Steve

---------------------------------------------------------------------
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