Regarding contains and exact match - Elastic Search #4161
Unanswered
chaitanya-nit
asked this question in
Questions
Replies: 1 comment
-
@chaitanya-nit I am a bit confused here. Are you using Haystack's ElasticSearch Document Store or your own? Because Haystack's ElasticSearch Document Store does not have |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to build a search engine based on bm25 retriever. I want to implement advanced search with this retriever. Advanced search has lot of features, but I want to implement only "Contains", "Does not contains" and "Exact Match". How to prepare such filters using elastic search document store?
I have implemented metadata filters.
Update:
I found a solution from the elastic search docs.
`from elasticsearch import Elasticsearch
create an instance of the Elasticsearch client
es = Elasticsearch()
define the query to search for documents containing a specific phrase
query = {
"query": {
"match_phrase": {
"text": "contains phrase"
}
}
}
execute the search and print the results
results = es.search(index="my_index", body=query)
print(results)
`
But when I search for "contains_phrase" through elastic_document_store.search() I am getting 0 results
Beta Was this translation helpful? Give feedback.
All reactions