Active
Project:
Apache Solr Views
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Aug 2019 at 02:16 UTC
Updated:
31 Oct 2019 at 12:45 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
rosk0Initial patch.
Tested on Apache Solr 7.1.
Comment #3
miroslavbanov commentedI don't think apachesolr_clean_text() is used like this. As far as I can see it's used on indexing of documents.
Comment #4
miroslavbanov commentedMaybe just this:
Also I'm amazed this module is used in 2019.
Comment #5
rosk0Unfortunately it's still in use...
Replaced apachesolr_clean_text() with htmlspecialchars() as suggested.
Comment #7
miroslavbanov commentedThanks for the contribution. Also created a new tag - 7.x-1.1-beta2. Cheers!
Comment #8
rosk0Thank you for committing and new release!
Comment #10
savel commentedSorry to tell, but this fix breaks operator support for phrases.
For example, I'm looking for "Apples" or "Oranges". Currently, I have "Apples OR Oranges" (without quotes) in "Is equal to" filter.
If you add quotes for the phrase, no results returned until I have an entity with type "Apples OR Oranges".
There should be another solution. If there isn't I propose to revert the patch to keep the module usable.
See Operator support is broken for "Is equal to" filter in 7.x-1.1-beta2.
Comment #11
miroslavbanov commentedReverted in dev and reopening this issue. There is no new tag yet.
Comment #12
miroslavbanov commentedI reverted, because I thought that existing sites are likely to use old and legacy Solr, so it is less disruptive to revert for now. Ideally there can be a fix that takes into account the other issue. I suppose we can check if there are quotes, and not add quotes in that case. Not sure what to do. Patches welcome.
Comment #13
miroslavbanov commentedIf the text for the filter is "some value" and the field name is some_field, the "is equal to" operator is building a query like sm_some_field:(some value)
I guess that doesn't work as expected with new solr versions, but it's probably a general limitation because the operators are badly named and not thought out sufficiently. Maybe if we add a new "phrase" operator it can add the quotes, and there would be less confusion or regressions.
Currently there appear to be different use cases to support. Someone may need to make the query type:("apples" OR "oranges"), and someone may need to make the query title:("the quick brown fox"). To support both cases, frankly I don't know what is the best approach, but most important is that I don't want to introduce regressions.