Adding relevance to query_string query, help required


(see613-2) #1

I am using a "query_string"
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html
with morphology and wildcard.

'searchAnalyzer' => array(
'type' => 'custom',
'tokenizer' => 'standard',
'filter' => array('lowercase', 'word_delimiter', 'snowBallRus',
'russian_morphology')
),

GET _search
{
"explain": true,
"query":{
"query_string":{
"query":"test",
"analyzer":"searchAnalyzer",
"fields":["name^100","content^1"],
"analyze_wildcard":true
}
},
"highlight":{
"fields":{
"name":{
"fragment_size":10000,
"number_of_fragments":1
},
"content":{
"fragment_size":100,
"number_of_fragments":5
}
},
"pre_tags":[""],
"post_tags":["
"]
}
}

I was surprised that the "query_string" uses a constant score type which i
discovered using the query explanation.

"_explanation": {
"value": 0.1,
"description": "max of:",
"details": [
{
"value": 0.1,
"description": "ConstantScore(content:test), product
of:", <------ constant score
"details": [
{
"value": 1,
"description": "boost"
},
{
"value": 0.1,
"description": "queryNorm"
}
]
}
]
}

I want to use Wildcard, Morphology and score type "cross_fields"
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html#type-cross-fields
(like in the "multi_match"
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html
query),
i.e. the sum of all keyword scores in all fields together.

Does anyone know how I can achieve this? Thanks in advance

--
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/b0d15f46-6d49-4831-972b-e1638a1c689d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #2