Hello, I'm new here. I have a collection of produ...
# community-help
j
Hello, I'm new here. I have a collection of products with an attribute to store the category path of each product. The category attribute values looks like this:
e5feca4f-267b-4e44-a5b7-7d4ca1f3c90d/4686092b-6c91-42cb-a47f-786c84608dfa|ParentCategory/ChildCategory
the structure is
{parent-id}/{child-id}|{parent-name}/{child-name}
. I'm facing an issue where Typesense doesn't return all matches when a given parent category id is provided, any idea why? For this search I'm using some filter queries parameters:
Copy code
{
  q: "{parent-id}",
  query_by: "category.path",
  sort_by: "_text_match:desc",
  split_join_tokens: "always",
}
I'm using Typesense v0.23.1.
@Jason Bosco @Kishore Nallan
j
You want to try setting
max_candidates: 1000
On a side note, given that your field has a specific pattern to it, you might want to consider storing each component (parent-id, child-id, etc) inside it's own separate field and then use
filter_by
to do structured matches, instead of using the q parameter and fuzzy search
j
I did see about the
max_candidates
attribute, but I have a question, whether when using
max_candidates
setting a value greater than the default (e.g.: 100 or 1000) it does not generate some impact and cost in processing and memory in requests.
j
It impacts performance - the higher that value, the more CPU cycles are needed.
j
Thanks you, I'll do a test using
max_candidates