# Tuning the default analyzers for indexing/searching

**URL:** <https://discuss.elastic.co/t/tuning-the-default-analyzers-for-indexing-searching/58106>\
**Category:** Elasticsearch\
**Created:** [August 16, 2016, 7:11am UTC](https://discuss.elastic.co/t/tuning-the-default-analyzers-for-indexing-searching/58106 "2016-08-16T07:11:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_markus](https://avatars.discourse-cdn.com/v4/letter/_/ecb155/32.png) [@\_markus](https://discuss.elastic.co/u/_markus)\
**Post date:** [August 16, 2016, 7:11am UTC](https://discuss.elastic.co/t/tuning-the-default-analyzers-for-indexing-searching/58106/1 "2016-08-16T07:11:35Z")

</div>

Hello,

so far the default settings for analyzers (i.e. they're untouched) worked for me in the general case but starts to show it's shortcomings.

I want to tune certain aspects, e.g. I want to split words on dots which aren't by default:

```
GET _analyze?text=foo.bar.baz

{
   "tokens": [
      {
         "token": "foo.bar.baz",
         "start_offset": 0,
         "end_offset": 11,
         "type": "<ALPHANUM>",
         "position": 1
      }
   ]
}

```

I noticed I get this output also when providing an explicit `analyzer`, e.g. `&analyzer=default` or `&analyzer=standard` yields the same result.

Now, in general it's not problem: the documentation about this is OK and I've experience with it.

Basically, the defaults are fine and I just want to change them "a bit". As such, I want to replicate their current settings of the default/(standard?) analyzer exactly as they are and only adjust the parts I want to change.

I'm looking at [Standard Analyzer | Elasticsearch Guide [1.5] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/1.5/analysis-standard-analyzer.html) and I think this might be want I want =\> but I'm unable to derive what the actual definition of the analyzer is so I could build my `custom` one.

Or is it possible tune default/standard analyzer? The docs above say e.g. for the "Standard Token Filter":

> The standard token filter currently does nothing. It remains as a placeholder in case some filtering function needs to be added in a future version

Does "future" mean I can customize it?

I'm totally fine writing a complete `custom` analyzer as long as I somehow can verify that the index/search definitions match exactly what is active by default plus the things I want to add. This is important for me as I don't want to mess things up by changing the way things are analyzed in unexpected ways without me noticing it.

thanks for any pointers,

- Markus

PS: I'm still using 1.5, just waiting for the big 5 release to upgrade 🙂

---

<div class="post-metadata">

**Author:** ![\_markus](https://avatars.discourse-cdn.com/v4/letter/_/ecb155/32.png) [@\_markus](https://discuss.elastic.co/u/_markus)\
**Post date:** [August 16, 2016, 2:58pm UTC](https://discuss.elastic.co/t/tuning-the-default-analyzers-for-indexing-searching/58106/2 "2016-08-16T14:58:05Z")

</div>

FTR, my current approach, given the docs, is this setting with which I'm testing now:

```
{
  "ThatIndex": {
    "settings": {
      "index": {
        "analysis": {
          "analyzer": {
            "default": {
              "filter": [
                "standard",
                "lowercase",
                "stop"
              ],
              "type": "custom",
              "tokenizer": "standard"
            }
          }
        }
      }
    }
  }
}
```

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [August 16, 2016, 3:17pm UTC](https://discuss.elastic.co/t/tuning-the-default-analyzers-for-indexing-searching/58106/3 "2016-08-16T15:17:23Z")

</div>

> [@\_markus](#):
>
> I'm totally fine writing a complete custom analyzer as long as I somehow can verify that the index/search definitions match exactly what is active by default plus the things I want to add. This is important for me as I don't want to mess things up by changing the way things are analyzed in unexpected ways without me noticing it.

Your current approach works and can be ported to 5.0 with a few changes. In 1.5 you can specify different default analyzers for search and indexing. See [docs for details](https://www.elastic.co/guide/en/elasticsearch/reference/1.5/analysis-analyzers.html#default-analyzers). Starting with 2.3 this behavior is [slightly different](https://www.elastic.co/guide/en/elasticsearch/reference/2.3/analysis-analyzers.html#default-analyzers) though - you no longer have `default_index`.

To compare the behavior of the old default analyzer and the new custom default analyzer defined for your index, you can use two version of analyzer API. For old (global) default - don't specify the index name:

```auto
GET _analyze?text=foo.bar.baz

```

For the new default analyzer that you specified for your index use

```auto
GET ThatIndex/_analyze?text=foo.bar.baz

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 10:27pm UTC](https://discuss.elastic.co/t/tuning-the-default-analyzers-for-indexing-searching/58106/4 "2017-07-05T22:27:31Z")

</div>


