2

I want to define custom analyzers through the REST API (I'm using a hosted service - http://searchbox.io ), but I can't understand how to do it.

I'm trying to create a PUT request to /myindex/_settings with the following:

   index: {
            analysis: {
                    analyzer: {
                            "my_analyzer": {
                                    type: "snowball",
                                    language: "English"
                            }
                    }
            }
    }

but it doesn't work, if I index a field with "my_analyzer" set as the analyzer I'm getting an error that it doesn't exist..

2
  • after you've put the settings, what happens when you try to get them back using get settings api? /myindex/_settings ? Commented Feb 18, 2013 at 12:50
  • I see general index settings, nothing related to analysis and analyzers. Commented Feb 18, 2013 at 13:20

1 Answer 1

1

I found the answer - those settings must be set when creating the index.

so a POST request to /myindex did it.

Sign up to request clarification or add additional context in comments.

2 Comments

Correct, otherwise you need to close the index before adding the analyzer and then reopen the index. Have a look here.
Could you elaborate on this? Maybe post a small complete dictionary you were using to specify this? I'm stuck at this point :-/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.