incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Newson <robert.new...@gmail.com>
Subject Re: couchdb-lucene: Runtime exception
Date Mon, 17 May 2010 17:19:11 GMT
"Is there any way to allow wildcard search and sort on a text field"
-- Not with Lucene, afaik.

The usual solution is to use separate fields as Sebastian has also noted.

B.

On Mon, May 17, 2010 at 5:59 PM, Jochen Kempf <jochenkempf@gmail.com> 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