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 neils <ne...@gmx.net> on 2006/07/25 20:09:57 UTC

Sorting with Parallelreader fails

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

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

Thanks very much for you help :-))


-- 
View this message in context: http://www.nabble.com/Sorting-with-Parallelreader-fails-tf1999747.html#a5490455
Sent from the Lucene - Java Users forum at Nabble.com.


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


Re: Sorting with Parallelreader fails

Posted by Steven Rowe <sa...@syr.edu>.
Steven Rowe wrote:
> 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....

That should read: ... may prove *less* fruitful than you might hope ...




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


Re: Sorting with Parallelreader fails

Posted by neils <ne...@gmx.net>.
Hi Steve,

thanks a lot for your help. I think problem will be that no single terms are
stored in that field. So i will take a look and make some furhter tests.

Regarding your advice to the "java-user" list, i think it is no problem to
send a short vb code to describe the problem. This group is (in my opinion)
for lucene. Of course lucene is first written in java, but due  ported to
different languages and i think not only "java-coding" programmer are having
questions to lucene. So there is no need to convert a code-part to java when
help is needed.

But anyway. I'm happy that you give me the right direction for my problem
:-)

Thanks.
-- 
View this message in context: http://www.nabble.com/Sorting-with-Parallelreader-fails-tf1999747.html#a5493952
Sent from the Lucene - Java Users forum at Nabble.com.


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


Re: Sorting with Parallelreader fails

Posted by Steven Rowe <sa...@syr.edu>.
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