2016-09-03 3 views
0

отображения Почему эта настройка отображения (часть моего шаблона индекса) дает мне эту ошибку:Elasticsearch ошибка

"error": "MapperParsingException[mapping [properties]]; nested: MapperParsingException[Root type mapping not empty after parsing! Remaining fields: [cache : {type=string}] [metatag.description : {index=no, type=string}] [title : {type=string}] [content : {analyzer=autocomplete_shingles_analyzer, type=string}] [url : {type=string}] [tstamp : {format=dateOptionalTime, index=no, type=date}] [anchor : {type=string}] [segment : {type=string}] [digest : {type=string}] [host : {type=string}] [boost : {type=string}] [id : {type=string}] [metatag.keywords : {index=no, type=string}]]; ", 
    "status": 400 

установке Mapping, часть моего шаблона индекса

POST /_template/dev3index 
{ 
    "template": "dev*", 
    "settings": { 
     "number_of_shards": 1, 
     "number_of_replicas": 0, 
    "analysis": { 
     "filter": { 
     "autocomplete_shingles_filter": { 
      "type": "shingle", 
      "min_shingle_size": 2, 
      "max_shingle_size": 5, 
      "output_unigrams": true 
     } 
     }, 
     "analyzer": { 
     "autocomplete_shingles_analyzer": { 
      "type": "custom", 
      "tokenizer": "whitespace", 
      "filter": [ 
      "lowercase", 
      "autocomplete_shingles_filter" 
      ] 
     } 
     } 
    } 
    }, 
    "mappings": { 
    "properties": { 
     "anchor": { 
     "type": "string" 
     }, 
     "boost": { 
      "type": "string" 
     }, 
     "cache": { 
      "type": "string" 
     }, 
     "content": { 
      "type": "string", 
      "analyzer": "autocomplete_shingles_analyzer" 
     }, 
     "digest": { 
      "type": "string" 
     }, 
     "host": { 
      "type": "string" 
     }, 
     "id": { 
      "type": "string" 
     }, 
     "metatag.description": { 
      "type": "string", 
      "index": "no" 
     }, 
     "metatag.keywords": { 
      "type": "string", 
      "index": "no" 
     }, 
     "segment": { 
      "type": "string" 
     }, 
     "title": { 
      "type": "string" 
     }, 
     "tstamp": { 
      "type": "date", 
      "format": "dateOptionalTime", 
      "index": "no" 
     }, 
     "url": { 
      "type": "string" 
     } 
     } 
    } 
    } 

Я использую Sense ES.

Я использую Nutch для сканирования небольшого количества сайтов, поэтому я пытаюсь настроить индекс до того, как ES это сделает. Я использую ES 1.5.2

ответ

0

Прямой дочерний элемент «сопоставления» должен быть именем типа, с элементом «properties», вложенным под ним. Я привел пример ниже, где я вставил тип под названием «my_type»:

{ 
    "template":"dev*", 
    "settings":{ 
     "number_of_shards":1, 
     "number_of_replicas":0, 
     "analysis":{ 
     "filter":{ 
      "autocomplete_shingles_filter":{ 
       "type":"shingle", 
       "min_shingle_size":2, 
       "max_shingle_size":5, 
       "output_unigrams":true 
      } 
     }, 
     "analyzer":{ 
      "autocomplete_shingles_analyzer":{ 
       "type":"custom", 
       "tokenizer":"whitespace", 
       "filter":[ 
        "lowercase", 
        "autocomplete_shingles_filter" 
       ] 
      } 
     } 
     } 
    }, 
    "mappings":{ 
     "my_type":{ 
     "properties":{ 
      "anchor":{ 
       "type":"string" 
      }, 
      "boost":{ 
       "type":"string" 
      }, 
      "cache":{ 
       "type":"string" 
      }, 
      "content":{ 
       "type":"string", 
       "analyzer":"autocomplete_shingles_analyzer" 
      }, 
      "digest":{ 
       "type":"string" 
      }, 
      "host":{ 
       "type":"string" 
      }, 
      "id":{ 
       "type":"string" 
      }, 
      "metatag.description":{ 
       "type":"string", 
       "index":"no" 
      }, 
      "metatag.keywords":{ 
       "type":"string", 
       "index":"no" 
      }, 
      "segment":{ 
       "type":"string" 
      }, 
      "title":{ 
       "type":"string" 
      }, 
      "tstamp":{ 
       "type":"date", 
       "format":"dateOptionalTime", 
       "index":"no" 
      }, 
      "url":{ 
       "type":"string" 
      } 
     } 
     } 
    } 
} 
+0

awesome! что-то настолько простое - нужны свежие глаза – user3125823

Смежные вопросы