Analyzer not found when it is custom


(Siddharth Gupta) #1

When I use the following command:

curl -XGET 'x.x.x.x:9200/_analyze?analyzer=standardAnalyzer_Name&pretty' -d 'justice this is a
test http'

It says :

'{
"error" : "ElasticsearchIllegalArgumentException[failed to find analyzer [standardAnalyzer_Name]]",
"status" : 400
}
'
Although it is there in my mapping :
'{
"analysis": {
"filter": {

  "filter_stop_custom": {
      "type":       "stop",
      "stopwords": [ "Mr.", "Mrs.", "Senior", "Junior" ]
  }        

},

"analyzer": {
"commaAnalyzer_titles": {
"type" : "custom",
"tokenizer" : "standard"
"filter" : [ "lowercase", "filter_stop_custom" ]
} ,
}

}
}'

Can anybody help me with this issue ?

Thanks
Siddharth


(Mark Walkom) #2

Can you format the analyser code so it's easier to read please.


(David Pilato) #3

You have to specify the index name when you run the _analyze query.

curl -XGET 'x.x.x.x:9200/index/_analyze

(Siddharth Gupta) #4

Thanks for the reply!
But still it returns the same error..


(Siddharth Gupta) #5

`{
"analysis": {
"filter": {

"filter_stop_custom": {
"type": "stop",
"stopwords": [ "Mr.", "Mrs.", "Senior", "Junior" ]
}

},

"analyzer": {
"commaAnalyzer_titles": {
"type" : "custom",
"tokenizer" : "standard"
"filter" : [ "lowercase", "filter_stop_custom" ]
} ,
}

}
}`


(Ivan Brusic) #6

Due to the way custom analyzers are created, they are tied to an index that
contains them in the mapping.

What David is saying is that you need to add a specific index to the API
call, not just simply the word index.

Ivan


(system) #7