0

I have not specified any analyzer and I have a field which has a hex. String where all the letters present are being converted to lower case.

How do I stop it (what's analyzer/token filter should be used)?

1 Answer 1

1

If an analyzer is not specified then the default standard analyzer and the keyword analyzer are applied, they do the following:

Standard Analyzer

The standard analyzer divides text into terms on word boundaries, as defined by the Unicode Text Segmentation algorithm. It removes most punctuation, lowercases terms, and supports removing stop words.

Keyword Analyzer

The keyword analyzer is a “noop” analyzer that accepts whatever text it is given and outputs the exact same text as a single term.

https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-analyzers.html

To access the no-op (no operation) keyword analyzer where case is preserved add .keyword to the end of the field name like so:

{
  "query": {
    "term" : { 
      "hex_value.keyword" : "#00FF00" 
    } 
  }
}

This will perform the case sensitive search sought after.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.