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:[EMAIL PROTECTED] 
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:[EMAIL PROTECTED] 
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" <[EMAIL PROTECTED]>
To: "Lucene Users List" <[EMAIL PROTECTED]>
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:[EMAIL PROTECTED]
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:[EMAIL PROTECTED]
Sent: Wednesday, September 15, 2004 13:13 PM
To: [EMAIL PROTECTED]
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to