Issues with Typesense Search and JSON Formatting
TLDR Babin had issues with not getting all fields in a search. The problem was due to a JSON formatting extension in VS Code. Jason also clarified the requirement of query_by
in multi-search POST method.
2
1
1
Mar 16, 2023 (7 months ago)
Babin
08:25 PMI am using below search
{
"searches": [
{
"collection": "nic-items",
"q": "-R - ",
"page": 1,
"per_page": 250,
"include_fields": "id,sku,description,categoryName,brand,packSizeDescription"
}
]
}
However I don't get all fields that are mentioned in include_fields
This is what we get
Jason
08:36 PMBabin
08:38 PMJason
08:38 PMIf it does, could you DM me your cluster ID? I can take a closer look
Babin
08:50 PMif [[ $# -eq 3 && $1 == 'get-single-document' ]]
then
curl "${TYPE_SENSE_HOSTURL}/collections/${2}/documents/${3}" \
-X GET \
-H "X-TYPESENSE-API-KEY: ${TYPE_SENSE_API_MASTER_KEY}"
fi
This one gives me more than one documents
Babin
08:50 PMBabin
09:03 PMJason
09:19 PMBabin
09:19 PMJason
09:50 PMBabin
09:50 PMBabin
09:50 PMBabin
09:57 PM1
1
Babin
09:58 PM1
Babin
10:00 PMIn multi-search POST method, is it mandatory to send
query_by
The GET search without query_by works .
${TYPE_SENSE_HOSTURL}/collections/${2}/documents/search?q=*&page=1&per_page=250&exclude_fields=images,salesSheet
Jason
10:12 PMq=*
queries, query_by
is not required. Otherwise it is requiredBabin
10:12 PM1
Typesense
Indexed 2779 threads (79% resolved)
Similar Threads
Multiple Filters and JSON Requests in Typesense
Manish asked about multiple filter_by arguments, JSON input, and using multisearch. Jason offered typesense documentation links, examples, and how to use JSON formatted requests with multisearch. Ed shared a similar use case.
Querying and Indexing Multiple Elements Issues
Krish queried fields with multiple elements, which Kishore Nallan suggested checking `drop_tokens_threshold`. Krish wished to force OR mode for token, but Kishore Nallan admitted the feature was missing. Krish was able to resolve the issue with url encoding.
Moving from Algolia to Typesense: Questions and Answers
Juan sought advice from Kishore Nallan about moving from Algolia to Typesense, handling MultiSearch, setting parameters, checking imported documents, and a specific syntax query.
Cold Start Problem with Dynamic Collections
Adrian reported cold start issues with dynamic collections. Jason suggested using wildcard `*` for query_by parameters, upgrading to `0.25.0.rc34`, and clarified conventions. Adrian's issues were resolved but they reported a limitation that will potentially be addressed.
Resolving Typesense Analytics "top_queries" Collection Issue
Zain faced issues with typesense analytics and an empty "top_queries" collection. Jason and Kishore Nallan assisted in troubleshooting, identified a bug, and suggested a fix in `0.25.0.rc66`. The fix worked for Zain.