ezplatform-solr-search-engine icon indicating copy to clipboard operation
ezplatform-solr-search-engine copied to clipboard

Allow use of RegExp in FieldIn Common CriteriaVisitor

Open alexwilson opened this issue 8 years ago • 7 comments

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.

alexwilson avatar Oct 12 '17 15:10 alexwilson

Above feedback isn't relevant within the scope of this PR.

alexwilson avatar Oct 12 '17 15:10 alexwilson

no worries, just a cs-fixer update. I'll let you know when I fix it :)

alongosz avatar Oct 13 '17 07:10 alongosz

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).

andrerom avatar Oct 13 '17 08:10 andrerom

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.

alexwilson avatar Oct 22 '17 23:10 alexwilson

Ok, we (@alongosz, ..) will try to investigate that with integration tests on API to better define this, thanks for finding this.

andrerom avatar Oct 23 '17 08:10 andrerom

@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.

andrerom avatar Nov 01 '18 20:11 andrerom

exciting times!!

alexwilson avatar Nov 01 '18 20:11 alexwilson