lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iouli.golova...@group.novartis.com
Subject Re: RuntimeException: cannot determine sort type!
Date Wed, 16 Jun 2004 16:09:13 GMT

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




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

How about using:

             ms.search(query,
            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
well
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?

Regards,
J.

             Erik


---------------------------------------------------------------------
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