Details
-
Bug
-
Resolution: Fixed
-
Major
-
Cheshire-Cat
-
Untriaged
-
1
-
Unknown
Description
Build: 7.0.0-2016
- Load dataset attached
- Create fts index with below, with only name field with keyword analyzer:
{
"type": "fulltext-index",
"name": "custom_index",
"uuid": "76f7ca8314e41ed3",
"sourceType": "gocbcore",
"sourceName": "default",
"sourceUUID": "291409e36b93f9299a862249ba874a90",
"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": {
"emp": {
"dynamic": false,
"enabled": true,
"properties": {
"name": {
"dynamic": false,
"enabled": true,
"fields": [
{
"analyzer": "keyword",
"include_in_all": true,
"include_term_vectors": true,
"index": true,
"name": "name",
"type": "text"
}
]
}
}
}
}
},
"store": {
"indexType": "scorch",
"mossStoreOptions": {}
}
},
"sourceParams": {}
}
- For the below Flex query, Number of results returned is 14, but expecting all the docs resturned as all the docs are with mutated = 0 and type "emp"
select meta().id from default USE INDEX (USING FTS, USING GSI) where type = "emp" and ( ( name like "Kagami%") OR (mutated = 0)) ORDER BY meta().id ASC
- Explain plan
{
"#operator": "Sequence",
"~children": [
{
"#operator": "Sequence",
"~children": [
{
"#operator": "IndexFtsSearch",
"index": "custom_index",
"index_id": "76f7ca8314e41ed3",
"keyspace": "default",
"namespace": "default",
"search_info": {
"field": "\"\"",
"options": "{\"index\": \"custom_index\"}",
"outname": "out",
"query": "{\"query\": {\"field\": \"name\", \"inclusive_max\": false, \"inclusive_min\": true, \"max\": \"Kagamj\", \"min\": \"Kagami\"}, \"score\": \"none\"}"
},
"using": "fts"
},
{
"#operator": "Fetch",
"keyspace": "default",
"namespace": "default"
},
{
"#operator": "Parallel",
"~child": {
"#operator": "Sequence",
"~children": [
{
"#operator": "Filter",
"condition": "(((`default`.`type`) = \"emp\") and (((`default`.`name`) like \"Kagami%\") or ((`default`.`mutated`) = 0)))"
},
{
"#operator": "InitialProject",
"result_terms": [
{
"expr": "(meta(`default`).`id`)"
}
]
}
]
}
}
]
},
{
"#operator": "Order",
"sort_terms": [
{
"expr": "(meta(`default`).`id`)"
}
]
}
]
}