lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doron Cohen <>
Subject Re: sorting issue with un-tokenized field
Date Wed, 17 Jan 2007 21:04:50 GMT
For sorting by, that field must be added to the document
exactly *once*, as UN_TOKENIZED.
This way there would be at most one token in that field
for each document.

If, for instance, that field is added twice to the document,
with same or different values, then although UN_TOKENIZED
is specified in both additions, there would be two tokens,
and sort would raise an error.

You can use Luke to see the content of your index - that would help.
(or use IndexReader.termDocs() to examine the index.)

moraleslos <> wrote on 17/01/2007 12:39:41:

> Oops, accidently pressed the ENTER key before doing anything  ;-)
> I have a field called "bookTitle" that I specified as UN_TOKENIZED and
> STORED in the index (i.e. keyword).  However, when I do a sort on this
> during a search I get this error:
> Exception occurred during search: java.lang.RuntimeException: there are
> terms than documents in field "bookTitles", but it's impossible to sort
> tokenized fields
> My gut feeling on this is that some of my "bookTitles" are long, e.g. >

Why should this matter?

> words, although I'm not sure if this is the cause.  Again I don't
> this when storing in the index.  Any suggestions on how to sort this
> (which is just a String field) w/o running into this RuntimeException?
> Thanks in advance!
> -los
> --
> View this message in context:
> with-un-tokenized-field-tf3029674.html#a8418521
> Sent from the Lucene - Java Users mailing list archive at
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message