Love seeing the Typesense bus stop ads 🙂 . Wondering if people have simple tips/tricks for queries with multiple words. I'm guessing I'm doing some basic things wrong or need to build a lot more complex stuff to make my search better, but have tried a lot of basic things and none have worked well. For example, if I search "size 12 men's shoes", I get results like "Cynthia Rowley 100% Silk Dress Ruffled Layers Size 4 Size S" (since it has "size"). I can wrap my query in double quotes and this helps, but overfits and then searching "Size 12 shoes" does not show up. Here is my code for reference, but I've tweaked all these parameters and not gotten much better:
var searchResult =
await typesenseClient.collection('listings').documents.search({
// 'q':'"${input}"',
'q': '${input}',
'query_by':
'selectedItem.item,selectedItem.keywords,listingDescription,category',
'query_by_weights': '12,6,6,1',
// Use filter_by to incorporate your conditions directly:
'filter_by':
'orderTime:>${oneWeekAgoInMillisFS}&&recipientClaimedTime=0&&deleted=false&&showItemOnMarketplace:=true',
'sort_by': '_text_match:desc',
'num_typos': '1',
'typo_tokens_threshold': '1',
// 'drop_tokens_threshold': '0',
// 'drop_tokens_mode': 'right_to_left',
'exhaustive_search': 'true',
// Adding pagination parameters:
'page': '1',
'per_page': '250',
//
'prefix': 'false',
'split_join_tokens': 'true',
// // 'min_len_1typo': '5',
// // 'min_len_2typos': '8',
// 'min_len_1typo': '6',
// 'min_len_2typos': '8',
'min_len_1typo': '6',
'min_len_2typos': '8',
'exact_on_single_word_query': 'true',
});