2016-11-23 34 views

回答

0

_all字段的默認映射不包括存儲詞向量:

"_all": { 
     "full_name": "_all", 
     "mapping": { 
     "_all": { 
      "enabled": true, 
      "store": false, 
      "store_term_vectors": false, 
      "store_term_vector_offsets": false, 
      "store_term_vector_positions": false, 
      "store_term_vector_payloads": false, 
      "norms": true, 
      "analyzer": "default", 
      "similarity": "BM25" 
     } 
     } 
    } 

和,也似乎_all場有點特別,Elasticsearch不是compute the vectors on the fly

你只爲_all選擇是它能夠長期向量:

PUT integrity 
{ 
    "mappings": { 
    "body": { 
     "_all": { 
     "term_vector": "with_positions_offsets" 
     }, 
     "properties": { 
     "label": { 
      "type": "keyword", 
      "index": "not_analyzed", 
      "store": true 
     }, 
     "body": { 
      "type": "text", 
      "store": true 
     } 
     } 
    } 
    } 
} 
+0

我改「田」是[「身體」],仍然不起作用。聽起來像我需要用你的方法重建索引呢? – firstprayer

相關問題