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

Create string search operator #148

Closed
wants to merge 3 commits into from

Conversation

instification
Copy link
Member

Currently the only operator for searching strings is the contains operator which modifies the search term before running the query.

The creation of a search operator allows a search to be performed without munging the search term. This allows for exact matching in searches.

The primary use case for driving this PR is to be able to provide the search term to collective.elasticsearch without modification so that elastic can be used to parse the search original phrase.

@instification instification marked this pull request as draft May 21, 2024 16:32
@mister-roboto
Copy link

@instification thanks for creating this Pull Request and helping to improve Plone!

TL;DR: Finish pushing changes, pass all other checks, then paste a comment:

@jenkins-plone-org please run jobs

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically.

Happy hacking!

@@ -795,6 +803,7 @@
<value key="sortable">False</value>
<value key="operations">
<element>plone.app.querystring.operation.string.contains</element>
<element>plone.app.querystring.operation.string.search</element>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if an editor is configuring a search block and adds a criterion with the SearchableText index, they'll have to pick between "Contains" or "Search" as the operation. That seems like bad UX since it's not clear why to choose one or the other.

If you need this for integration with elasticsearch, wouldn't it make more sense for your elasticsearch integration package or your policy package to add this operation (and probably remove the other one)?

@instification
Copy link
Member Author

Closing this PR. As per review comments this functionality is best suited elsewhere

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

Successfully merging this pull request may close these issues.

3 participants