Hi,
Consider a elastic document has a filed named site
. We can use query string query
to limit the search results to the related site
just like this:
GET my_index/_search
{
"query": {
"query_string": {
"default_field": "*",
"query": "search_text AND site:my_site"
}
}
}
I was trying this functionality for simple query string
and seems not working. this:
GET my_index/_search
{
"query": {
"simple_query_string": {
"query": "search_text +site:my_site",
"default_operator": "and",
"fields": ["*"]
}
}
}
Is this query correct? how can I have such functionality to simply filter my results based on a field?
Thanks in advance