Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow use of RegExp in FieldIn Common CriteriaVisitor #106

Open
wants to merge 1 commit into
base: 1.5
Choose a base branch
from

Conversation

alexwilson
Copy link

@alexwilson alexwilson commented Oct 12, 2017

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
Copy link
Author

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

@alongosz
Copy link
Member

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

@andrerom
Copy link
Contributor

andrerom commented Oct 13, 2017

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

@ezsystems ezsystems deleted a comment from ezrobot Oct 15, 2017
@alexwilson
Copy link
Author

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.

@andrerom
Copy link
Contributor

andrerom commented Oct 23, 2017

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

@andrerom andrerom changed the base branch from master to 1.5 November 1, 2018 20:23
@andrerom
Copy link
Contributor

andrerom commented Nov 1, 2018

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

@alexwilson
Copy link
Author

exciting times!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants