Search code examples
ruby-on-railselasticsearchsearchkick

Keyword analyzer


is it possible to use the keyword analyzer from https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-keyword-analyzer.html in searchkick?

I want a specific string analyzed in a text field.


Solution

  • Yes you can provide an "advanced mapping":

    searchkick mappings: {
      properties: {
        name: {type: "keyword"}
      }
    }
    

    If you need to create a custom analyzer you can use advanced settings as well:

    searchkick settings: {analyzers: {...}}