Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Filtered Functions #142

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add Filtered Functions #142

wants to merge 1 commit into from

Conversation

crocme10
Copy link

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