We use flexible4s for ElasticSearch 2.2.0. A number of queries are stored as JSON on disk and used as rawQuery through the flexible4s driver. The score as a result differs between the request sent through the command line or the elastic4s driver. The flexible4s driver always returns a result of 1 for all results, and command line execution gives two different values (for different data types).
Code for elastic 4s:
val searchResult = client.execute { search in indexName types(product, company, orga, "User", "Workplace") rawQuery preparedQuery sourceInclude(preparedSourceField:_*) sort {sortDefintions:_*} start start limit limit }.await
Please note that I deleted anything other than rawQuery preparedQuery and it did not change the score of 1 . The full command line request is quite long:
{ "query": { "bool": { "must": [ { "multi_match": { "query": "${search}", "fields": [ "name", "abbreviation", "articleNumberManufacturer", "productLine", "productTitle^10", "productSubtitle", "productDescription", "manufacturerRef.name", "props" ] } } ], "filter": [ { "or": [ { "bool": { "must": [ { "type": { "value": "Product" } }, { "term": { "publishState": "published" } } ], "must_not": [ { "term": { "productType": "MASTER" } }, { "term": { "deleted": true } } ] } } ] } ] } } }
Note that this is almost preparedQuery , but to replace $search search query. A robust REST client lookup returns 3.075806 for matches.
TeTeT source share