{
|
"name": "fix1",
|
"type": "fulltext-index",
|
"params": {
|
"doc_config": {
|
"docid_prefix_delim": "",
|
"docid_regexp": "",
|
"mode": "type_field",
|
"type_field": "type"
|
},
|
"mapping": {
|
"default_analyzer": "keyword",
|
"default_datetime_parser": "dateTimeOptional",
|
"default_field": "_all",
|
"default_mapping": {
|
"dynamic": true,
|
"enabled": false
|
},
|
"default_type": "_default",
|
"docvalues_dynamic": false,
|
"index_dynamic": true,
|
"store_dynamic": false,
|
"type_field": "_type",
|
"types": {
|
"hotel": {
|
"dynamic": true,
|
"enabled": true,
|
"properties": {
|
"company": {
|
"enabled": true,
|
"dynamic": false,
|
"fields": [
|
{
|
"index": true,
|
"name": "company",
|
"type": "text"
|
}
|
]
|
}
|
}
|
}
|
}
|
},
|
"store": {
|
"indexType": "scorch",
|
"segmentVersion": 15
|
}
|
},
|
"sourceType": "gocbcore",
|
"sourceName": "default",
|
"sourceUUID": "",
|
"sourceParams": {},
|
"planParams": {
|
"maxPartitionsPerPIndex": 64,
|
"indexPartitions": 1,
|
"numReplicas": 0
|
},
|
"uuid": ""
|
}
|
INSERT INTO default VALUES("f01",{"type":"hotel", "company":"999"});
|
INSERT INTO default VALUES("f02",{"type":"airport", "company":"999"});
|
SELECT META(t).id
|
FROM `default` AS t USE INDEX (USING FTS)
|
WHERE t.type="hotel" AND SEARCH(t,{ "match_all": {} });
|
The index is type index on "hotel". Fts returns sargable with exact and query decided to use covering index. But Fts index giving documents from non matched types too.
n1fty should not give the documents from other types or return exact false.
If use * or reference any field n1ql turn off covering and returns right results.