Hi,
I've used the following request (#1) for searching but the result was
too inaccurate. Therefore I've changed query_string to a match message
query and the result was perfect according to my needs. There is only one
problem, the facets are empty now...
Any help would be appreciated.
Working request but with too inaccurate search results:
{
"fields": [
"question",
"id",
"url",
"category",
"group"
],
"size": 480,
"sort": {
"_score": "desc",
"popular": "desc"
},
"query": {
"bool": {
"must": [
{
"query_string": {
"query": "maschine~",
"default_operator": "AND"
}
}
]
}
},
"facets": {
"type": {
"terms": {
"field": "type",
"size": 200,
"global": true
}
},
"brand": {
"terms": {
"field": "brand.uid",
"size": 200,
"global": true
}
},
"category": {
"terms": {
"field": "category.uid",
"size": 200,
"global": true
}
},
"version": {
"terms": {
"field": "version.uid",
"size": 200,
"global": true
}
},
"group": {
"terms": {
"field": "group.uid",
"size": 200,
"global": true
}
},
"platform": {
"terms": {
"field": "platform.uid",
"size": 200,
"global": true
}
},
"os": {
"terms": {
"field": "os.uid",
"size": 200,
"global": true
}
},
"tags": {
"terms": {
"field": "tags.uid",
"size": 200,
"global": true
}
}
}
}
Perfect search results but no facets data:
{
"fields": [
"question",
"id",
"url",
"category",
"group"
],
"size": 480,
"sort": {
"_score": "desc",
"popular": "desc"
},
"query": {
"bool": {
"must": {
"match": {
"_all": {
"message": {
"query": "maschine",
"operator": "and",
"fuzziness": 0.7
}
}
}
}
}
},
"facets": {
"type": {
"terms": {
"field": "type",
"size": 200
}
},
"brand": {
"terms": {
"field": "brand.uid",
"size": 200
}
},
"category": {
"terms": {
"field": "category.uid",
"size": 200
}
},
"version": {
"terms": {
"field": "version.uid",
"size": 200
}
},
"group": {
"terms": {
"field": "group.uid",
"size": 200
}
},
"platform": {
"terms": {
"field": "platform.uid",
"size": 200
}
},
"os": {
"terms": {
"field": "os.uid",
"size": 200
}
},
"tags": {
"terms": {
"field": "tags.uid",
"size": 200
}
}
}
}
I'm using the bool query because the user has the ability add some terms to
filter the result.
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/ae868372-7c46-470f-950d-9618225005c4%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.