# Adding relevance to query\_string query, help required

**URL:** <https://discuss.elastic.co/t/adding-relevance-to-query-string-query-help-required/17978>\
**Category:** Elasticsearch\
**Created:** [June 8, 2014, 10:12am UTC](https://discuss.elastic.co/t/adding-relevance-to-query-string-query-help-required/17978 "2014-06-08T10:12:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![see613\_2](https://avatars.discourse-cdn.com/v4/letter/s/838e76/32.png) [@see613\_2](https://discuss.elastic.co/u/see613_2)\
**Post date:** [June 8, 2014, 10:12am UTC](https://discuss.elastic.co/t/adding-relevance-to-query-string-query-help-required/17978/1 "2014-06-08T10:12:33Z")

</div>

I am using a "query\_string"  
[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html](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](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](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](mailto: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](https://groups.google.com/d/msgid/elasticsearch/b0d15f46-6d49-4831-972b-e1638a1c689d%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:23am UTC](https://discuss.elastic.co/t/adding-relevance-to-query-string-query-help-required/17978/2 "2017-07-06T01:23:57Z")

</div>


