Query_string with wildcard does not calculate score


(BlueZero-2) #1

I need to search nicknames with wildcard and sort them by
relevance(score).
But, when i do a query with wildcard, then the score is always 1.0

curl -XGET http://$HOST:$PORT/pokec/pouzivatelia/_search -d '{
"from" : 0,
"size": 10,
"query" : {
"query_string" : { "default_field":"Nick",
"query":"blue" }
}
}
'

result:
"_score":1.0

curl -XGET http://$HOST:$PORT/pokec/pouzivatelia/_search -d '{
"from" : 0,
"size": 10,
"query" : {
"query_string" : { "default_field":"Nick",
"query":"blue" }
}
}
'

result:
"_score":13.376108

Is there a way to get score also with wildcard?


(Gustavo Maia) #2

Check it.

You need to set rewrite to scoring_boolean

2011/10/13 BlueZero bluezero@bluezero.sk:

I need to search nicknames with wildcard and sort them by
relevance(score).
But, when i do a query with wildcard, then the score is always 1.0

curl -XGET http://$HOST:$PORT/pokec/pouzivatelia/_search -d '{
"from" : 0,
"size": 10,
"query" : {
"query_string" : { "default_field":"Nick",
"query":"blue" }
}
}
'

result:
"_score":1.0

curl -XGET http://$HOST:$PORT/pokec/pouzivatelia/_search -d '{
"from" : 0,
"size": 10,
"query" : {
"query_string" : { "default_field":"Nick",
"query":"blue" }
}
}
'

result:
"_score":13.376108

Is there a way to get score also with wildcard?

--
Gustavo Maia


(BlueZero-2) #3

Didnt help at all

curl -XGET http://$HOST:$PORT/pokec/pouzivatelia/_search -d '{
"from" : 0,
"size": 10,
"query" : {
"query_string" : { "default_field":"Nick",
"query":"blue", "rewrite":"scoring_boolean" }
}
}
'

score:1.1630663
Nick:bluehill
score:1.1630663
Nick:Boblue
score:1.1630663
Nick:blue723
score:1.1630663
Nick:blue_eyed

So every document has the same score. But shouldnt have.

On Oct 13, 4:13 pm, Gustavo Maia gustavobbm...@gmail.com wrote:

Check it.

https://github.com/elasticsearch/elasticsearch/issues/1184

You need to set rewrite to scoring_boolean

2011/10/13 BlueZero bluez...@bluezero.sk:

I need to search nicknames with wildcard and sort them by
relevance(score).
But, when i do a query with wildcard, then thescoreis always 1.0

curl -XGET http://$HOST:$PORT/pokec/pouzivatelia/_search -d '{
"from" : 0,
"size": 10,
"query" : {
"query_string" : { "default_field":"Nick",
"query":"blue" }
}
}
'

result:
"_score":1.0

curl -XGET http://$HOST:$PORT/pokec/pouzivatelia/_search -d '{
"from" : 0,
"size": 10,
"query" : {
"query_string" : { "default_field":"Nick",
"query":"blue" }
}
}
'

result:
"_score":13.376108

Is there a way to getscorealso with wildcard?

--
Gustavo Maia


(BlueZero-2) #4

any suggestions? please.

On Oct 14, 8:59 am, BlueZero bluez...@bluezero.sk wrote:

Didnt help at all

curl -XGET http://$HOST:$PORT/pokec/pouzivatelia/_search -d '{
"from" : 0,
"size": 10,
"query" : {
"query_string" : { "default_field":"Nick",
"query":"blue", "rewrite":"scoring_boolean" }
}}

'

score:1.1630663
Nick:bluehillscore:1.1630663
Nick:Bobluescore:1.1630663
Nick:blue723score:1.1630663
Nick:blue_eyed

So every document has the samescore. But shouldnt have.

On Oct 13, 4:13 pm, Gustavo Maia gustavobbm...@gmail.com wrote:

Check it.

https://github.com/elasticsearch/elasticsearch/issues/1184

You need to set rewrite to scoring_boolean

2011/10/13 BlueZero bluez...@bluezero.sk:

I need to search nicknames with wildcard and sort them by
relevance(score).
But, when i do a query with wildcard, then thescoreis always 1.0

curl -XGET http://$HOST:$PORT/pokec/pouzivatelia/_search -d '{
"from" : 0,
"size": 10,
"query" : {
"query_string" : { "default_field":"Nick",
"query":"blue" }
}
}
'

result:
"_score":1.0

curl -XGET http://$HOST:$PORT/pokec/pouzivatelia/_search -d '{
"from" : 0,
"size": 10,
"query" : {
"query_string" : { "default_field":"Nick",
"query":"blue" }
}
}
'

result:
"_score":13.376108

Is there a way to getscorealso with wildcard?

--
Gustavo Maia


(system) #5