Boosting Document Rankings Using Search History

TLDR Jason inquired about boosting document rankings based on user search history. Jason explained it's achievable using the vector search feature of Typesense and suggested using a machine learning model before providing an API to demonstrate it.

Powered by Struct AI
Join the chat
Nov 29, 2022 (10 months ago)
Photo of md5-c7ebbbcac16a1763e16d0e8e8177b0ae
07:00 PM
Is it possible to boost (not filter) document rankings by the presence of certain document values? example: a user searches for restaurants in NYC. We know from their search history that they engage most with Indian and Korean food, the service should apply a ranking boost to any document which contains the words "matar paneer", "japchei, "lasooni gobi" etc... The absence of these terms from a document should not exclude it from results, only "boosting" those documents which contain those terms....

Is this achievable?
Photo of md5-8813087cccc512313602b6d9f9ece19f
07:11 PM
This is possible using the vector search feature in the latest RC build of Typesense. But to generate these vectors, you would have to build an ML model that takes into account each user’s past searches, clicks, etc and generates these vectors for you, store the vectors in Typesense and then you can then do a “nearest neighbor search”
07:12 PM
Here’s an example of how you can use word2vec to generate vectors in a similar scenario: https://towardsdatascience.com/session-based-recommender-systems-with-word2vec-666afb775509
Dec 29, 2022 (9 months ago)
Photo of md5-972da58c82de3b38862220702e852eda
02:31 PM
What would the search query look like that achieves this? Assuming vectors are in place.