Reputation: 978
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?
Upvotes: 0
Views: 670
Reputation: 15768
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.
Change your code to
var createIndex = function(refId, docFeed) {
esClient.create({
index: "indexname",
type: "typename",
id: refId,
body: docFeed
},
function(error, response) {
emptyFunction();
});
Upvotes: 3
Reputation: 19283
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.
Upvotes: 0