Created
December 6, 2018 16:28
-
-
Save ArihantRk/0b3c77f80a5eb173d39bc4507cc22fa0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Insert Request | |
curl -XPUT -H -"Content-Type: application/json" -u ftsadmin:ftspassword \ | |
> http://10.2.1.192:8094/api/index/fts-index -d \ | |
> '{ | |
> "type": "fulltext-index", | |
> "name": "fts-index", | |
> "sourceType": "couchbase", | |
> "sourceName": "ptxdata", | |
> "planParams": { | |
> "maxPartitionsPerPIndex": 171 | |
> }, | |
> "params": { | |
> "doc_config": { | |
> "docid_prefix_delim": "", | |
> "docid_regexp": "", | |
> "mode": "type_field", | |
> "type_field": "type" | |
> }, | |
> "mapping": { | |
> "analysis": {}, | |
> "default_analyzer": "standard", | |
> "default_datetime_parser": "dateTimeOptional", | |
> "default_field": "_all", | |
> "default_mapping": { | |
> "dynamic": true, | |
> "enabled": false | |
> }, | |
> "default_type": "_default", | |
> "docvalues_dynamic": true, | |
> "index_dynamic": true, | |
> "store_dynamic": false, | |
> "type_field": "_type", | |
> "types": { | |
> "ptxmeta": { | |
> "dynamic": false, | |
> "enabled": true | |
> } | |
> } | |
> }, | |
> "store": { | |
> "indexType": "scorch", | |
> "kvStoreName": "" | |
> } | |
> }, | |
> "sourceParams": {} | |
> }' | |
{"status":"ok"} | |
Update Request | |
curl -XPUT -H "Content-Type: application/json" -u ftsadmin:ftspassword \ | |
http://10.2.1.192:8094/api/index/fts-index -d \ | |
'{ | |
"type": "fulltext-index", | |
"name": "fts-index", | |
"sourceType": "couchbase", | |
"sourceName": "ptxdata", | |
"planParams": { | |
"maxPartitionsPerPIndex": 171 | |
}, | |
"params": { | |
"doc_config": { | |
"docid_prefix_delim": "", | |
"docid_regexp": "", | |
"mode": "type_field", | |
"type_field": "type" | |
}, | |
"mapping": { | |
"analysis": {}, | |
"default_analyzer": "standard", | |
"default_datetime_parser": "dateTimeOptional", | |
"default_field": "_all", | |
"default_mapping": { | |
"dynamic": true, | |
"enabled": false | |
}, | |
"default_type": "_default", | |
"docvalues_dynamic": true, | |
"index_dynamic": true, | |
"store_dynamic": false, | |
"type_field": "_type", | |
"types": { | |
"ptxmeta": { | |
"default_analyzer": "standard", | |
"dynamic": false, | |
"enabled": true | |
} | |
} | |
}, | |
"store": { | |
"indexType": "scorch", | |
"kvStoreName": "" | |
} | |
}, | |
"sourceParams": {} | |
}' | |
Response | |
{"error":"rest_create_index: error creating index: fts-index, err: manager_api: cannot create index because an index with the same name already exists: fts-index","request":{"name":"fts-index","params":{"doc_config":{"docid_prefix_delim":"","docid_regexp":"","mode":"type_field","type_field":"type"},"mapping":{"analysis":{},"default_analyzer":"standard","default_datetime_parser":"dateTimeOptional","default_field":"_all","default_mapping":{"dynamic":true,"enabled":false},"default_type":"_default","docvalues_dynamic":true,"index_dynamic":true,"store_dynamic":false,"type_field":"_type","types":{"ptxmeta":{"default_analyzer":"standard","dynamic":false,"enabled":true}}},"store":{"indexType":"scorch","kvStoreName":""}},"planParams":{"maxPartitionsPerPIndex":171},"sourceName":"ptxdata","sourceParams":{},"sourceType":"couchbase","type":"fulltext-index"},"status":"fail"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment