# Getting "Text missing exception" while using custom analyzers in elasticserach

**URL:** <https://discuss.elastic.co/t/getting-text-missing-exception-while-using-custom-analyzers-in-elasticserach/38942>\
**Category:** Elasticsearch\
**Created:** [January 12, 2016, 6:44am UTC](https://discuss.elastic.co/t/getting-text-missing-exception-while-using-custom-analyzers-in-elasticserach/38942 "2016-01-12T06:44:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![balubollam](https://avatars.discourse-cdn.com/v4/letter/b/a587f6/32.png) [@balubollam](https://discuss.elastic.co/u/balubollam)\
**Post date:** [January 12, 2016, 6:44am UTC](https://discuss.elastic.co/t/getting-text-missing-exception-while-using-custom-analyzers-in-elasticserach/38942/1 "2016-01-12T06:44:48Z")

</div>

Hi Everyone

I am implementing custom analyzer using following methods.But iam getting text missing ERROR

In this below 3methods when i try to know whether the analyzer is applied or not by using  
GET /sa/\_analyze?analyzer=full\_name  
iam getting  
{  
"error": "ElasticsearchIllegalArgumentException[text is missing]",  
"status": 400  
}

METHOD1:  
\*first creating analyzer in settings and adding that anaylzer to the field in the mapping  
POST sa  
{  
"settings":{  
"analysis":{  
"analyzer":{  
"full\_name":{  
"filter":[

```
                    "lowercase"
                   
                    ],
                    "type":"custom",
                    "tokenizer":"standard"
            }
        }
    }

```

},  
"mappings": {  
"check":{  
"properties": {  
"name":{  
"type": "string",  
"analyzer": "full\_name"  
}  
}  
}  
}  
}

\*indexing the data

POST sa/check/1  
{  
"\_id":1,  
"name":"BALU67 Guyfhf"  
}

METHOD2  
\*indexing the data

POST sa/check/1  
{  
"\_id":1,  
"name":"BALU67 Guyfhf"  
}

\*Closing the index to change the settings  
POST sa/\_close

\*creating the analyzer in the index settings

PUT sa/\_settings  
{  
"analysis":{  
"analyzer":{  
"full\_name":{  
"filter":[  
"standard",  
"lowercase",  
"asciifolding"  
],  
"type":"custom",  
"tokenizer":"standard"  
}  
}  
}  
}

\*opening the index  
POST sa/\_open

\*Appying the created analyzer in the settings to the mapping

POST sa/check/\_mapping?ignore\_conflicts=true  
{  
"check":{  
"properties": {  
"name":{  
"type":"string",  
"analyzer":"full\_name"  
}  
}  
}  
}

METHOD3:  
\*.IN settings creating the anaylzer

PUT /sa  
{  
"settings": {  
"analysis": {  
"analyzer": {  
"ful\_name": {  
"filter":[

```
                    "lowercase"
                
                    ],
                    "type":"custom",
                    "tokenizer":"standard"
            }
        }
    }
}

```

}

\*indxing the data

POST sa/check  
{  
"name":"CHA425 WUTH"  
}

\*Giving the created analyzer in the mapping

GET /sa/check/\_mapping?ignore\_conflicts=true  
{  
"check":{  
"properties":{  
"name":{  
"type":"string",  
"analyzer":"ful\_name"  
}  
}  
}  
}

Now in the above 3methods when i use this GET /sa/\_analyze?analyzer=full\_name  
iam getting "text missing error"  
Can anyone please help me out in this.

Thanks

---

<div class="post-metadata">

**Author:** ![johtani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johtani/32/44956_2.png) [@johtani](https://discuss.elastic.co/u/johtani)\
**Post date:** [January 12, 2016, 7:01am UTC](https://discuss.elastic.co/t/getting-text-missing-exception-while-using-custom-analyzers-in-elasticserach/38942/2 "2016-01-12T07:01:53Z")

</div>

You have to provide "text" parameter to \_analyze API.  
"text" is the data what you want to analyze.

See: [https://www.elastic.co/guide/en/elasticsearch/reference/2.1/indices-analyze.html](https://www.elastic.co/guide/en/elasticsearch/reference/2.1/indices-analyze.html)

---

<div class="post-metadata">

**Author:** ![balubollam](https://avatars.discourse-cdn.com/v4/letter/b/a587f6/32.png) [@balubollam](https://discuss.elastic.co/u/balubollam)\
**Post date:** [January 12, 2016, 10:48am UTC](https://discuss.elastic.co/t/getting-text-missing-exception-while-using-custom-analyzers-in-elasticserach/38942/3 "2016-01-12T10:48:59Z")

</div>

Ya thanks a lot. Now my custom analyzer is effecting for the content i have given in the "text"

But one Dought

For example i have given

```
 GET /my_index/_analyze?analyzer=full_name&text=GSYDGSDJH

```

Now my custom analyzer will be effected only on that text

BUT if i index data to that mapping where i have given that custom analyzer it is not effecting..

POST sa/check  
{

"name":"BALU67"  
}

NOW actually it is not effecting above field when i search that field.even i have given my analyzer to that field in that mapping.

So is their any way that my analyzer should also effect the data of fields??

Thanks

---

<div class="post-metadata">

**Author:** ![johtani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johtani/32/44956_2.png) [@johtani](https://discuss.elastic.co/u/johtani)\
**Post date:** [January 13, 2016, 10:11am UTC](https://discuss.elastic.co/t/getting-text-missing-exception-while-using-custom-analyzers-in-elasticserach/38942/4 "2016-01-13T10:11:55Z")

</div>

> [@balubollam](#):
>
> [Analyze | Elasticsearch Guide [2.1] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/2.1/indices-analyze.html)

If you want to know how to analyze based on a field mapping, you can use "field" parameter in \_analyze API instead of "analyzer" parameter.

---

<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, 11:24pm UTC](https://discuss.elastic.co/t/getting-text-missing-exception-while-using-custom-analyzers-in-elasticserach/38942/5 "2017-07-05T23:24:58Z")

</div>


