This message was deleted.
# community-help
s
This message was deleted.
j
Could you share a curl request with all the search parameters and also the full API response from Typesense?
a
I'm using Python to search, the CURL would be
Copy code
curl 'http://localhost:8108/multi_search' \
        -X POST \
        -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
        -d '{
                "searches": [
                {
                "collection": "collection_1",
                "q": pizza,
                "facet_by": "refer_ids",
                "sort_by": "_text_match:desc",
            },
            {
                "collection": "collection_2",
                "q": pizza,
                "facet_by": "refer_ids",
                "sort_by": "_text_match:desc",
            },
            {
                "collection": "collection_3",
                "q": pizza,
                "facet_by": "refer_ids",
                "sort_by": "_text_match:desc",
            },
            {
                "collection": "collection_4",
                "q": pizza,
                "facet_by": "refer_ids",
                "sort_by": "_text_match:desc",
            },
            {
                "collection": "collection_5",
                "q": pizza,
                "facet_by": "refer_ids",
                "sort_by": "_text_match:desc",
            }
            ]
            }'
I'm unable to post the full response here in slack as it's too long...
@Jason Bosco @Kishore Nallan Please help
j
Looks like the word "pizza" occurs exactly in all the records, which is why the text match score is the same. If you want to weight records where pizza occurs earlier in the field, you can set
prioritize_token_position: true
as a search paramter. Then something like "Pizza hut" will be ranked higher than "House of Pizza" as an example
If you have some popularity score in each record, you could also use this: https://typesense.org/docs/guide/ranking-and-relevance.html#ranking-based-on-relevance-and-popularity
a
This worked! But match score is still the same for "pizza" appearing in "Dominos pizza" and "Lamilanos pizza"... Can it further be manipulated?
k
Yeah because the text is matching in the exact manner. If you want to prioritize between them then you need some other value like a popularity score as a secondary sorting field.
a
Got it. Thanks!