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

[Feature request] Wildcard search on not_analyzed fields for Elasticsearch datasource #7451

Closed
mbraeger opened this issue Feb 4, 2017 · 7 comments

Comments

@mbraeger
Copy link

mbraeger commented Feb 4, 2017

Grafana version: 4.1.1
Datasource: Elasticsearch - Native Plugin v. 3.0.0
OS: linux

Problem

With the current Elasticseach datasource plugin it is not possible to use wildcards in the Lucene query for not_analyzed fields. This concerns at least Elasticsearch version 2.3.

The reason is that the current query_string created by the plugin is not specifying lowercase_expanded_terms: false

Lucene query example

computer:cs-ccr-*

Resolution

The problem can easily be fixed by adding to query_buider.js the missing query_string option

See also Elasticsearch documentation:
https://www.elastic.co/guide/en/elasticsearch/reference/2.3/query-dsl-query-string-query.html

@mbraeger
Copy link
Author

mbraeger commented Feb 4, 2017

I have a patch ready, if you are interested.

@lpic10
Copy link
Contributor

lpic10 commented Feb 6, 2017

I can see this option was removed on Elasticsearch 5.x, do you know what is the behavior in it?

@mbraeger
Copy link
Author

mbraeger commented Feb 7, 2017

No, I did not have the time to test the behaviour with Elasticsearch 5.x. We currently still use 2.3, but I will try to make a quick test within the next days.

@cherweg
Copy link

cherweg commented Mar 2, 2017

I´s only a deprecation:
https://github.com/elastic/elasticsearch/blob/14d2b122a1b91ba14fc13fbb103e553cfddd5778/core/src/main/java/org/elasticsearch/index/query/SimpleQueryStringBuilder.java#L95-L99

I tried to write a feature to configure the query_term options ... take a look :
#7709

regards
Christian

@DvirM
Copy link

DvirM commented Mar 9, 2017

Hi Guys,

Any updates on this?

@cherweg
Copy link

cherweg commented Apr 18, 2017

Maybe someone could review my pull request?
It´s a working solution, but not the cleanest or best solution for sure. Perhaps we could make easier to merge.

(If this is the reason not to merge)

regards
christian

@torkelo
Copy link
Member

torkelo commented May 17, 2017

since this option was removed in Elastic 5.x closing this seems appropriate
elastic/elasticsearch#9978

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.

6 participants