ncb000gt / node-es

NodeJS module for ElasticSearch.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't have _id=0

gabegorelick opened this issue · comments

utils.pathAppend doesn't work if resource === 0:

exports.pathAppend = function (resource) {
        'use strict';

        if (resource) {
                return '/' + resource;
        }

        return '';
};

This means operations on documents with _id=0 will instead operate on the entire type. For example, this:

es.delete({_index: 'foo', _type: 'bar', _id: 0}, ...)

ignores the _id and issues DELETE /foo/bar.