{ "collection": "books_collection", "q": "conc...
# community-help
a
{ "collection": "books_collection", "q": "concept of physics", "query_by": "isbn,title,author,embedding,publication", "sort_by": "num_is_out_of_stackasc, text matchdesc,ranking:desc", "page": 1, "per_page": 12, "facet_by": "agedGroup,author,binding,bookCondition,bookType,isOutOfStock,language,price,publication", "max_facet_values": 10, "facet_sample_percent": 20, "facet_sample_threshold": 1000, "drop_tokens_threshold": 0, "typo_tokens_threshold": 10, "num_typos": 2, "min_len_1typo": 2, "split_join_tokens": "always", "highlight_full_fields": "isbn,title,author,embedding,publication", "prioritize_token_position": true, "pre_segmented_query": true, "exclude_fields": "embedding", "stopwords": "stopword-set-1" } @Kishore Nallan http://103.217.221.238/search?value=concept%20of%20physics&sortBy=books_collection%[…]f_stack%3Aasc%2CiDate%3Adesc&query=concept%2520of%2520physics why 4th book not comming on top whose ranking and search text is most high
f
Hey @Akash Kumar, Could you share your full query? I can't open the site myself.
a
{"searches":[{"q":"concept of physics","query_by":"isbn,title,author, embedding,publication","prioritize_token_position":true,"max_facet_values":10,"num_typos":"2","min_len_1typo":2,"split_join_tokens":"always","typo_tokens_threshold":10,"per_page":12,"sort_by":"num_is_out_of_stackasc, text matchdesc,ranking:desc","pre_segmented_query":true,"drop_tokens_threshold":0,"facet_sample_threshold":1000,"facet_sample_percent":20,"exclude_fields":"embedding","stopwords":"stopword-set-1","highlight_full_fields":"isbn,title,author, embedding,publication","collection":"books_collection","facet_by":"agedGroup,author,binding,bookCondition,bookType,isOutOfStock,language,price,publication","page":1}]}
f
I'm talking about the Typesense url you're hitting. The full curl request
a
curl ^"https://ew5h2tr67livkp41p-1.a1.typesense.net/multi_search?x-typesense-api-key=ynYXfz3KuyLdSvLrMitLZWtsOImkATlb^" ^ -H ^"accept: application/json, text/plain, */*^" ^ -H ^"accept-language: en-IN,en-GB;q=0.9,en-US;q=0.8,en;q=0.7^" ^ -H ^"content-type: text/plain^" ^ -H ^"origin: http://103.217.221.238^" ^ -H ^"priority: u=1, i^" ^ -H ^"referer: http://103.217.221.238/^" ^ -H ^"sec-ch-ua: ^\^"Chromium^\^";v=^\^"146^\^", ^\^"Not-A.Brand^\^";v=^\^"24^\^", ^\^"Google Chrome^\^";v=^\^"146^\^"^" ^ -H ^"sec-ch-ua-mobile: ?0^" ^ -H ^"sec-ch-ua-platform: ^\^"Windows^\^"^" ^ -H ^"sec-fetch-dest: empty^" ^ -H ^"sec-fetch-mode: cors^" ^ -H ^"sec-fetch-site: cross-site^" ^ -H ^"user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36^" ^ --data-raw ^"^{^\^"searches^\^":^[^{^\^"q^\^":^\^"concept of physics^\^",^\^"query_by^\^":^\^"isbn,title,author, embedding,publication^\^",^\^"prioritize_token_position^\^":true,^\^"max_facet_values^\^":10,^\^"num_typos^\^":^\^"2^\^",^\^"min_len_1typo^\^":2,^\^"split_join_tokens^\^":^\^"always^\^",^\^"typo_tokens_threshold^\^":10,^\^"per_page^\^":12,^\^"sort_by^\^":^\^"num_is_out_of_stackasc, text matchdesc,ranking:desc^\^",^\^"pre_segmented_query^\^":true,^\^"drop_tokens_threshold^\^":0,^\^"facet_sample_threshold^\^":1000,^\^"facet_sample_percent^\^":20,^\^"exclude_fields^\^":^\^"embedding^\^",^\^"stopwords^\^":^\^"stopword-set-1^\^",^\^"highlight_full_fields^\^":^\^"isbn,title,author, embedding,publication^\^",^\^"collection^\^":^\^"books_collection^\^",^\^"facet_by^\^":^\^"agedGroup,author,binding,bookCondition,bookType,isOutOfStock,language,price,publication^\^",^\^"page^\^":1^}^]^}^"
@Fanis Tharropoulos is it ok
f
If you could copy the request as curl
a
curl --location 'https://ew5h2tr67livkp41p-1.a1.typesense.net/multi_search?x-typesense-api-key=ynYXfz3KuyLdSvLrMitLZWtsOImkATlb' \ --header 'Content-Type: application/json' \ --data '{ "searches": [ { "q": "concept of physics", "query_by": "isbn,title,author, embedding,publication", "prioritize_token_position": true, "max_facet_values": 10, "num_typos": "2", "min_len_1typo": 2, "split_join_tokens": "always", "typo_tokens_threshold": 10, "per_page": 12, "sort_by": "num_is_out_of_stackasc, text matchdesc,ranking:desc", "pre_segmented_query": true, "drop_tokens_threshold": 0, "facet_sample_threshold": 1000, "facet_sample_percent": 20, "exclude_fields": "embedding", "stopwords": "stopword-set-1", "highlight_full_fields": "isbn,title,author, embedding,publication", "collection": "books_collection", "facet_by": "agedGroup,author,binding,bookCondition,bookType,isOutOfStock,language,price,publication", "page": 1 } ] }'
@Fanis Tharropoulos this is what are you looking for?
f
Yes, thank you. I'll check them out and get back to you
a
ok
@Fanis Tharropoulos is any update?
f
It’s not necessarily a bug. The search is still choosing results mostly by how well they match concept of physics, and only then applying your
sort_by
, which currently starts with
num_is_out_of_stack:asc
, then
_text_match:desc
, then
ranking:desc
. That means the book with the higher ranking can still stay lower if its relevance match is weaker than the others. In this case, the "H. C. Verma" book matches "physics" well, but the other books match the full query more strongly, so they score higher overall. If you want that book to have a better chance of coming up first, use a sort order like this:
sort_by=ranking:desc,_text_match:desc,num_is_out_of_stack:asc