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

Exclude filter in aggregations only supports syntax for strings #12421

Closed
marius-dr opened this issue Jun 20, 2017 · 2 comments
Closed

Exclude filter in aggregations only supports syntax for strings #12421

marius-dr opened this issue Jun 20, 2017 · 2 comments
Labels
enhancement New value added to drive a business result Feature:Vis Editor Visualization editor issues good first issue low hanging fruit Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@marius-dr
Copy link
Member

Kibana version: 5.4.2

Elasticsearch version: 5.4.2

Server OS version: Windows

Description of the problem including expected versus actual behavior:
An exclude filter in an aggregation will always be treated as a string filter (it will be wrapped in double quotes). It should also be able to accept an array of values, which is the way that's used to filter other types of values, like numbers.

Steps to reproduce:

  1. Create a terms aggregation on a numeric field.
  2. Add a value in the Exclude filter in the Advanced sub-page in the correct format ( Ex: [404] )

Request is made like this:

 "aggs": {
    "2": {
      "terms": {
        "field": "machine.ram",
        "exclude": "[4297]",
        "size": 5,
        "order": {
          "_count": "desc"
        }
      }
    }
  }

It should be made like this, if it detects that the field is not a String field.

  "aggs": {
    "2": {
      "terms": {
        "field": "machine.ram",
        "exclude": [4297],
        "size": 5,
        "order": {
          "_count": "desc"
        }
      }
    }
  }

Errors in browser console (if relevant):

Error: Request to Elasticsearch failed: {"error":{"root_cause":[{"type":"aggregation_execution_exception","reason":"Aggregation [2] cannot support regular expression style include/exclude settings as they can only be applied to string fields. Use an array of numeric values for include/exclude clauses used to filter numeric fields"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"logstash-0","node":"dfiqFrvgRb2E7WT0xpfHPg","reason":{"type":"aggregation_execution_exception","reason":"Aggregation [2] cannot support regular expression style include/exclude settings as they can only be applied to string fields. Use an array of numeric values for include/exclude clauses used to filter numeric fields"}}]},"status":500}
KbnError@http://localhost:5601/bundles/commons.bundle.js?v=15117:84:19366
RequestFailure@http://localhost:5601/bundles/commons.bundle.js?v=15117:84:20115
callResponseHandlers/<@http://localhost:5601/bundles/kibana.bundle.js?v=15117:28:10894
[2868]/</Promise.try@http://localhost:5601/bundles/commons.bundle.js?v=15117:83:22323
[2868]/</Promise.map/<@http://localhost:5601/bundles/commons.bundle.js?v=15117:83:21682
[2868]/</Promise.map@http://localhost:5601/bundles/commons.bundle.js?v=15117:83:21647
callResponseHandlers@http://localhost:5601/bundles/kibana.bundle.js?v=15117:28:10502
fetchWithStrategy/<@http://localhost:5601/bundles/kibana.bundle.js?v=15117:27:30047
processQueue@http://localhost:5601/bundles/commons.bundle.js?v=15117:38:23621
scheduleProcessQueue/<@http://localhost:5601/bundles/commons.bundle.js?v=15117:38:23888
$eval@http://localhost:5601/bundles/commons.bundle.js?v=15117:39:4607
$digest@http://localhost:5601/bundles/commons.bundle.js?v=15117:39:2343
$apply@http://localhost:5601/bundles/commons.bundle.js?v=15117:39:5026
done@http://localhost:5601/bundles/commons.bundle.js?v=15117:37:25016
completeRequest@http://localhost:5601/bundles/commons.bundle.js?v=15117:37:28702
createHttpBackend/</xhr.onload@http://localhost:5601/bundles/commons.bundle.js?v=15117:37:29634
@marius-dr marius-dr added Feature:Visualizations Generic visualization features (in case no more specific feature label is available) bug Fixes for quality problems that affect the customer experience labels Jun 20, 2017
@thomasneirynck thomasneirynck added release_note:enhancement and removed bug Fixes for quality problems that affect the customer experience labels Jun 26, 2017
@blackberryoctopus
Copy link

+1 Vote for this improvement.

@timroes timroes added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Sep 16, 2018
@timroes timroes added enhancement New value added to drive a business result Feature:Vis Editor Visualization editor issues good first issue low hanging fruit and removed Feature:Visualizations Generic visualization features (in case no more specific feature label is available) labels Dec 20, 2019
@timroes
Copy link
Contributor

timroes commented May 5, 2020

Closed via #59425

@timroes timroes closed this as completed May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Vis Editor Visualization editor issues good first issue low hanging fruit Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

No branches or pull requests

5 participants