lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doron Cohen <>
Subject Re: Error: there are more terms than documents...
Date Thu, 23 Apr 2009 20:00:57 GMT
On Thu, Apr 23, 2009 at 10:39 PM, <> wrote:

> I'm getting a strange error when I make a Lucene (2.2.0) query:
> java.lang.RuntimeException: there are more terms than documents in field
> "objectId", but it's impossible to sort on tokenized fields

Is it possible that, for at least one document, multiple "objectId" fields
were created?
This would also create this problem.

PS. Just as an aside, what does it mean for a field to be stored or not
> stored.  Looking at the output above, the 'id' field is stored and the
> 'objectId' is not.  Yet both of them get displayed by the
> Document.toString() method.  So even the objectId field got "stored" at
> least in the sense that I understand the term (otherwise how did it get
> displayed) so I'm obviously missing something about what "stored" means
> in the Lucene context.

The printed document object is the same document object that was created
for indexing. But when a document is read from the index (via IndexReader
it will only contain the stored fields. For instance, assume that at search
time you
would like to get the URL of a result document and display it to the user.
For this
you can at indexing time add the URL to a stored field.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message