LIKE filter is missing. Here is the patch
Closing as a duplicate of #3444888: LIKE and EXACT filter for searching fulltext (9.0.x, 8.0.x).
| Comment | File | Size | Author |
|---|
LIKE filter is missing. Here is the patch
Closing as a duplicate of #3444888: LIKE and EXACT filter for searching fulltext (9.0.x, 8.0.x).
| Comment | File | Size | Author |
|---|
Comments
Comment #2
abrar_arshad commentedHere is the revised patch pls
Comment #3
abrar_arshad commentedHello, any updates on this? I wonder if this module's maintenance has been discontinued
Comment #4
sokru commentedLooks good, we could add this. My only concern is that should be check if the value has
%character at beginning or at end of the value and convert it to asterisk*? Drupal database abstraction layer uses asterisk, e.g.->condition('field_title', '%my article%', 'LIKE'). With Elasticsearch wildcard, one that is used in patch, requires asterisk to be used.Comment #5
abrar_arshad commentedI think it is best to leave how it gets used by the API consumer, given already how aggregation is written for ElasticSearch and MySQL syntactically and semantically differently using the same Query API that accepts different parameters.
Edited: The point is not to assume what user may input as parameters and intervene but rather should allow to align with actual ElasticSearch docs and practices.
Comment #6
abrar_arshad commentedHi sokru, just wondering if you got some time to merge the patch. Thanks
Comment #7
sokru commentedMakes sense, I'll add this to next release.
Comment #8
abrar_arshad commentedThanks
Comment #9
karma86 commentedHello there!
I created a ticket a while ago with very similar functionality.
https://www.drupal.org/project/elasticsearch_connector/issues/3268303
I could re-roll the patch and extend it with the EXACT functionality too.
Comment #10
kevinn commentedHere is patch with a "NOT LIKE" filter also.
Comment #11
mparker17In #3270464: Investigate search_api_opensearch as base for elasticsearch_connector, we made a bunch of changes to how filters are built, so this patch no longer applies. But I think the feature would still be useful, if it is still possible to implement. The new filter building code is in
\Drupal\elasticsearch_connector\SearchAPI\Query\FilterBuilder::buildFilterTerm()now.Could I also trouble someone to provide a link to the page in the current ElasticSearch documentation that describes the LIKE filter? That would help us to write tests for the LIKE and NOT LIKE filters.
(I'm looking through the issues in the 8.0.x-dev branch as part of a big review of open issues for #3427243: Plan for 8.0.0-alpha release: thank you for your patience with me!)
Comment #12
mparker17Taking a closer look at #3444888: LIKE and EXACT filter for searching fulltext (9.0.x, 8.0.x), it looks like that issue is requesting the same thing, but uses the new syntax and adds an EXACT filter, so I've pasted the code from this ticket into a comment in that one, and I'd like to close this issue as a duplicate, and I will update the credit for that issue accordingly.
Thanks everyone!