# Problem in setting analyzer

**URL:** <https://discuss.elastic.co/t/problem-in-setting-analyzer/4734>\
**Category:** Elasticsearch\
**Created:** [June 29, 2011, 12:10pm UTC](https://discuss.elastic.co/t/problem-in-setting-analyzer/4734 "2011-06-29T12:10:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nachiket](https://avatars.discourse-cdn.com/v4/letter/n/4491bb/32.png) [@nachiket](https://discuss.elastic.co/u/nachiket)\
**Post date:** [June 29, 2011, 12:10pm UTC](https://discuss.elastic.co/t/problem-in-setting-analyzer/4734/1 "2011-06-29T12:10:37Z")

</div>

Hi.  
I am trying to set my own analyzer in elasticsearch.yml file. Problem  
is it is giving setting exception. Can somebody help me?

index :  
analysis :  
analyzer :  
standard :  
type : standard  
stopwords : [stop1, stop2]  
myAnalyzer1 :  
type : standard  
stopwords : [stop1, stop2, stop3]  
max\_token\_length : 500  
# configure a custom analyzer which is  
# exactly like the default standard analyzer  
myAnalyzer2 :  
type: pattern  
lowercase: true  
pattern: ,|OR|AND  
flag: "CASE\_INSENSITIVE|COMMENTS"

SettingsException[Failed to load settings from [file:/home/user/  
elasticsearch.yml]]  
ParserException[while parsing a block mapping; expected ,  
but found BlockMappingStart]

Regards.

---

<div class="post-metadata">

**Author:** ![nachiket](https://avatars.discourse-cdn.com/v4/letter/n/4491bb/32.png) [@nachiket](https://discuss.elastic.co/u/nachiket)\
**Post date:** [June 30, 2011, 9:20am UTC](https://discuss.elastic.co/t/problem-in-setting-analyzer/4734/2 "2011-06-30T09:20:57Z")

</div>

Hi. I am getting problem for setting analyzers for many types. Can  
somebody please help me??  
elasticsearch/0.16.2}: Setup Failed ...

- SettingsException[Failed to load settings from [file:/home/nachiket/  
Softwares/elasticsearch-0.16.2/config/elasticsearch.yml]]  
ParserException[while parsing a block mapping; expected , but found BlockMappingStart]

My code is  
index :  
analysis :  
analyzer :  
myAnalyzer2 :  
type : custom  
tokenizer : myTokenizer1  
filter : [myTokenFilter1, myTokenFilter2]  
char\_filter : [my\_html]

# myanalyzer1 :

# type: standard

# stopwords: [no , stopwords]

# max\_token\_length: 20

```
    myAnalyzer3:
		type: english
		stopwords: [stop , stop1]
    tokenizer :
        myTokenizer1 :
            type : pattern
            pattern : "(\\W*,\\W*)|(\\W*OR\\W*)|(\\W*AND\\W*)"
    filter :
        myTokenFilter1 :
            type : synonym
            synonyms_path : "synonym.txt"
        myTokenFilter2 :
            type : length
            min : 0
            max : 2000
    char_filter :
          my_html :
            type : html_strip
            escaped_tags : [xxx, yyy]
            read_ahead : 1024
```

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [June 30, 2011, 10:15am UTC](https://discuss.elastic.co/t/problem-in-setting-analyzer/4734/3 "2011-06-30T10:15:23Z")

</div>

Hiya

On Thu, 2011-06-30 at 02:20 -0700, nachiket bhagwat wrote:

> Hi. I am getting problem for setting analyzers for many types. Can  
> somebody please help me??  
> elasticsearch/0.16.2}: Setup Failed ...
> 
> - SettingsException[Failed to load settings from [file:/home/nachiket/  
> Softwares/elasticsearch-0.16.2/config/elasticsearch.yml]]  
> ParserException[while parsing a block mapping; expected , but found BlockMappingStart]

This sounds like a YAML syntax error, but when I try the config you  
posted, I can parse it correctly.

I wonder if it is not something else in your config file which is  
throwing off the parsing.

I dumped the YAML that I parsed, and this was the output:

* * *

index:  
analysis:  
analyzer:  
myAnalyzer2:  
char\_filter:  
- my\_html  
filter:  
- myTokenFilter1  
- myTokenFilter2  
tokenizer: myTokenizer1  
type: custom  
myAnalyzer3:  
stopwords:  
- stop  
- stop1  
type: english  
char\_filter:  
my\_html:  
escaped\_tags:  
- xxx  
- yyy  
read\_ahead: 1024  
type: html\_strip  
filter:  
myTokenFilter1:  
synonyms\_path: synonym.txt  
type: synonym  
myTokenFilter2:  
max: 2000  
min: 0  
type: length  
tokenizer:  
myTokenizer1:  
pattern: '(\W\*,\W\*)|(\W_OR\W_)|(\W_AND\W_)'  
type: pattern

clint

---

<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 6, 2017, 4:02am UTC](https://discuss.elastic.co/t/problem-in-setting-analyzer/4734/4 "2017-07-06T04:02:10Z")

</div>


