Hi team :wave::skin-tone-2:, I wanted to ask: I ha...
# community-help
o
Hi team 👋🏻, I wanted to ask: I have a query parameter as
Chris Schmidt
, and I’m querying by first name, last name. However I’m getting results matched just by Chris, and no matches by the lastName, so for example I would get Chris Rogers, Chris Williams etc above Christopher Schmidt, I believe this is because it’s taking it as a whole sentence instead of per word, so my question is How could I get matches both by
Chris
and
Schmidt
🙌🏻
j
This behavior is because Typesense first searches for
Chris Schmidt
and when it doesn’t find a full exact match, it then tries to drop words from the query (configured by
drop_tokens_threshold
) and searches just
Chris
and
Schmidt
. If you’ve configured first_name to have higher priority (based on order of fields in
query_by
) it then finds an exact match for
Chris
and prioritizes those records first in the results.
Also, for shortened version of names specifically, here’s a way to handle those: https://typesense-community.slack.com/archives/C01P749MET0/p1677788106005749
Could you add your example as a comment to this feature request so we can track demand?
o
@Jason Bosco Thanks for your quick reply. I understand your explanation, however, even if I set the
weights
the same & set
prioritize exact match
to false, it would not take into account
Schmidt
& return the results for
Chris
. Do you think there’s a workaround to also take into account the second word when dropping words? Thanks added this to the Feature request, it would be awesome 🙌🏻
j
Could you try increasing
drop_tokens_treshold: 1000
and set
max_candidates: 1000
to see if that helps?