I am unable to find any documentation regarding how do I implement Simple Query String Query in my Django Elasticsearch-dsl
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html
Can someone guide me through it?
This is my search function.
def search(q_string):
client = Elasticsearch(
[
'elasticsearch'
]
)
s = Search(using=client).query(SimpleQueryString(q_string))
Above code is showing me paring error.
Follow the same structure as the json document - whatever keys in the object will become kwargs, so:
SimpleQueryString(query="QUERY", fields=[...], default_operator='and')
also please don't create a new instance of Elasticsearch for every search, use a global instance and reuse it.
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With