Multi-match query : how to improve results?

Hello,

I've got a list of schools indexed in my Elasticsearch, and I use it as a
source for a form field autocompletion.

There are two main fields : description & city.
(these two fields are fully ngram indexed)

Here are sample data:

| description | city |
+-------------+-----------+
| COLLEGE FOO | Paris |
| COLLEGE BAR | Marseille |
| LYCEE DUMMY | Lyon |

Here is the query I'm using :

QueryBuilder queryNgram = QueryBuilders.multiMatchQuery(queryString,
"description",
"city"
)
.tieBreaker(1f)

When I start searching "coll" => OK, Elasticsearch retrives both colleges.

When I search"coll foo" or "coll bar" however, both colleges are still
retrieved, and both have the same score.
Is it possible to increase score when multiple tokens of a field are
matched ?
(when I type "coll foo", I would like that "COLLEGE FOO" have an higher
score than "COLLEGE BAR")
(when I type "coll bar", I would like that "COLLEGE BAR" have an higher
score than "COLLEGE FOO")

(and yes, I still want to search among both description and city)

Thank you !

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

my fault, Elasticsearch returns results with higher score as I wanted, it's
my js stack that sorted items by id afterward...
problem solved...

Damien

Le jeudi 8 août 2013 10:38:24 UTC+2, Damien Ferey a écrit :

Hello,

I've got a list of schools indexed in my Elasticsearch, and I use it as a
source for a form field autocompletion.

There are two main fields : description & city.
(these two fields are fully ngram indexed)

Here are sample data:

| description | city |
+-------------+-----------+
| COLLEGE FOO | Paris |
| COLLEGE BAR | Marseille |
| LYCEE DUMMY | Lyon |

Here is the query I'm using :

QueryBuilder queryNgram = QueryBuilders.multiMatchQuery(queryString,
"description",
"city"
)
.tieBreaker(1f)

When I start searching "coll" => OK, Elasticsearch retrives both
colleges.

When I search"coll foo" or "coll bar" however, both colleges are
still retrieved, and both have the same score.
Is it possible to increase score when multiple tokens of a field are
matched ?
(when I type "coll foo", I would like that "COLLEGE FOO" have an
higher score than "COLLEGE BAR")
(when I type "coll bar", I would like that "COLLEGE BAR" have an
higher score than "COLLEGE FOO")

(and yes, I still want to search among both description and city)

Thank you !

--
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.
For more options, visit https://groups.google.com/groups/opt_out.