Elasticsearch always returning “mapping type is missing”

后端 未结 3 2070
囚心锁ツ
囚心锁ツ 2020-12-15 16:06

I\'m following the advice given here in order to find partial words with elasticsearch:

ElasticSearch n-gram tokenfilter not finding partial words

I\'ve crea

相关标签:
3条回答
  • 2020-12-15 16:17

    I think Travis was right, maybe this error came from some old version of ES, a "type" in some old version of ES is just like a table in the relational database, an "index" is like a database, a "doc" is like a record. Nowadays, the "type" seemed to disappear.

    you can see this from here.

    I don't know why I can't upload a picture.

    0 讨论(0)
  • 2020-12-15 16:26

    Set mapping for the index is possible in Elastic search. I tried this with the latest version of Elastic search 1.7.3 and I was able to set the mapping successfully to the index.

    I tried the following,

    • Delete the index (DELETE http://localhost:9200/index)
    • Put the mapping json under the index (PUT http://localhost:9200/index)
    • Get the mapping (GET http://localhost:9200//_mapping)
    0 讨论(0)
  • 2020-12-15 16:34

    Turns out this is happening because the mapping needs to be applied to the type:

    I tried applying it to the wrong thing:

    curl -XPUT 10.160.86.134:9200/products/_mapping -d '{
    

    It needs to be applied to the type like so:

    curl -XPUT 10.160.86.134:9200/products/product/_mapping -d '{
    

    It's sad that a simple google search couldn't answer this. Also the previous post I linked to is very misleading and the answer is wrong, which I'll point out there as well.

    0 讨论(0)
提交回复
热议问题