Hi <@U01PL2YSG8L> <@U01NZ4D0LDD> and Team, I'm enc...
# community-help
s
Hi @Kishore Nallan @Jason Bosco and Team, I'm encountering an error while using the Typesense Node.js client (
@typesense/client
version
1.8.2
) when performing a document search via
GET
request. The client fails and retries multiple times before throwing a JSON parsing error. Mock Request Payload (adjusted keys/values)
Copy code
{
  "q": "mock-search-id",
  "query_by": [
    "supportId",
    "vendorId",
    "storeId",
    "companyId",
    "pfAccountId",
    "name",
    "email",
    "supportType",
    "vendorType",
    "status"
  ],
  "facet_by": [
    "supportType",
    "vendorType",
    "status"
  ],
  "page": 1,
  "per_page": 50,
  "exclude_fields": [
    "id"
  ],
  "filter_by": "supportId:mock-support-id && type:VENDORS && vendorType:[STANDARD,MARKETPLACE_VENDOR,PF_VENDOR,PF_TEST_VENDOR,SUPPORT_VENDOR,TEST_VENDOR,DEACTIVATED_VENDOR,ISV_VENDOR,BLOCKED_VENDOR]",
  "max_candidates": 200,
  "infix": [
    "fallback",
    "fallback",
    "fallback",
    "fallback",
    "fallback",
    "off",
    "fallback",
    "off",
    "off",
    "off"
  ]
}
📋 Client Logs
Copy code
Request #1753775896185: Performing GET request: /collections/<collection-name>/documents/search
Request #1753775896185: Nodes Health: Node 0 is Healthy
Request #1753775896185: Updated current node to Node 0
Request #1753775896185: Attempting GET request Try #1 to Node 0
Request #1753775896185: Request to Node 0 failed due to "undefined Expected ',' or '}' after property value in JSON at position 109 (line 1 column 110)"
Request #1753775896185: Sleeping for 0.1s and then retrying request...
Request #1753775896185: Nodes Health: Node 0 is Unhealthy
Request #1753775896185: No healthy nodes were found. Returning the next node, Node 0
Request #1753775896185: Attempting GET request Try #2 to Node 0
Request #1753775896185: Request to Node 0 failed due to "undefined Expected ',' or '}' after property value in JSON at position 109 (line 1 column 110)"
Request #1753775896185: Sleeping for 0.1s and then retrying request...
Request #1753775896185: No retries left. Raising last error
Questions 1. Is the issue related to JSON serialization within the client? 2. Any advice for resolving this while keeping the same filter logic? Thanks for your help!
a
@Santhosh, Probably some small detail in the JSON structure, like an additional colon or something. I'd try stripping down everything and start adding one field at a time and check where it breaks, then work on the breaking part.
s
Just wanted to add that I also tried removing the
filter_by
field completely and even set it as an empty string (
""
), but the same error still occurs:
Copy code
Request #1753802653172: Performing GET request: /collections/<collection_name>/documents/search
Request #1753802653172: Nodes Health: Node 0 is Healthy
Request #1753802653172: No healthy nodes were found. Returning the next node, Node 0
Request #1753802653172: Attempting GET request Try #1 to Node 0
Request #1753802653172: Request to Node 0 failed due to "undefined Expected ',' or '}' after property value in JSON at position 109 (line 1 column 110)"
Request #1753802653172: Sleeping for 0.1s and then retrying request...
Request #1753802653172: Nodes Health: Node 0 is Unhealthy
Request #1753802653172: No healthy nodes were found. Returning the next node, Node 0
Request #1753802653172: Attempting GET request Try #2 to Node 0
Request #1753802653172: Request to Node 0 failed due to "undefined Expected ',' or '}' after property value in JSON at position 109 (line 1 column 110)"
Request #1753802653172: Sleeping for 0.1s and then retrying request...
Request #1753802653172: No retries left. Raising last error
Here’s the request I’m sending now (with no filter):
Copy code
{
  "q": "mock-search-id",
  "query_by": [
    "supportId",
    "vendorId",
    "storeId",
    "companyId",
    "pfAccountId",
    "name",
    "email",
    "supportType",
    "vendorType",
    "status"
  ],
  "facet_by": [
    "supportType",
    "vendorType",
    "status"
  ],
  "page": 1,
  "per_page": 50,
  "exclude_fields": [
    "id"
  ],
  "filter_by": "",
  "max_candidates": 200,
  "infix": [
    "fallback",
    "fallback",
    "fallback",
    "fallback",
    "fallback",
    "off",
    "fallback",
    "off",
    "off",
    "off"
  ]
}
a
Then the problem is likely not on filter_by. Try removing one field at a time until it works.