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

Support EXACT operator in filters #3920

Closed
nyurik opened this issue Aug 14, 2020 · 0 comments · Fixed by #3922
Closed

Support EXACT operator in filters #3920

nyurik opened this issue Aug 14, 2020 · 0 comments · Fixed by #3922

Comments

@nyurik
Copy link
Contributor

nyurik commented Aug 14, 2020

Query bar supports EXACT operator, e.g. lang=ru and lang=(ru,fr), but the filter boxes only use the default EQ operator - producing lang:ru which matches both ru and ruo.

Two possible solutions:

  • Add operator ?: OperatorType -- there could be usecases for other operators like lt -- e.g. options list preset well known values like 25%, 50%, and selecting it produces field<0.25.
  • Add exactMatch ?: boolean parameter to the FieldValueSelectionFilterConfigType, with default set to false -- not as flexible approach.

Note that ast.addOrFieldValue already supports operator as the 4th optional param, so all that's needed would be to pass it.

Relevant code:

export interface FieldValueSelectionFilterConfigType {

addOrFieldValue(
field: string,
value: Value,
must = true,
operator: OperatorType = Operator.EQ

P.S. for now just a community project, low priority unless needed by some Elastic project

nyurik added a commit to nyurik/eui that referenced this issue Aug 14, 2020
nyurik added a commit to nyurik/eui that referenced this issue Aug 14, 2020
Additionally adds a an operator example to the search bar demo,
and use `OperatorType` in all other filters TS declaration.

closes: elastic#3920
nyurik added a commit to nyurik/eui that referenced this issue Aug 14, 2020
Additionally adds a an operator example to the search bar demo,
and use `OperatorType` in all other filters TS declaration.

closes: elastic#3920
chandlerprall added a commit that referenced this issue Aug 25, 2020
* Support operator in field_value_selection filters

Additionally adds a an operator example to the search bar demo,
and use `OperatorType` in all other filters TS declaration.

closes: #3920

* update docs for field_value_selection

* changelog

Co-authored-by: Chandler Prall <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant