Error defining Analysis in Template

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Error defining Analysis in Template

Michael Sick
I define a custom analyzer in my template:  https://gist.github.com/2764547

but when I make a call to create an index based on the template: https://gist.github.com/2764559

I get the following:

$ ./create_business_location_index.sh
{"error":"MapperParsingException[mapping [location]]; nested: MapperParsingExcep
tion[Analyzer [skedulerAnalyzer1] not found for field [business_location-name]];
 ","status":400}

Should this work? If so, am I configuring it correctly? 

(Comments on the custom analysis welcome but be warned, it might not be sensible as I'm just starting to play around with it)

Thanks!

Michael Sick
--------------------------------------------------------------------------------------------------------
Reply | Threaded
Open this post in threaded view
|

Re: Error defining Analysis in Template

kimchy
Administrator
The analysis section should go under settings, it should work then...

On Mon, May 21, 2012 at 10:50 PM, Michael Sick <[hidden email]> wrote:
I define a custom analyzer in my template:  https://gist.github.com/2764547

but when I make a call to create an index based on the template: https://gist.github.com/2764559

I get the following:

$ ./create_business_location_index.sh
{"error":"MapperParsingException[mapping [location]]; nested: MapperParsingExcep
tion[Analyzer [skedulerAnalyzer1] not found for field [business_location-name]];
 ","status":400}

Should this work? If so, am I configuring it correctly? 

(Comments on the custom analysis welcome but be warned, it might not be sensible as I'm just starting to play around with it)

Thanks!

Michael Sick
--------------------------------------------------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: Error defining Analysis in Template

Michael Sick
Thanks Shay! Will test.

On Wed, May 23, 2012 at 6:48 PM, Shay Banon <[hidden email]> wrote:
The analysis section should go under settings, it should work then...


On Mon, May 21, 2012 at 10:50 PM, Michael Sick <[hidden email]> wrote:
I define a custom analyzer in my template:  https://gist.github.com/2764547

but when I make a call to create an index based on the template: https://gist.github.com/2764559

I get the following:

$ ./create_business_location_index.sh
{"error":"MapperParsingException[mapping [location]]; nested: MapperParsingExcep
tion[Analyzer [skedulerAnalyzer1] not found for field [business_location-name]];
 ","status":400}

Should this work? If so, am I configuring it correctly? 

(Comments on the custom analysis welcome but be warned, it might not be sensible as I'm just starting to play around with it)

Thanks!

Michael Sick
--------------------------------------------------------------------------------------------------------


Reply | Threaded
Open this post in threaded view
|

Re: Error defining Analysis in Template

annie-xia
This post has NOT been accepted by the mailing list yet.
In reply to this post by kimchy
hi

I created a template like
===================================================
{
    "template_1": {
        "template": "temp*",
        "settings": {
            "analysis": {
                "filter": {
                    "gram_stemmer": {
                        "type": "stemmer",
                        "name": "english"
                    }
                },
                "analyzer": {
                    "auto_analyzer": {
                        "type": "pattern",
                        "pattern": "[{}()|\\ ]+",
                        "filter": "lowercase"
                    }
                }
            }
        },
        "mappings": {
            "type1": {
                "properties": {
                    "sources": {
                        "type": "string",
                        "analyzer": "auto_analyzer"
                    }
                }
            }
        }
    }
}

===================================================
but when I entered
$ curl -XPUT localhost:9200/temp1

I still got
"error":"MapperParsingException[mapping [type1]]; nested: MapperParsingException
Analyzer [auto_analyzer] not found for field [sources]]; ","status":400}


Did I have sth wrong? Thanks very much
Reply | Threaded
Open this post in threaded view
|

Re: Error defining Analysis in Template

slimdrive
Ran into the same problem today. The solution is you're missing the "index" between the "setting" and the "analysis".

So the json should be:

template_1": {
        "template": "temp*",
            "settings": {
            "index" : {
                "analysis": {

I found the answer in this thread: https://groups.google.com/forum/#!searchin/elasticsearch/index$20template$20mapping$20analyzer$20not$20found/elasticsearch/X_YRiaV6zLg/7967m7AOEGQJ