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 Wermus Fernando <fe...@xlnet.net.ar> on 2004/09/15 19:12:59 UTC
problem with SortField[] in search method (newbie)
Luceners,
My search looks up the whole entities. My entities are accounts,
contacts, tasks, etc. My searching looks up a group of entity's fields.
This works fine despite, I don't have indexed any entity in a document.
But If I sort by some fields from different entities, I get the
following error.
field "shortName" does not appear to be indexed
The account's field I have indexed are
shortName,number,location,fax,phone,symbol
and I order by
shortName
----------------------------------------------------
without any order
shortName,number,location,fax,phone,symbol
it works fine.
----
I don't understand the behavior because If I don't order the searching
and I don't have any document indexed, It works fine, but If I add an
order I get a runtimeException and I can't catch the exception to solve
the problem. The only solution it's to index the whole fields'
entitities once in a document, but for me it's a patch.
Any idea, it could help me out.
Thanks in advance.
RE: problem with SortField[] in search method (newbie)
Posted by Aviran <am...@infosciences.com>.
You can only sort on indexed field. (even more than that, it'll work
properly only on Untokenized fields, ie keyword).
Aviran
-----Original Message-----
From: Wermus Fernando [mailto:fernando.wermus@xlnet.net.ar]
Sent: Wednesday, September 15, 2004 13:13 PM
To: lucene-user@jakarta.apache.org
Subject: problem with SortField[] in search method (newbie)
Luceners,
My search looks up the whole entities. My entities are accounts, contacts,
tasks, etc. My searching looks up a group of entity's fields. This works
fine despite, I don't have indexed any entity in a document. But If I sort
by some fields from different entities, I get the following error.
field "shortName" does not appear to be indexed
The account's field I have indexed are
shortName,number,location,fax,phone,symbol
and I order by
shortName
----------------------------------------------------
without any order
shortName,number,location,fax,phone,symbol
it works fine.
----
I don't understand the behavior because If I don't order the searching and I
don't have any document indexed, It works fine, but If I add an order I get
a runtimeException and I can't catch the exception to solve the problem.
The only solution it's to index the whole fields' entitities once in a
document, but for me it's a patch.
Any idea, it could help me out.
Thanks in advance.
---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org