Hi,
I’m working on a small project that need to do FTS search asynchronously since I need it to run with some parallelism.
Then, I run my app with maximum 100 parallelism (means max 100 parallel async FTS query running), I saw the bucket statistic, it shown:
- 1.6GB Fts RAM used
- 36% Max CPU Utilization
- 33.6GB free RAM of 58.5GB
- Average 8 fts queries/sec
- 169GB fts disk size
Questions:
- I was hoping could get 2.000 fts queries/sec. Is it possible? And how to achieve that?
- In the process, I’m quite seeing several times of RequestCancelledException and TimeoutException. Most of it when the search query has been running for 75 seconds. What are the possibilities caused it? And what can be done so it won’t get that exceptions?
Thank you.
Below is the FTS index definition:
{
"type": "fulltext-index",
"name": "customer",
"uuid": "2a4d9a471e091cb3",
"sourceType": "couchbase",
"sourceName": "CDG",
"sourceUUID": "39e9be42e56d114c2fcb30801325f17f",
"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": {
"CUSTOMER": {
"dynamic": false,
"enabled": true,
"properties": {
"contact": {
"dynamic": false,
"enabled": true,
"properties": {
"value": {
"dynamic": false,
"enabled": true,
"fields": [
{
"include_in_all": true,
"include_term_vectors": true,
"index": true,
"name": "value",
"store": true,
"type": "text"
}
]
}
}
},
"dob": {
"dynamic": false,
"enabled": true,
"fields": [
{
"include_in_all": true,
"include_term_vectors": true,
"index": true,
"name": "dob",
"store": true,
"type": "text"
}
]
},
"idnumber": {
"dynamic": false,
"enabled": true,
"fields": [
{
"include_in_all": true,
"include_term_vectors": true,
"index": true,
"name": "idnumber",
"store": true,
"type": "text"
}
]
},
"surname": {
"dynamic": false,
"enabled": true,
"fields": [
{
"include_in_all": true,
"include_term_vectors": true,
"index": true,
"name": "surname",
"store": true,
"type": "text"
}
]
}
}
}
}
},
"store": {
"indexType": "scorch",
"kvStoreName": ""
}
},
"sourceParams": {}
}`
Data count:
- Doc count in bucket: 103,374,998
- Count of indexed doc (type_ = CUSTOMER): 20.566.526
Source code for searching:
MatchQuery nameFuzzy = SearchQuery.match(searchKeywords).fuzziness(1);
MatchQuery nameSimple = SearchQuery.match(searchKeywords);
DisjunctionQuery ftsQueryName = SearchQuery.disjuncts(nameFuzzy, nameSimple);
AsyncBucket async = getAsyncDataBucket(message.getBucket());
Observable<SearchQueryRow> res = async.query(new SearchQuery("customer", ftsQueryName)
.serverSideTimeout(3, TimeUnit.MINUTES)
.fields("dob", "idnumber", "surname", "contact.value").limit(100))
.flatMap(AsyncSearchQueryResult::hits);
The search keywords consist of minimum 4 words.
Example of searchKeywords: "WONG MIU HIE 3202025505550101 +628123456789 19550515 "