incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastian Cohnen <sebastiancoh...@googlemail.com>
Subject Re: couchdb-lucene: Runtime exception
Date Mon, 17 May 2010 17:14:57 GMT
not sure if it's the most elegant solution, but you could add the field twice: one for searching,
the other one for sorting...

On 17.05.2010, at 18:59, Jochen Kempf wrote:

> Hi Robert!
> 
> Thanks for that description. I noticed that once I use the keyword analyzer
> I cannot use a wildcard search anymore. Is there any way to allow wildcard
> search and sort on a text field?
> 
> 
> 2010/5/17 Robert Newson <robert.newson@gmail.com>
> 
>> You are attempting to sort on a field with text in, which Lucene does
>> not support. You can prevent this exception by not doing that. :)
>> 
>> Specifically, you've done something like ret.add(doc.subject,
>> {"field":"subject"}) and then ?sort=subject
>> 
>> Assuming I've guessed correctly, you can achieve this effect using the
>> keyword analyzer (which will not break your 'subject' field into
>> multiple tokens); add {"analyzer":"keyword"} when indexing that field.
>> Note that the full value of 'subject' will be indexed, so you might
>> wish to truncate it.
>> 
>> B.
>> 
>> On Mon, May 17, 2010 at 4:29 AM, Jochen Kempf <jochenkempf@gmail.com>
>> wrote:
>>> Hi,
>>> 
>>> how can I prevent the following exception?
>>> 
>>> java.lang.RuntimeException: there are more terms than documents in field
>>> "job", but it's impossible to sort on tokenized fields
>>> 
>> 


Mime
View raw message