如何在现有cassandra表上仅对少数列创建ElasticSearch索引

2o7dmzc5  于 2021-06-14  发布在  ElasticSearch
关注(0)|答案(1)|浏览(351)

我有一张关于桑德拉的table。我只需要在该表的几列上创建ElasticSearch索引,而不是在整个表上。
{“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" }
                            }
        }
    }
}'

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

zf2sa74q

zf2sa74q1#

您的语法正确,可以在现有表的少数列上创建索引。检查索引是否已经存在,键空间和表名是否正确。

相关问题