【问题标题】:How to create elastic search index on only few columns on existing cassandra table如何仅在现有 cassandra 表的几列上创建弹性搜索索引
【发布时间】:2020-10-08 05:37:25
【问题描述】:

我在 Elassandra 有桌子。我需要在该表的几列而不是整个表上创建弹性搜索索引。

{"discover":".*"} 选项正在为表的所有列创建索引。但我无法在几列上创建索引。

curl -XPUT -H 'Content-Type: application/json' 'http://localhost:9200/test_idx' -d '{
"settings": {"keyspace":"dm" },
       "mappings": {
           "mytable": { 
              "properties": {
                     "did": { "type": "text" },
                     "defectx": { "type": "float" },
                     "defecty": { "type": "float" },
                     "mdc": { "type": "text" }
                            }
        }
    }
}'

不知道是什么错误。请帮我纠正少数列的语法,但不是全部。

【问题讨论】:

  • 你的弹性版本是什么?请提供弹性答案
  • 我可以通过传递 cql_collection 在几列上创建索引。 "did": {"type": "text", "cql_collection":"singleton" }

标签: elasticsearch elassandra


【解决方案1】:

在现有表的几列上创建索引是正确的。 检查索引是否已存在,并且您的键空间和表名是否正确。

【讨论】:

  • 多次验证。一切都是正确的,该索引不存在
  • 我可以通过传递 cql_collection 在几列上创建索引。 "did": {"type": "text", "cql_collection":"singleton" }
猜你喜欢
  • 2014-09-01
  • 1970-01-01
  • 1970-01-01
  • 2019-09-28
  • 2022-08-17
  • 2018-03-27
  • 2018-07-15
  • 1970-01-01
  • 2016-12-07
相关资源
最近更新 更多