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

391 views Asked by At

I have table on 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. 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.

1

There are 1 answers

2
vroyer On

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.