ezplatform-solr-search-engine
ezplatform-solr-search-engine copied to clipboard
Allow use of RegExp in FieldIn Common CriteriaVisitor
This is to match the behaviour of the equivalent CustomField visitor.
Use-case: We would like to search for a substring within an ezstring, in Solr. Wildcards are always escaped using this criterion.
Above feedback isn't relevant within the scope of this PR.
no worries, just a cs-fixer update. I'll let you know when I fix it :)
Regarding this PR I'm unsure, it seems to add a feature not available on the SQL engine, so better would be to make something that can work across both for the use case here. Like done in #105 (and further fixed in #111).
I'm not sure that that's entirely valid: Currently, it's possible to do the exact opposite with the SQL engine, i.e. insert SQL wildcards.
Ok, we (@alongosz, ..) will try to investigate that with integration tests on API to better define this, thanks for finding this.
@alongosz We'll need to check from API perspective what we want to do with this one, for instance if we want to limit use to % to LIKE across engines or otherwise.
Related, got report from @danielmuehlbacher:
i’ve a question regarding solr / non-solr search criteria. the following works with non-solr, but not with solr: new Criterion\Field( ‘name’, Criterion\Operator::LIKE, ‘a%’ ) how to perform a wildcard search with solr? * or ? doesn’t work either…
In FullTextCriterion * is used for wildcards, maybe we should align with that in FieldCriterion as well on API level when LIKE is used. But if Solr has an equivalent of SQL's _ we imo should add something for that that too.
exciting times!!