Troubleshooting Typesense Query Issues
TLDR Ralf had an issue with no results for a Typesense query. Jason solved it by advising the version number should match in both the document and query.
Oct 29, 2022 (14 months ago)
Ralf
10:54 AMcurrently I setup search for a web page with Typesense. I already have to server running and scrapped my page. There are 5327 documents added to my collection "antora-docs".
When I query the collection (either via web interface or Rest API containing a filter that is an asterix or a concret term) I'm not able to get any results back.
I added information about my collection, an example document and the multi_search body.
Anyone with an idea what's going on or what I can do to get results?
Collection information (5327 documents):
{
"created_at": 1667035078,
"default_sorting_field": "item_priority",
"fields": [
{
"facet": false,
"index": true,
"infix": false,
"locale": "",
"name": "anchor",
"optional": true,
"sort": false,
"type": "string"
},
{
"facet": false,
"index": true,
"infix": false,
"locale": "",
"name": "content",
"optional": true,
"sort": false,
"type": "string"
},
{
"facet": true,
"index": true,
"infix": false,
"locale": "",
"name": "url",
"optional": false,
"sort": false,
"type": "string"
},
{
"facet": true,
"index": true,
"infix": false,
"locale": "",
"name": "version",
"optional": true,
"sort": false,
"type": "string[]"
},
{
"facet": true,
"index": true,
"infix": false,
"locale": "",
"name": "hierarchy.lvl0",
"optional": true,
"sort": false,
"type": "string"
},
{
"facet": true,
"index": true,
"infix": false,
"locale": "",
"name": "hierarchy.lvl1",
"optional": true,
"sort": false,
"type": "string"
},
{
"facet": true,
"index": true,
"infix": false,
"locale": "",
"name": "hierarchy.lvl2",
"optional": true,
"sort": false,
"type": "string"
},
{
"facet": true,
"index": true,
"infix": false,
"locale": "",
"name": "hierarchy.lvl3",
"optional": true,
"sort": false,
"type": "string"
},
{
"facet": true,
"index": true,
"infix": false,
"locale": "",
"name": "hierarchy.lvl4",
"optional": true,
"sort": false,
"type": "string"
},
{
"facet": true,
"index": true,
"infix": false,
"locale": "",
"name": "hierarchy.lvl5",
"optional": true,
"sort": false,
"type": "string"
},
{
"facet": true,
"index": true,
"infix": false,
"locale": "",
"name": "hierarchy.lvl6",
"optional": true,
"sort": false,
"type": "string"
},
{
"facet": true,
"index": true,
"infix": false,
"locale": "",
"name": ".*_tag",
"optional": true,
"sort": false,
"type": "string"
},
{
"facet": true,
"index": true,
"infix": false,
"locale": "",
"name": "language",
"optional": true,
"sort": false,
"type": "string"
},
{
"facet": true,
"index": true,
"infix": false,
"locale": "",
"name": "tags",
"optional": true,
"sort": false,
"type": "string[]"
},
{
"facet": false,
"index": true,
"infix": false,
"locale": "",
"name": "item_priority",
"optional": false,
"sort": true,
"type": "int64"
}
],
"name": "antora-docs_1667035078",
"num_documents": 5327,
"symbols_to_index": [],
"token_separators": []
}
Document example:
GET: /collections/antora-docs/documents/25
{
"component": "redshift-datavault",
"content": "This article was moved to Zendesk",
"content_camel": "This article was moved to Zendesk",
"hierarchy": {
"lvl0": "Redshift Data Vault latest",
"lvl1": "External Configuration for Connection Attributes",
"lvl2": null,
"lvl3": null,
"lvl4": null,
"lvl5": null,
"lvl6": null
},
"hierarchy.lvl0": "Redshift Data Vault latest",
"hierarchy.lvl1": "External Configuration for Connection Attributes",
"hierarchy_camel": [
{
"lvl0": "Redshift Data Vault latest",
"lvl1": "External Configuration for Connection Attributes",
"lvl2": null,
"lvl3": null,
"lvl4": null,
"lvl5": null,
"lvl6": null
}
],
"hierarchy_radio": {
"lvl0": null,
"lvl1": null,
"lvl2": null,
"lvl3": null,
"lvl4": null,
"lvl5": null
},
"hierarchy_radio_camel": {
"lvl0": null,
"lvl1": null,
"lvl2": null,
"lvl3": null,
"lvl4": null,
"lvl5": null
},
"id": "25",
"item_priority": 1,
"no_variables": false,
"objectID": "83dde568c42f117cfdbd12b76b6aa96e59d114e3",
"tags": [],
"type": "content",
"url": "",
"url_without_anchor": "",
"url_without_variables": "",
"version": [
"latest"
],
"weight": {
"level": 0,
"page_rank": 0,
"position": 1
}
}
When i run a multi search I do not get any matches:
POST: /multi_search
{
"searches": [
{
"collection": "antora-docs",
"q": "redshift",
"query_by": "hierarchy.lvl0,hierarchy.lvl1,hierarchy.lvl2,hierarchy.lvl3,hierarchy.lvl4,hierarchy.lvl5,hierarchy.lvl6,content",
"include_fields": "hierarchy.lvl0,hierarchy.lvl1,hierarchy.lvl2,hierarchy.lvl3,hierarchy.lvl4,hierarchy.lvl5,hierarchy.lvl6,content,anchor,url,type,id",
"highlight_full_fields": "hierarchy.lvl0,hierarchy.lvl1,hierarchy.lvl2,hierarchy.lvl3,hierarchy.lvl4,hierarchy.lvl5,hierarchy.lvl6,content",
"group_by": "url",
"group_limit": 3,
"filter_by": "version:=0.21.0"
}
]
}
Response:
{
"results": [
{
"facet_counts": [],
"found": 0,
"grouped_hits": [],
"out_of": 5327,
"page": 1,
"request_params": {
"collection_name": "antora-docs_1667035078",
"per_page": 10,
"q": "redshift"
},
"search_cutoff": false,
"search_time_ms": 0
}
]
}
Even if i query with an asterix, the response is empty. Anyone with an idea what's going on or what I can do to get results?
``````
Jason
06:44 PM"filter_by": "version:=0.21.0"
, but in your document you have:"version": [
"latest"
],
You’d need to specify the version in a meta tag
Jason
06:45 PMNov 02, 2022 (14 months ago)
Ralf
07:58 AMTypesense
Indexed 3015 threads (79% resolved)
Similar Threads
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.
Solving Typesense Docsearch Scraper Issues
Sandeep was having issues with Typesense's docsearch scraper and getting fewer results than with Algolia's scraper. Jason helped by sharing the query they use and advised checking the running version of the scraper. The issue was resolved when Sandeep ran the non-base regular docker image.
Troubleshooting Typesense Document Import Error
Christopher had trouble importing 2.1M documents into Typesense due to memory errors. Jason clarified the system requirements, explaining the correlation between RAM and dataset size, and ways to tackle the issue. They both also discussed database-like query options.