2014-07-07 55 views
0

我已经设置映射标题字段文章类型为testindex1指标如下:Elasticsearch termvector API不工作

PUT /testindex1/article/_mapping 
{ 
    "article": { 
    "type": "object", 
    "dynamic": false, 
    "properties": { 
     "title": { 
     "type": "string", 
     "store": true, 
     "term_vector": "with_positions_offsets", 
     "_index": { 
      "enabled": true 
     } 
     }, 
    } 
    } 
} 

省略映射规范的剩余部分。 (这个例子和那些遵循假定奇迹感仪表板界面。)testindex1然后与制品填充,包括物品ID为4540

正如预期的那样,

GET /testindex1/article/4540/?fields=title 

产生

{ 
    "_index": "testindex1", 
    "_type": "article", 
    "_id": "4540", 
    "_version": 1, 
    "exists": true, 
    "fields": { 
     "title": "Elasticsearch is the best solution" 
    } 
} 

(标题文字已被更改以保护无辜)。

但是,

GET /testindex1/article/4540/_termvector?fields=title 

产生

No handler found for uri [/testindex1/article/4540/_termvector?fields=title&_=1404765178625] and method [GET] 

我与映射规范的变体和termvector请求的变体试验,到目前为止也没有用。我还在官方和非官方文档以及涵盖Elasticsearch主题的论坛上寻找提示,其中包括Stack Overflow。 elasticsearch.org看起来很权威。我希望我滥用termvector API的方式对于熟悉它的人来说会立即显而易见。请指出我的错误(s)。谢谢。

+0

你有没有尝试过这种奇迹感例如之外卷曲?它对我来说工作得很好。你使用什么版本的ES? –

+0

我试着用curl来获取_termvector。它产生了相同的“不处理”结果。 ES版本是0.90.13。 – taina

+0

我升级到1.0 Beta版,术语矢量API有效。非常感谢您回答这个问题。 – taina

回答