You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by zqzuk <zi...@hotmail.com> on 2009/01/29 18:36:55 UTC

ranged query on multivalued field doesnt seem to work

Hi all,

in my schema I have two multivalued fields as

<field name="start_year" type="sfloat" indexed="true" stored="true"
multiValued="true"/>
<field name="end_year" type="sfloat" indexed="true" stored="true"
multiValued="true"/>

and I issued a query as: start_year:[400 TO *], the result seems to be
incorrect because I got some records with start year = - 3000... and also
start year = -2147483647 (Integer.MINVALUE) Also when I combine start_year
with end_year, it also produced wrong results...

what could be wrong? is it because I used wrong field type "sfloat", which
should be integer?

Any hints would be very much appreciated!

many thanks!
-- 
View this message in context: http://www.nabble.com/ranged-query-on-multivalued-field-doesnt-seem-to-work-tp21731778p21731778.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: ranged query on multivalued field doesnt seem to work

Posted by Chris Hostetter <ho...@fucit.org>.
: I am still struggling with this... but I guess would it be because for some
: data there are maximum interger values for the fields "start_year"
: "end_year", like "2.14748365E9", which solr does not recognise as "sfloat",
: because there is a "E" letter? 

when you say you are using "sfloat", that fieldType is using the 
SortableFloatField class correct?

SortableFloatField uses Float.parseFloat to get the float value from your 
input string, if that fails it will through an exception -- so you should 
have gotten an error if the value was unparsable ... i'm not sure what 
might be causing your problem.




-Hoss


Re: ranged query on multivalued field doesnt seem to work

Posted by zqzuk <zi...@hotmail.com>.
Hi,

I am still struggling with this... but I guess would it be because for some
data there are maximum interger values for the fields "start_year"
"end_year", like "2.14748365E9", which solr does not recognise as "sfloat",
because there is a "E" letter? 

In terms of doing ranged queries on multivalued fields, I think it should be
ok because i have another two fields using sfloat and are multivalued, the
ranged queries work ok....

Any hints are appreciated! thanks!




zqzuk wrote:
> 
> Hi all,
> 
> in my schema I have two multivalued fields as
> 
> <field name="start_year" type="sfloat" indexed="true" stored="true"
> multiValued="true"/>
> <field name="end_year" type="sfloat" indexed="true" stored="true"
> multiValued="true"/>
> 
> and I issued a query as: start_year:[400 TO *], the result seems to be
> incorrect because I got some records with start year = - 3000... and also
> start year = -2147483647 (Integer.MINVALUE) Also when I combine start_year
> with end_year, it also produced wrong results...
> 
> what could be wrong? is it because I used wrong field type "sfloat", which
> should be integer?
> 
> Any hints would be very much appreciated!
> 
> many thanks!
> 

-- 
View this message in context: http://www.nabble.com/ranged-query-on-multivalued-field-doesnt-seem-to-work-tp21731778p21743688.html
Sent from the Solr - User mailing list archive at Nabble.com.