Currently only single valued fields are possible to do range queries on due to limitations of Solr and the fact that these were not indexed using the sortable flag.
See : http://stackoverflow.com/questions/16416396/querying-solr-multi-valued-f...
When we index Drupal Commerce product that have different variations we do need to filter on price for each of the variations of this product. The documentation tells us that we should only do range queries for multiValued field if we are using the sortable fields. In code this means sint, sdouble and sfloat.
Attached patch fixes this and also adds some flexibility to the handles so that if user input is defined it does not go back to the machine values of the solr stats but it keeps the handles at whatever value the user has selected.
Comment | File | Size | Author |
---|---|---|---|
#5 | apachesolr-range_query_multivalued-2144877-5.patch | 7.27 KB | BR0kEN |
|
Comments
Comment #1
Nick_vhComment #2
danielmrichards CreditAttribution: danielmrichards commentedPatch in #1 works nicely for me. Just made a small change to reinstate the caching of the statistics result.
Comment #3
BR0kENUnfortunately patch breaks the search on Solr 4.x. Not whole logic in it, but exact this place:
Comment #4
BR0kENSolr 3.x - patch works well.
Solr 4.x -
can not use FieldCache on multivalued field: <FIELD>
Solr 5.x -
Stats can only facet on single-valued fields
Comment #5
BR0kENThis patch alongside with #2144885: Support product variations better so that you don't need to index the same product multiple times allows to use Stats and range queries on every Solr.
Comment #6
BR0kEN