Details
-
Bug
-
Resolution: Not a Bug
-
Major
-
None
-
7.1.2
-
None
-
Untriaged
-
1
-
Unknown
Description
Search sorts in a N1QL query do not behave the same as REST
SELECT META(t1).id, SEARCH_META().score AS score
|
FROM `travel-sample`._default._default AS t1
|
WHERE
|
SEARCH(t1, { "query": { "query": "description:pool name:pool^5" }, "sort": ["-_score"] }) |
(first 10 items)
id score
"hotel_25802" 0.07521544001878888
"hotel_32143" 0.11392390286955434
"hotel_26221" 0.10014470402974802
"hotel_3785" 0.19176251402426092
"hotel_36154" 0.06392083800808698
"hotel_5848" 0.059654535244319754
"hotel_33539" 0.10250137354286498
"hotel_26215" 0.10250137354286498
"hotel_5839" 0.06276901339501338
"hotel_21889" 0.07619869161649878
In the FTS UI search tool
{ "query": { "query": "description:pool name:pool^5" }, "sort": ["-_score"] }
|
(first 10 items)
- hotel_20420 [0.27119313335123585]
- hotel_3785 [0.19176251402426092]
- hotel_40383 [0.19176251402426092]
- hotel_25303 [0.19176251402426092]
- hotel_4396 [0.19176251402426092]
- hotel_3786 [0.17753758049387366]
- hotel_20423 [0.16607119975276755]
- hotel_25671 [0.13559656667561792]
- hotel_16631 [0.13559656667561792]
- hotel_15915 [0.13027696954031814]
The actual index:
curl -XPUT -H "Content-Type: application/json" \
|
-u <username>:<password> http://192.168.3.150:8094/api/index/test_geojson -d \
|
'{
|
"type": "fulltext-index",
|
"name": "test_geojson",
|
"sourceType": "gocbcore",
|
"sourceName": "travel-sample",
|
"planParams": {
|
"maxPartitionsPerPIndex": 1024,
|
"indexPartitions": 1
|
},
|
"params": {
|
"doc_config": {
|
"docid_prefix_delim": "",
|
"docid_regexp": "",
|
"mode": "scope.collection.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": false,
|
"index_dynamic": true,
|
"store_dynamic": false,
|
"type_field": "_type",
|
"types": {
|
"_default._default": {
|
"dynamic": true,
|
"enabled": true,
|
"properties": {
|
"airportname": {
|
"dynamic": false,
|
"enabled": true,
|
"fields": [
|
{
|
"include_in_all": true,
|
"index": true,
|
"name": "airportname",
|
"store": true,
|
"type": "text"
|
},
|
{
|
"analyzer": "keyword",
|
"include_in_all": true,
|
"index": true,
|
"name": "name",
|
"store": true,
|
"type": "text"
|
}
|
]
|
},
|
"geo": {
|
"dynamic": false,
|
"enabled": true,
|
"fields": [
|
{
|
"include_in_all": true,
|
"index": true,
|
"name": "geo",
|
"store": true,
|
"type": "geopoint"
|
}
|
]
|
},
|
"geoarea": {
|
"dynamic": false,
|
"enabled": true,
|
"fields": [
|
{
|
"include_in_all": true,
|
"index": true,
|
"name": "geoarea",
|
"type": "geoshape"
|
}
|
]
|
},
|
"geojson": {
|
"dynamic": false,
|
"enabled": true,
|
"fields": [
|
{
|
"include_in_all": true,
|
"index": true,
|
"name": "geojson",
|
"type": "geoshape"
|
}
|
]
|
},
|
"name": {
|
"dynamic": false,
|
"enabled": true,
|
"fields": [
|
{
|
"analyzer": "keyword",
|
"include_in_all": true,
|
"index": true,
|
"name": "name",
|
"store": true,
|
"type": "text"
|
}
|
]
|
}
|
}
|
}
|
}
|
},
|
"store": {
|
"indexType": "scorch",
|
"segmentVersion": 15,
|
"spatialPlugin": "s2"
|
}
|
},
|
"sourceParams": {}
|
}'
|