Can not get any result from indexed indice


(Weizhen Yan) #1

I successfully created an index, the last few lines after index was created.
{ "create" : { "_index" : "nfltest", "_type" : "external", "_id" : "AVIRFrqdQfEj8oBbCsmr", "_version" : 1, "_shards" : { "total" : 2, "successful" : 1, "failed" : 0 }, "status" : 201 } }, { "create" : { "_index" : "nfltest", "_type" : "external", "_id" : "AVIRFrqdQfEj8oBbCsms", "_version" : 1, "_shards" : { "total" : 2, "successful" : 1, "failed" : 0 }, "status" : 201 } } ] }

and then I run
curl 'localhost:9200/_cat/indices?v'

which gives me the following result

health status index pri rep docs.count docs.deleted store.size pri.store.size yellow open nfltest 5 1 44896 0 8.6mb 8.6mb

but when I tried to run

curl -XGET localhost:9200/nfltest/external/_bulk?pretty

the result is
{ "_index" : "nfltest", "_type" : "external", "_id" : "_bulk", "found" : false }

I also find this post :Document found with _search but not with GET

it did return result when I use _search .
any idea how can I fix it? Thank you


(Yannick Welsch) #2

The bulk api is used to perform many index/delete operations in a single API call (see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html )

It is used with -XPOST or -XPUT.

What your command does is try to access a document with id "_bulk" (see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html )


(Weizhen Yan) #3

Thanks ! I see why, but is there anyway that I can query the index generated by bulk api through the terminal?

Also I have some mapping issues, I was following this tutorial :Data visualization with Elasticsearch aggregations and D3
since it was published in 2014, and used the old version of ES, I rewrote the mapping file, the original mapping is here .
My mapping :

{
"mappings": {

 "external": {

   "properties": {
         "gameid" : {
            "type" : "string",
            "index" : "not_analyzed",
            "store" : "true"
        },

        "qtr" : {
            "type" : "short",
            "store" : "true"
        },

        "min" : {
            "type" : "short",
            "store" : "true",
             "ignore_malformed": "true"
            },

        "sec" : {
            "type" : "short",
            "store" : "true"             
        },

        "off" : {
            "type" : "string"           
        },
        "def" : {
            "type" : "string"            
        },

        "down" : {
            "type" : "short",
            "store" : "true",
            "ignore_malformed": "true"
        },

        "togo" : {
            "type" : "short",
            "store" : "true",
            "ignore_malformed": "true"
        },

        "ydline" : {
            "type" : "short",
            "store" : "true",
            "ignore_malformed": "true"
        },

        "scorediff" : {
            "type" : "short",
            "store" : "true"
        },

        "series1stdn" : {
            "type" : "short",
            "store" : "true"
        },

        "description" : {
            "type" : "string",
            "store" : "true"
        },

        "scorechange" : {
            "type" : "short",
            "store" : "true"
        },

        "nextscore" : {
            "type" : "short",
            "store" : "true"
        },

        "teamwin" : {
            "type" : "short",
            "store" : "true"
        },

        "offscore" : {
            "type" : "short",
            "store" : "true"
        },

        "defscore" : {
            "type" : "short",
            "store" : "true"
        },

        "season" : {
            "type" : "date",
            "format" : "YYYY",
           "ignore_malformed": "true"
        }
    }
 }

}
}
`

I keep getting this error
{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Root mapping definition has unsupported parameters:
I went through the break change document, still have no idea which parameter should be replaced or rewrite.


(system) #4