Boosting in a query_string doesn't work on a "not_analyzed" field

Hi,

I have a little query_string which boosts one field :

"query_string": {
"query": "name:(se*)^20 se*"
}

I also have a mapping (snippet)
"name": {
"type": "string",
"index": "not_analyzed"
},

With the "not_analyzed" the _score field is always the same.
If I delete the "not_analyzed" mapping I get meaningful _score values.

Please have a look at :

Thanks,

Uli

In related news, rails+tire+Elasticsearch, applying boost and not_analyzed
breaks indexing.

On Thursday, August 2, 2012 11:22:03 AM UTC+1, Uli Schimpfle wrote:

Hi,

I have a little query_string which boosts one field :

"query_string": {
"query": "name:(se*)^20 se*"
}

I also have a mapping (snippet)
"name": {
"type": "string",
"index": "not_analyzed"
},

With the "not_analyzed" the _score field is always the same.
If I delete the "not_analyzed" mapping I get meaningful _score values.

Please have a look at :
ElasticSearch boost/not_analyzed problem · GitHub

Thanks,

Uli

--

Hi Uri

With the "not_analyzed" the _score field is always the same.
If I delete the "not_analyzed" mapping I get meaningful _score values.

Actually, you're not getting meaningful values. If you add

"explain": true

to your query, you will see that the not_analyzed and analyzed queries
behave in exactly the same way. The only difference is the "query norm"
which is an attempt to normalize scoring between different queries.

Wildcards can not be assigned a meaningful score.

clint

--