Function queries don't work with multivalued field.
http://wiki.apache.org/solr/FunctionQuery#Vector_Functions

You'll have to think in another way of doing that. What do you want to
achieve with that map?

Regards
Emmanuel

2011/9/8 tkamphuis <tom_m...@hotmail.com>

> Hi,
>
> I'm working on implementing Solr in a project and right now I'm stuck on a
> specific search including an arr field. The thing is:
>
> I'd like to search sub-id's on an object, these sub-id's are stored in a
> multivalue field, e.g.:
> <arr name="SubIds">
>   <int>12272</int>
>   <int>12304</int>
>   <int>12306</int>
> </arr>
>
> The query (or part of the query) that I want to use is as follows:
> map(SubIds,i,i,1,0)
>
> When I, for example, fill 12304 on the 'i' space in the map function above,
> I would expect my function to return 1. If I would enter 12345 it should
> return 0. The thing is that when I run this query it returns 0, or "There's
> no number 12304 in this field, I return 0".
>
> When removing the 0 from my map function I can see the actual value
> returned
> to me (when 12304 return 1, when different return value), in this case
> that's 12306! I've tried this with some different multivalued fields but
> the
> result is the same; it looks like the function is checking the last value
> in
> the multivalue field against my filled in ID.
>
> Is this true? And when it does, is there any way in looking through the
> whole arr and only return 0 when the value doesn't exist in the whole
> multivalued field?
>
> Thanks!
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Using-multivalued-field-in-map-function-tp3318843p3318843.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Reply via email to