Time taken for FTS query

Hi,
CouchBase uses inverted index as per my knowledge.
but why search time is significantly increasing when the no. of documents doubled even though total hits for the query remain same?

Thanks,
Rajeev

It shouldn’t affect performance significantly provided you have used the right index definition, apt querying and sizing for your FTS cluster.
Without any of these info, it is hard to comment on whats happening in your case.

Cheers!

This is the index definition that I am using.

{
  "type": "fulltext-index",
  "name": "ffprofiles",
  "uuid": "c0d8fa4dfeea33b7",
  "sourceType": "couchbase",
  "sourceName": "devcpl",
  "sourceUUID": "254ed07175a79e45ea78aa01fa786c80",
  "planParams": {
    "maxPartitionsPerPIndex": 171
  },
  "params": {
    "doc_config": {
      "docid_prefix_delim": "::",
      "docid_regexp": "",
      "mode": "docid_prefix",
      "type_field": "type"
    },
    "mapping": {
      "analysis": {},
      "default_analyzer": "standard",
      "default_datetime_parser": "dateTimeOptional",
      "default_field": "_all",
      "default_mapping": {
        "default_analyzer": "",
        "dynamic": true,
        "enabled": false
      },
      "default_type": "_default",
      "docvalues_dynamic": true,
      "index_dynamic": true,
      "store_dynamic": false,
      "type_field": "_type",
      "types": {
        "FF": {
          "default_analyzer": "",
          "dynamic": false,
          "enabled": true,
          "properties": {
            "PIIPayload": {
              "default_analyzer": "",
              "dynamic": false,
              "enabled": true,
              "properties": {
                "ProfileInfo": {
                  "default_analyzer": "",
                  "dynamic": false,
                  "enabled": true,
                  "properties": {
                    "Profile": {
                      "default_analyzer": "",
                      "dynamic": false,
                      "enabled": true,
                      "properties": {
                        "Customer": {
                          "default_analyzer": "",
                          "dynamic": false,
                          "enabled": true,
                          "properties": {
                            "Address": {
                              "default_analyzer": "",
                              "dynamic": false,
                              "enabled": true,
                              "properties": {
                                "AddressLine": {
                                  "default_analyzer": "",
                                  "dynamic": false,
                                  "enabled": true,
                                  "properties": {
                                    "_text": {
                                      "default_analyzer": "",
                                      "dynamic": false,
                                      "enabled": true,
                                      "fields": [
                                        {
                                          "include_in_all": true,
                                          "include_term_vectors": true,
                                          "index": true,
                                          "name": "_text",
                                          "store": true,
                                          "type": "text"
                                        }
                                      ]
                                    }
                                  }
                                }
                              }
                            },
                            "PersonName": {
                              "default_analyzer": "",
                              "dynamic": false,
                              "enabled": true,
                              "properties": {
                                "GivenName": {
                                  "default_analyzer": "",
                                  "dynamic": false,
                                  "enabled": true,
                                  "properties": {
                                    "_text": {
                                      "default_analyzer": "",
                                      "dynamic": false,
                                      "enabled": true,
                                      "fields": [
                                        {
                                          "include_in_all": true,
                                          "include_term_vectors": true,
                                          "index": true,
                                          "name": "_text",
                                          "store": true,
                                          "type": "text"
                                        }
                                      ]
                                    }
                                  }
                                },
                                "Surname": {
                                  "default_analyzer": "",
                                  "dynamic": false,
                                  "enabled": true,
                                  "properties": {
                                    "_text": {
                                      "default_analyzer": "",
                                      "dynamic": false,
                                      "enabled": true,
                                      "fields": [
                                        {
                                          "include_in_all": true,
                                          "include_term_vectors": true,
                                          "index": true,
                                          "name": "_text",
                                          "store": true,
                                          "type": "text"
                                        }
                                      ]
                                    }
                                  }
                                }
                              }
                            },
                            "Telephone": {
                              "default_analyzer": "",
                              "dynamic": false,
                              "enabled": true,
                              "properties": {
                                "_attr": {
                                  "default_analyzer": "",
                                  "dynamic": false,
                                  "enabled": true,
                                  "properties": {
                                    "PhoneNumber": {
                                      "default_analyzer": "",
                                      "dynamic": false,
                                      "enabled": true,
                                      "fields": [
                                        {
                                          "include_in_all": true,
                                          "include_term_vectors": true,
                                          "index": true,
                                          "name": "PhoneNumber",
                                          "store": true,
                                          "type": "text"
                                        }
                                      ]
                                    }
                                  }
                                }
                              }
                            },
                            "_attr": {
                              "default_analyzer": "",
                              "dynamic": false,
                              "enabled": true,
                              "properties": {
                                "BirthDate": {
                                  "default_analyzer": "",
                                  "dynamic": false,
                                  "enabled": true,
                                  "fields": [
                                    {
                                      "include_in_all": true,
                                      "include_term_vectors": true,
                                      "index": true,
                                      "name": "BirthDate",
                                      "store": true,
                                      "type": "datetime"
                                    }
                                  ]
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "UniqueID": {
                      "default_analyzer": "",
                      "dynamic": false,
                      "enabled": true,
                      "properties": {
                        "_attr": {
                          "default_analyzer": "",
                          "dynamic": false,
                          "enabled": true,
                          "properties": {
                            "ID": {
                              "default_analyzer": "",
                              "dynamic": false,
                              "enabled": true,
                              "fields": [
                                {
                                  "include_in_all": true,
                                  "include_term_vectors": true,
                                  "index": true,
                                  "name": "ID",
                                  "store": true,
                                  "type": "text"
                                }
                              ]
                            },
                            "ID_Context": {
                              "default_analyzer": "",
                              "dynamic": false,
                              "enabled": true,
                              "fields": [
                                {
                                  "include_in_all": true,
                                  "include_term_vectors": true,
                                  "index": true,
                                  "name": "ID_Context",
                                  "store": true,
                                  "type": "text"
                                }
                              ]
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "store": {
      "indexType": "scorch",
      "kvStoreName": "mossStore"
    }
  },
  "sourceParams": {}
}

plz provide a sample document, query , FTS cluster sizing details.
If you already have a license, then please raise a CBSE with all these details…

Sample doc:

**Query:**
{
  "explain": true,
  "fields": [
    "*"
  ],
  "highlight": {},
  "query": {
    "query": " \"Zh Omarova 29 Apt 11 Almaty 050012 Kazakhstan\" "
  }
}

256 MB RAM quota for FTS looks clearly low. Not sure how many documents you are indexing now.
But making this to 700mb/1GB would be better.

If you plan to query the entire address like below, use a keyword analyzer for the addressLine _text than the default.
Field scoping the queries helps to speed it up.
While indexing also, you may skip “_all” option to save the index space, but that mandates field scoped queries.
Few indexing tips are here - https://blog.couchbase.com/full-text-search-indexing-best-practices/
Recommend a CBSE here for taking this further…

1 Like

Thank you for your insights.
I can’t take further CBSE as I don’t have a license… :slightly_smiling_face: