I am working on implementing Solr in a project, and now I'm stuck in a specific search, including the arr field. The fact is that:
I would like to search for a subdirection on an object, these subdirections are stored in a multi-valued field, for example:
<arr name="SubIds"> <int>12272</int> <int>12304</int> <int>12306</int> </arr>
The request (or part of the request) that I want to use is as follows: Map (SubIds, I, I, 1,0)
When I, for example, fill 12304 in the "i" space in the map function above, I expect my function to return 1. If I entered 12345, it would have to return 0. The fact is that when I run this query returns 0, or "There is no number 12304 in this field, I return 0".
When removing 0 from my map function, I can see the actual value returned to me (when 12304 returns 1, when another returned value), in this case 12306! I tried this with several different ambiguous fields, but the result is the same; it seems like the function is checking the last value in a multi-valued field for my populated id.
It's true? And when this happens, is there a way to look at the entire arr and return only 0 when the value does not exist in the entire multi-valued field?
** Edit: this is just a hunch, but could it be that the map () function automatically arranges the arr list when it sees that all elements are of type int (for example). This may mean that the card returns the first number (the highest), which (in my example) would be 12306, not 12304 ... *
Thanks!