Skip to content

Add Filtered Functions#142

Open
crocme10 wants to merge 1 commit intobenashford:masterfrom
crocme10:filter_function_score
Open

Add Filtered Functions#142
crocme10 wants to merge 1 commit intobenashford:masterfrom
crocme10:filter_function_score

Conversation

@crocme10
Copy link
Copy Markdown

In a 'function_score', functions may have a filter and a weight.
This commit wraps around the existing Function enum by creating
a FilteredFunction struct, which contains both a function and a filter.

This is explained in the Elasticsearch documentation. Here is an example
"function_score": { "query": { "match_all": {} }, "boost": "5", "functions": [ { "filter": { "match": { "test": "bar" } }, "random_score": {}, "weight": 23 }, { "filter": { "match": { "test": "cat" } }, "weight": 42 } ],

In a 'function_score', functions may have a filter and a weight.
This commit wraps around the existing Function enum by creating
a FilteredFunction struct, which contains both a function and a filter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant