'What is the equivalent to Postgres's @@ to_tsquery(:searchQuery) in ElasticSearch?
We've migrated from a postgres database that was using vectors and using @@ to_tsquery(:searchQuery) to perform queries. We are now using ElasticSearch and having a hard time getting the same accuracy that we saw with Postgres Vector searching.
For example we have the phrase "deadpool vs carnage" as the value for a title field on a document and would like this document to come back when performing a search with a query value of "dead carn".
When using postgres this wasn't a problem. But with ElasticSearch I'm unable to get this to return correctly.
I've tried different variations of all the match queries and can't get this to work. Any help would be very much appreciated
Solution 1:[1]
Elasticsearch is such a robust system that often times, like with many things, it's easy to overlook the simplest solution.
I ended up using the query_string search with wildcards in the string to achieve this.
You can pass in a query value of dead* carn*.
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | James Parker |
