lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wermus Fernando" <fernando.wer...@xlnet.net.ar>
Subject SortField[] solved. Warning
Date Thu, 16 Sep 2004 15:05:46 GMT
Luceners,
	I can order without having any document indexed. The problem was that I make an instance
of Sort(String name) instead of Sort(String name, int type).
According to the api, Sort(String name) will automatically detect the type of the field. But
It couldn't detect a field type String and then throw me a runtime exception. The error message
said

field "shortName" does not appear to be indexed

and I thought I couldn't look up not indexed fields.

This only happened to me when it wasn't any document at all indexed. But if it was at least
one document indexed, this exception doesn't appear.

I think that it should show a message like

It couldn't detect the field type 

Or something like this, because it was very confusing to me the message error.



-----Mensaje original-----
De: Wermus Fernando [mailto:fernando.wermus@xlnet.net.ar] 
Enviado el: Jueves, 16 de Septiembre de 2004 11:07 a.m.
Para: Lucene Users List
Asunto: SortField[] in search method (newbie)

Why can I search fields that aren't indexed without any problem, but if I ask for ordering
by one of these fields, I got a runtime exception?

I can't understand this behavior. I mean if I don't have any document indexed with these fields,
why can I search by these fields and I can't ask for ordering by one of them?
At the beginning I don't have any document at all, and I will need to order anyway, because
I don't know that.

Thanks.



-----Mensaje original-----
De: Praveen Peddi [mailto:ppeddi@contextmedia.com] 
Enviado el: MiƩrcoles, 15 de Septiembre de 2004 03:13 p.m.
Para: Lucene Users List
Asunto: Re: problem with SortField[] in search method (newbie)

Does it mean you indexed all "not null" fields?. I think you should change
your code so that you always index the fields you want to sort.

In any case, it looks like some of your documents have shortName not null
and not indexed. If you do not have any non-indexed shotnames in the index,
I don't think u would have got that error. But I may be wrong.

Praveen

----- Original Message ----- 
From: "Wermus Fernando" <fernando.wermus@xlnet.net.ar>
To: "Lucene Users List" <lucene-user@jakarta.apache.org>
Sent: Wednesday, September 15, 2004 1:53 PM
Subject: RE: problem with SortField[] in search method (newbie)


Aviran,
I can search in not indexed fields without any exception, but I can't order
by the same fields.
Besides,  I can't know in advance if they are indexed in my app, because I
index those fields that have some value, if it doesn't I don't add it to the
document.

What if I don't have any document indexed?



-----Mensaje original-----
De: Aviran [mailto:amordo@infosciences.com]
Enviado el: MiƩrcoles, 15 de Septiembre de 2004 02:35 p.m.
Para: 'Lucene Users List'
Asunto: RE: problem with SortField[] in search method (newbie)

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


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message