I think I have found another bug in the FTS. Not sure I am doing something wrong or if it is really a bug, but it seems that the sorting is not working.
trying to run this query using a sort object:
SELECT a_app_release_date
FROM `search` AS a
WHERE sub_type="me"
AND SEARCH(a,{ "fields": [ "*" ], "highlight": {}, "sort": [{ "by" : "field", "field" : "a_app_release_date", "mode" : "max", "missing" : "last", "type": "number" }], "query": { "query": "+dark" }, "size": 100, "from": 0 })
and the list of results looks like this:
[
{
"a_app_release_date": 1607587200
},
{
"a_app_release_date": 1533649045
},
{
"a_app_release_date": 1553612837
},
{
"a_app_release_date": 1585897200
},
{
"a_app_release_date": 1547295010
}
]
As you can see the results are not in the order of the release date.
If I try without using a sort order object
SELECT a_app_release_date
FROM `search` AS a
WHERE sub_type="me"
AND SEARCH(a,{ "fields": [ "*" ], "highlight": {}, "sort": ["a_app_release_date"], "query": { "query": "+dark" }, "size": 100, "from": 0 })
List of results looks like this:
[
{
"a_app_release_date": 1579852800
},
{
"a_app_release_date": 1564815600
},
{
"a_app_release_date": 1588921200
},
{
"a_app_release_date": 1556402530
},
{
"a_app_release_date": 1595660400
}
]
As you can see, again the results are not int the correct order
The a_app_release_date is indexed as a number as you can see in the below index definition
{
"name": "search_reduced",
"type": "fulltext-index",
"params": {
"doc_config": {
"docid_prefix_delim": "",
"docid_regexp": "",
"mode": "type_field",
"type_field": "sub_type"
},
"mapping": {
"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": {
"me": {
"dynamic": false,
"enabled": true,
"properties": {
"a_app_id": {
"enabled": true,
"dynamic": false,
"fields": [
{
"docvalues": true,
"include_in_all": true,
"index": true,
"name": "app_id",
"type": "text"
}
]
},
"a_app_bundle_id": {
"enabled": true,
"dynamic": false,
"fields": [
{
"docvalues": true,
"include_in_all": true,
"index": true,
"name": "app_bundle_id",
"type": "text"
}
]
},
"a_app_name": {
"enabled": true,
"dynamic": false,
"fields": [
{
"docvalues": true,
"include_in_all": true,
"include_term_vectors": true,
"index": true,
"name": "app_name",
"type": "text"
}
]
},
"a_app_provider_name": {
"enabled": true,
"dynamic": false,
"fields": [
{
"docvalues": true,
"include_in_all": true,
"include_term_vectors": true,
"index": true,
"name": "app_provider_name",
"type": "text"
}
]
},
"a_app_release_date": {
"enabled": true,
"dynamic": false,
"fields": [
{
"docvalues": true,
"include_in_all": true,
"include_term_vectors": true,
"index": true,
"name": "app_release_date",
"type": "number"
}
]
},
"a_app_seller_name": {
"enabled": true,
"dynamic": false,
"fields": [
{
"docvalues": true,
"include_in_all": true,
"include_term_vectors": true,
"index": true,
"name": "app_seller_name",
"type": "text"
}
]
},
"a_hp": {
"enabled": true,
"dynamic": false,
"fields": [
{
"docvalues": true,
"include_in_all": true,
"include_term_vectors": true,
"index": true,
"name": "hp",
"type": "number"
}
]
},
"app_uuid": {
"enabled": true,
"dynamic": false,
"fields": [
{
"docvalues": true,
"include_in_all": true,
"index": true,
"name": "app_uuid",
"type": "text"
}
]
}
}
}
}
},
"store": {
"indexType": "scorch"
}
},
"sourceType": "couchbase",
"sourceName": "search",
"sourceUUID": "0784c2c848bd1dcf8d8c5148fe6a2bdd",
"sourceParams": {},
"planParams": {
"maxPartitionsPerPIndex": 171,
"indexPartitions": 6,
"numReplicas": 0
},
"uuid": "50a151c870d281bb"
}
Am I doing something wrong or is really a bug?
Thank you,