What steps will reproduce the problem?
1. Create a solr field in the schema which contains an underscore in the name
and a rangeable value (e.g. an integer).
2. Attempt a ranged facet search like:
solr = solr.Solr(solr_url)
solr.select(q=q, start=s, facet_mincount=facet_mincount,
facet_field=normalfield, facet_range=underscored_field,
f_underscored_field_facet_range_start=0,
f_underscored_field_facet_range_end=50,
f_underscored_field_facet_range_gap=10)
3. Observe that the _ in underscored_field is converted to a ., and therefore
isn't properly recognised in solr.
What is the expected output? What do you see instead?
Expect a normal solr response, with facet_ranges populated. Instead solr
throws an error. The error that solr isn't important as such - it's exactly
what you would expect solr to do; the problem is clearly isolated to the
request code in solrpy.
What version of the product are you using? On what operating system?
0.9.4 MacOSX 10.6
Please provide any additional information below.
I have a fix for the bug, although I'm not sure it's 100% optimal. See
attached patch file. This adds an extra argument to the SearchHandler to take
an "arg_separator" value, which defaults to "_", and then when the _ -> .
replacement happens, I use the value of arg_separator instead of the string
literal "_". This means that for my use case I can pass in an arg_separator of
"__" (double underscore). Using this code now works for me.
Original issue reported on code.google.com by rich...@cottagelabs.com on 27 Jun 2011 at 8:18
Original issue reported on code.google.com by
rich...@cottagelabs.com
on 27 Jun 2011 at 8:18Attachments: