aquasecurity / esquery

An idiomatic Go query builder for ElasticSearch
Apache License 2.0
305 stars 56 forks source link

FEATURE request. Missing boost support inside Match statement. #20

Open GoncharovArturChi opened 2 years ago

GoncharovArturChi commented 2 years ago

At the moment there is no simple way to add boost directly into match statement. for example: { "match": { "name": { "boost": 30.0, "query": "Alex" } } }

the only way to have boost for match statement is huge overhead: { "bool": { "boost": 30, "must": [ { "match": { "name": { "query": "Alex" } } } ] } }

I propose to provide Boost method inside match statement to omit overcomplicating of queries. Solution is to add boost field to matchParams struct, Boost method for it and testCase to ensure that everything is mapped as expected.