@sreeks
Query
SELECT SEARCH_META().id
FROM Import AS import USE INDEX(index_table USING FTS)
WHERE import.type = 'bill'
AND SEARCH(import, {"indexName": "index_table", "size": 20, "score": "none", "from": 180, "query": {"conjuncts": [{"inclusive_start": TRUE, "inclusive_end": TRUE, "field": "actual_arrival_date", "start": "2020-01-01", "end": "2020-01-30"}, {"field": "containers.loads.description_text", "match_phrase": "coffee"}]}, "sort": ["actual_arrival_date"]})
Explain
plan.#operator plan.~children text
"Sequence" [{"#operator":"IndexFtsSearch","as":"import","index":"index_table","index_id":"66d28f58757a98f5","keyspace":"Import","namespace":"default","search_info":{"field":"\"\"","outname":"out","query":"{\"from\": 180, \"indexName\": \"index_table\", \"query\": {\"conjuncts\": [{\"end\": \"2020-01-30\", \"field\": \"actual_arrival_date\", \"inclusive_end\": true, \"inclusive_start\": true, \"start\": \"2020-01-01\"}, {\"field\": \"containers.loads.description_text\", \"match_phrase\": \"coffee\"}]}, \"score\": \"none\", \"size\": 20, \"sort\": [\"actual_arrival_date\"]}"},"using":"fts"},{"#operator":"Fetch","as":"import","keyspace":"Import","namespace":"default"},{"#operator":"Parallel","~child":{"#operator":"Sequence","~children":[{"#operator":"Filter","condition":"(((`import`.`type`) = \"bill\") and search(`import`, {\"from\": 180, \"indexName\": \"index_table\", \"query\": {\"conjuncts\": [{\"end\": \"2020-01-30\", \"field\": \"actual_arrival_date\", \"inclusive_end\": true, \"inclusive_start\": true, \"start\": \"2020-01-01\"}, {\"field\": \"containers.loads.description_text\", \"match_phrase\": \"coffee\"}]}, \"score\": \"none\", \"size\": 20, \"sort\": [\"actual_arrival_date\"]}))"},{"#operator":"InitialProject","result_terms":[{"expr":"(search_meta((`import`.`out`)).`id`)"}]}]}}] "SELECT SEARCH_META().id\nFROM Import AS import USE INDEX(index_table USING FTS)\nWHERE import.type = 'bill'\n AND SEARCH(import, {\"indexName\": \"index_table\", \"size\": 20, \"score\": \"none\", \"from\": 180, \"query\": {\"conjuncts\": [{\"inclusive_start\": TRUE, \"inclusive_end\": TRUE, \"field\": \"actual_arrival_date\", \"start\": \"2020-01-01\", \"end\": \"2020-01-30\"}, {\"field\": \"containers.loads.description_text\", \"match_phrase\": \"coffee\"}]}, \"sort\": [\"actual_arrival_date\"]})"
Query
SELECT COUNT(1)
FROM Import AS import USE INDEX(index_table USING FTS)
WHERE import.type = 'bill'
AND SEARCH(import, {"indexName": "index_table", "size": 20, "score": "none", "from": 180, "query": {"conjuncts": [{"inclusive_start": TRUE, "inclusive_end": TRUE, "field": "actual_arrival_date", "start": "2020-01-01", "end": "2020-01-30"}, {"field": "containers.loads.description_text", "match_phrase": "coffee"}]}, "sort": ["actual_arrival_date"]})
Explain
plan.#operator plan.~children text
"Sequence" [{"#operator":"IndexFtsSearch","as":"import","covers":["cover (search(`import`, {\"from\": 180, \"indexName\": \"index_table\", \"query\": {\"conjuncts\": [{\"end\": \"2020-01-30\", \"field\": \"actual_arrival_date\", \"inclusive_end\": true, \"inclusive_start\": true, \"start\": \"2020-01-01\"}, {\"field\": \"containers.loads.description_text\", \"match_phrase\": \"coffee\"}]}, \"score\": \"none\", \"size\": 20, \"sort\": [\"actual_arrival_date\"]}))","cover ((meta(`import`).`id`))","cover (search_score((`import`.`out`)))","cover (search_meta((`import`.`out`)))"],"filter_covers":{"cover ((`import`.`type`))":"bill"},"index":"index_table","index_id":"66d28f58757a98f5","keyspace":"Import","namespace":"default","search_info":{"field":"\"\"","outname":"out","query":"{\"from\": 180, \"indexName\": \"index_table\", \"query\": {\"conjuncts\": [{\"end\": \"2020-01-30\", \"field\": \"actual_arrival_date\", \"inclusive_end\": true, \"inclusive_start\": true, \"start\": \"2020-01-01\"}, {\"field\": \"containers.loads.description_text\", \"match_phrase\": \"coffee\"}]}, \"score\": \"none\", \"size\": 20, \"sort\": [\"actual_arrival_date\"]}"},"using":"fts"},{"#operator":"Parallel","~child":{"#operator":"Sequence","~children":[{"#operator":"Filter","condition":"((cover ((`import`.`type`)) = \"bill\") and cover (search(`import`, {\"from\": 180, \"indexName\": \"index_table\", \"query\": {\"conjuncts\": [{\"end\": \"2020-01-30\", \"field\": \"actual_arrival_date\", \"inclusive_end\": true, \"inclusive_start\": true, \"start\": \"2020-01-01\"}, {\"field\": \"containers.loads.description_text\", \"match_phrase\": \"coffee\"}]}, \"score\": \"none\", \"size\": 20, \"sort\": [\"actual_arrival_date\"]})))"},{"#operator":"InitialGroup","aggregates":["count(1)"],"group_keys":[]}]}},{"#operator":"IntermediateGroup","aggregates":["count(1)"],"group_keys":[]},{"#operator":"FinalGroup","aggregates":["count(1)"],"group_keys":[]},{"#operator":"Parallel","~child":{"#operator":"Sequence","~children":[{"#operator":"InitialProject","result_terms":[{"expr":"count(1)"}]}]}}] "SELECT COUNT(1)\nFROM Import AS import USE INDEX(index_table USING FTS)\nWHERE import.type = 'bill'\n AND SEARCH(import, {\"indexName\": \"index_table\", \"size\": 20, \"score\": \"none\", \"from\": 180, \"query\": {\"conjuncts\": [{\"inclusive_start\": TRUE, \"inclusive_end\": TRUE, \"field\": \"actual_arrival_date\", \"start\": \"2020-01-01\", \"end\": \"2020-01-30\"}, {\"field\": \"containers.loads.description_text\", \"match_phrase\": \"coffee\"}]}, \"sort\": [\"actual_arrival_date\"]})"