【发布时间】:2017-03-15 09:10:02
【问题描述】:
我正在从 2.x 迁移到 5.x 我正在像这样向索引添加值
indexInto (indexName / indexType) id someKey source foo
但是我也想按字段获取所有值:
def getValues(tag: String) ={
client execute {
search(indexName / indexType) query ("_field_names", tag) aggregations (termsAggregation( "agg") field tag size 1)
}
但我得到了这个例外:
RemoteTransportException[[8vWOLB2][172.17.0.5:9300][indices:data/read/search[phase/query]]]; 嵌套:IllegalArgumentException [Fielddata 在文本字段上被禁用 默认。在 [my_tag] 上设置 fielddata=true 以加载 fielddata 通过反转倒排索引在内存中。请注意,这可以 但是使用大量内存。];
我想也许可以使用keyword,如图所示here,但是这些字段在高级(由用户发送)中是未知的,所以我不能使用挂起映射
【问题讨论】:
标签: scala elasticsearch elastic4s