I want to generate phrase queries with wildcard, but this query returns 0 result:
"query": {
"bool": {
"must": [
{
"query_string": {
"query": "\"user login authen*\"",
"fields": [
"text"
],
"phrase_slop": 5,
"default_operator": "and",
"analyze_wildcard": true,
"auto_generate_synonyms_phrase_query": false
}
}
]
}
}
Does phrase query handle wildcard (?*)? May I have an explication?
Someone proposed to use span queries for the queries with a proximity and wildcards. If we search with a long sentence, the query becomes too complexe.
I met another problem with span query, if I replace the search field "text.exact" (without stemming) by "text" (a filed with stemming) in the query below, I get 0 result. Why?
"query": {
"span_near": {
"clauses": [
{
"span_term": {"text.exact": "user"}
},
{
"span_term": {"text.exact": "login"}
},
{
"span_multi": {
"match": {
"wildcard": {"text.exact": "authen*"}
}
}
}
],
"slop": 5,
"in_order": true
}
}