Hi Team I'm observing an inconsistency in facet co...
# community-help
v
Hi Team I'm observing an inconsistency in facet counts in my Typesense search Use Case: When I search using
"*"
(wildcard) on the
Client Name List
field, the facet counts shown (like
Augustus Limited: 80234
) are correct and reflect the actual document counts accurately. Problem: However, when I search using a term like
"augustus"
in the same
Client Name List
facet field, the filtered list of facet values (e.g.,
Augustus Limited
,
Augustus Foundation
, etc.) appears, but their counts are significantly lower or don't match the wildcard counts — despite documents being visible in the results for those clients. 🧪 What I did: •
facet_by=Client Name List
• No filters applied when searching with
*
• When typing
"augustus"
in the facet field, it triggers filtering/searching using the facet values that contain "augustus", but the counts shown are incorrect or inconsistent compared to the wildcard result. I Have attached screen shots and payload for refs.
👀 1
a
Parthiban, That is because of the way Typesense handles queries. You can read more about it here.
v
Hi @Alan Martini i have tried all parameters stated here but still not working as expected You can read more about it here. When I search with q=* and facet by client name list, the value "abc limited" shows a count of around 80,000. But when I search with q="abc limited" and facet by the same field, the count drops to about 40,000. The field "client name list" is a string with facet: true. I want the facet count for "abc limited" to remain the same as what is returned in the q=* search, since I'm trying to get the total document count for that client. How can I ensure that facet counts reflect the same result as a wildcard * query even when a specific term is searched?
This is the new schema we have updated for enabling sort
Copy code
{
  "enable_nested_fields": true,
  "fields": [
    {
      "name": ".*",
      "type": "auto"
    },
    {
      "name": ".*_str",
      "optional": true,
      "sort": true,
      "type": "string"
    },
    {
      "facet": false,
      "index": true,
      "infix": false,
      "locale": "",
      "name": "ocr_data",
      "optional": true,
      "sort": false,
      "stem": false,
      "type": "string"
    },
    {
      "facet": true,
      "index": true,
      "infix": false,
      "locale": "",
      "name": "system.lf.file.properties.Extension_str",
      "optional": true,
      "sort": true,
      "stem": false,
      "type": "string"
    },
    {
      "facet": true,
      "index": true,
      "infix": false,
      "locale": "",
      "name": "system.lf.file.properties.file_modified_date",
      "optional": true,
      "sort": true,
      "stem": false,
      "type": "int64"
    },
    {
      "facet": true,
      "index": true,
      "infix": false,
      "locale": "",
      "name": "system.lf.file.properties.ModifiedDate",
      "optional": true,
      "sort": true,
      "stem": false,
      "type": "int64"
    },
    {
      "facet": true,
      "index": true,
      "infix": false,
      "locale": "",
      "name": "system.lf.file.properties.CreatedDate",
      "optional": true,
      "sort": true,
      "stem": false,
      "type": "int64"
    },
    {
      "facet": true,
      "index": true,
      "infix": false,
      "locale": "",
      "name": "system.lf.file.properties.template.template_name_str",
      "optional": true,
      "sort": true,
      "stem": false,
      "type": "string"
    },
    {
      "facet": true,
      "index": true,
      "infix": false,
      "locale": "",
      "name": "system.lf.file.properties.template.template_fields.Client Name List_str",
      "optional": true,
      "sort": true,
      "stem": false,
      "type": "string"
    },
    {
      "facet": true,
      "index": true,
      "infix": false,
      "locale": "",
      "name": "system.lf.file.properties.template.template_fields.Client ID_str",
      "optional": true,
      "sort": true,
      "stem": false,
      "type": "string"
    },
    {
      "facet": false,
      "index": true,
      "infix": false,
      "locale": "",
      "name": "dfx_restricted_document",
      "optional": true,
      "sort": false,
      "stem": false,
      "type": "string"
    },
    {
      "facet": true,
      "index": true,
      "infix": false,
      "locale": "",
      "name": "system.lf.file.properties.CreatedBy_str",
      "optional": true,
      "sort": true,
      "stem": false,
      "type": "string"
    },
    {
      "facet": true,
      "index": true,
      "infix": false,
      "locale": "",
      "name": "system.lf.file.properties.template.template_fields.Matter Document Type_str",
      "optional": true,
      "sort": true,
      "stem": false,
      "type": "string"
    },
    {
      "facet": true,
      "index": true,
      "infix": false,
      "locale": "",
      "name": "system.lf.file.properties.template.template_fields.Matter Document Sub Type_str",
      "optional": true,
      "sort": true,
      "stem": false,
      "type": "string"
    },
    {
      "facet": true,
      "index": true,
      "infix": false,
      "locale": "",
      "name": "system.lf.file.properties.template.template_fields.Lawyer",
      "optional": true,
      "sort": true,
      "stem": false,
      "type": "string"
    },
    {
      "facet": true,
      "index": true,
      "infix": false,
      "locale": "",
      "name": "system.lf.file.properties.template.template_fields.Matter Document Sub Folder_str",
      "optional": true,
      "sort": true,
      "stem": false,
      "type": "string"
    }
  ],
  "name": "RC1"
}
After the above schema change only i am facing facet mismatch for q=* and q=search term of client name