We did our test with 中國翻譯 (Chinese Translators Journal) which have two words highly present in our Catalog: China and translation.
First, the default Koha behaviour is to add a "*" at the end of the searched word, which lead to 0 results. It produces a query looking like this one:
$ curl "
http://localhost:9200/koha_robin_biblios/_search?pretty" -d '{"from": 0, "size": 0,"query":{"query_string":{"query": "中國翻譯*"}}}'
{
"took" : 1,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : 0,
"max_score" : 0.0,
"hits" : [ ]
}
}
If we quote 中國翻譯 in Koha, it yields one answer, the right one. It produces a query looking like this one:
$ curl "
http://bouse02.prive.bulac.fr:9200/koha_robin_biblios/_search?pretty" -d '{"from": 0, "size": 0,"query":{"query_string":{"query": "\"中國翻譯\""}}}'
{
"took" : 5,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : 1,
"max_score" : 0.0,
"hits" : [ ]
}
}
Note that if I write an Elasticsearch query without quotes or star, it yields too much results (9626), the “right” result isn't in the ten first results:
$ curl "
http://bouse02.prive.bulac.fr:9200/koha_robin_biblios/_search?pretty" -d '{"from": 0, "size": 0,"query":{"query_string":{"query": "中國翻譯"}}}'
{
"took" : 16,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : 9626,
"max_score" : 0.0,
"hits" : [ ]
}
}
I'm not sure what the right behaviour needs to be. We felt adding quotes added a lot of relevance to our results no matter what the language is. What is certain is that adding a star to the search by default doesn't help us. We didn't have the problem with Elasticsearch while playing with it in 17.05. For us, it is a regression. I add the MARC of our test record.