Hi guys, I’m running into a ranking issue and was...
# community-help
j
Hi guys, I’m running into a ranking issue and was wondering if there’s a config that would help with it It doesn’t handle sequential matching very well. For example: • When I search
just enough
,
Just Enough Items
comes up as expected • When I search
just e
, it seems to match
just
and
e
separately, and the ranking is much worse Is there a config for sequential or phrase-like matching, or anything along those lines that would help here?
j
Hi Josh. Could you share the search parameters you were using? Preferably as a cURL request. There are query parameters that could be helpful here,
prioritize_token_position
would be one.
j
Hey @Jonathan King! Sorry for the delay. Here it is - any recommendations? query_by:
Copy code
[
        "name",
        "indexed_name",
        "slug",
        "author",
        "indexed_author",
        "summary",
    ]
query_by_weights:
Copy code
vec![15, 15, 10, 3, 3, 1]
prefix:
Copy code
vec![true, true, true, true, true, true]
prioritize_exact_match: true prioritize_num_matching_fields: false text_match_type: max_weight bucketing: buckets(5)
j
Hi Josh. Sure, two good parameters to try would be: •
prioritize_token_position: true
- this should make sure that results with 'just' at the front are ranked higher than ones with results starting with words with the letter e •
drop_tokens_threshold=0
- this will ensure that only words with both 'just' AND a word starting with e are matched. If you let us know some more about what is bad about the rankings you're getting we could provide more options. The reason you're unexpected results is probably that by default Typesense takes the last word in the query and uses it as a prefix match, so it will be matching any word in your collection that starts with the letter e - which is probably a lot of words. This will be flooding your results and possibly be confusing rankings.
👍 1
j
Hey we tried this, but it doesn't seem to improve the results at all
Config is above including your recommended changes - any suggestions?