Hi,
Below is my index:
{
"type": "fulltext-index",
"name": "books_one_two",
"uuid": "3aa06c54b5da3a63",
"sourceType": "couchbase",
"sourceName": "books",
"sourceUUID": "9d63fbea507bdb8a1e39b7b72dc0cba3",
"planParams": {
"maxPartitionsPerPIndex": 64,
"indexPartitions": 1
},
"params": {
"doc_config": {
"docid_prefix_delim": "",
"docid_regexp": "",
"mode": "type_field",
"type_field": "_class"
},
"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": {
"com.org.One": {
"dynamic": false,
"enabled": true,
"properties": {
"field1": {
"dynamic": false,
"enabled": true,
"fields": [
{
"analyzer": "keyword",
"index": true,
"name": "field1",
"store": true,
"type": "text"
}
]
}
}
},
"com.org.Two": {
"dynamic": false,
"enabled": true,
"properties": {
"field1": {
"dynamic": false,
"enabled": true,
"fields": [
{
"analyzer": "keyword",
"index": true,
"name": "field1",
"store": true,
"type": "text"
}
]
}
}
}
}
},
"store": {
"indexType": "scorch"
}
},
"sourceParams": {}
}
**N1QL query:**
SELECT meta().id
FROM `books` as p
WHERE _class ='com.org.One'
and
SEARCH(p,{
"query": {
"conjuncts": [
{
"field": "field1",
"match": "abc def",
"analyzer": "keyword",
"operator": "or"
}
]
},
"size": 2,
"from": 0
});
field1 is an array
- No index available error is coming.
- In curl query, i just want to get data for _class = ‘com.org.One’. How to add this constraint to JSON query? I tried below but did not work:
“query”: {
“conjuncts”: [
{
“field”: “field1”,
“match”: “abc”
},
{
“_type”: “_class”,
“match”: “com.org.One”
}
]
}
Thanks
Nitesh