lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: RuntimeException: cannot determine sort type!
Date Wed, 16 Jun 2004 16:09:13 GMT

thank You very much, I tried it and it looked like it really fixed the

>                   formated_query=query.toString();
>                   if (sort_byscore)hits =;
>                   else hits =,new
> Sort("modified",true));
> // here the "cannot determine.." exception generated!!!

How about using:

            new Sort(new SortField("modified", SortField.STRING, true)));

Does that fix it?

If "modified" is only there for sorting and not for querying, perhaps
index it as a Integer.toString or Float.toString instead - this will
give you better resource usage and performance most likely - and change
the type to SortField.INT or SortField.FLOAT appropriately.  The
sorting infrastructure can detect a type, but it may have issues doing
so if the strings look like a number in the first document but later
appear like a String.  DateField.timeToString makes them String, so
forcing it to sort on String type should work.

This field is used mostly for sorting, but I'm going to use it for query as
just get the end user possibility to see the incoming data in real time,
i.e. modified[timefrom TO timeto]
I used this format because I sow it doc doing like this. Should I really
change to numbers?



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

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

View raw message