0

This is my code which Im using to index some data. But,when I search for the index,in elasticsearch it is not getting created there.

var createIndex = function(refId,docFeed){
    esClient.create({
        index:"indexName",
        type:"typeName",
        id:refId,
        body:docFeed    
    },
        function(error,response){
            emptyFunction();
    });

}

Can anybody help me on this?

1
  • 1
    Instead of emptyFunction use something else to print the error. Also check your cluster log for error messages. Post the error you see, it will make easy for users to identify the issue and help you better. Commented Apr 27, 2015 at 14:47

2 Answers 2

3

Index names are limited by the file system. They may only be lower case, and my not start with an underscore. While we(elasticsearch) don't prevent index names starting with a ., we(elasticsearch) reserve those for internal use. Clearly, . and .. cannot be used.

source

Change your code to

var createIndex = function(refId, docFeed) {
    esClient.create({
        index: "indexname",
        type: "typename",
        id: refId,
        body: docFeed
      },
      function(error, response) {
        emptyFunction();
      });

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

Comments

0

I presume the problem is with your index name. Elasticsearch doesnt allow,capital letters in index name and type creation. So better try with index name and type names with lower case.

Comments

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.