Question

I added the following to my elasticsearch.yml

# Index Settings
index:
  analysis:
    analyzer:
      # set standard analyzer with no stop words as the default for both indexing and searching
      default:
        type: standard
        stopwords: _none_

Now I did the following:

curl -XGET 'localhost:9200/_analyze?analyzer=default' -d 'this is a test'

and still got:

{
  "tokens": [
    {
      "token": "test",
      "start_offset": 10,
      "end_offset": 14,
      "type": "<ALPHANUM>",
      "position": 4
    }
  ]
}

I want all the words to be in there! Not that I am running elasticsearch via:

sudo /usr/local/elasticsearch/elasticsearch-0.90.0/bin/service/elasticsearch64 restart
Was it helpful?

Solution

Try this setting instead, (instead of none, use an empty string in the stopwords section)

# Index Settings
index:
  analysis:
    analyzer:
      # set standard analyzer with no stop words as the default for both indexing and searching
      default:
        type: custom
        tokenizer: standard
        filter: [standard,lowercase]

Please note that you need to restart elasticsearch service once you make this change.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top