Hi,
I would like to do the following in Elasticsearch 7.8.
- Do a full text search with fuzzy searching enabled on all indexes
- Do a secondary search for a specific term on all indexes
- Filter out on the publishedDate for blog posts (The business logic is that a user can create a blog post and publish it on a certain day. I do not want to show blog posts that are set for the future in my search results.)
I would like to get all of the results from 1&2, and filter them out with 3 if possible.
This is my current query -
{
"query": {
"bool": {
"should": [
{
"multi_match": {
"fields": [
"_all"
],
"fuzziness": "AUTO",
"prefix_length": 2,
"query": "Testing"
}
},
{
"multi_match": {
"query": "Testing"
}
},
{
"bool": {
"_name": "Filter out blog posts",
"must": [
{
"term": {
"_index": "blog"
}
},
{
"range": {
"blog.publishedDate": {
"lte": "now"
}
}
}
]
}
}
]
}
}
}
Thanks for any input!