简体   繁体   English

如何仅在现有 cassandra 表的几列上创建弹性搜索索引

[英]How to create elastic search index on only few columns on existing cassandra table

I have table on Elassandra.我有关于 Elassandra 的桌子。 I need to create elastic search index on only few columns of that table not on entire table.我只需要在该表的几列而不是整个表上创建弹性搜索索引。

{"discover":".*"} option is creating index on all columns of the table. {"discover":".*"} 选项是在表的所有列上创建索引。 But i am unable create index on few columns.但我无法在几列上创建索引。

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" }
                            }
        }
    }
}'

Not sure what is the mistake.不知道是什么错误。 Please help me to correct syntax for few columns but not all.请帮助我纠正几列但不是全部的语法。

Your syntax is correct to create an index on few columns on an existing table.您的语法对于在现有表的几列上创建索引是正确的。 Check that the index does not already exists, and your keyspace and table names are correct.检查索引是否已经存在,并且您的键空间和表名称是否正确。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM