-
-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vector Search Support #152
Comments
Given that Algolia doesn't support vector search, Instantsearch does not expose any mechanism that triggers vector searches, so the adapter doesn't have anything to hook into. So you would have to use the typesense-js client directly to do vector searches... For eg, have a look at the "Find Similar" link under each product in this demo. Here's how I trigger the vector search, outside the instantsearch lifecycle. |
Thanks for the quick answer! So if I wanted to use vector search and filter in parallel with filter widgets and sort by widget, I wont be able to use instantsearch, right? |
I haven't explored Instantsearch's custom widgets enough to be able to answer this question confidently unfortunately. If you're able to build a custom widget that somehow calls the typesense-js library directly and then updates the internal instantsearch state based on the response you get... may be? I'm not sure if this is possible or how complex it is to pull off. |
Okay, thanks for your time. I was hoping I could simply add vector search to the |
Adding |
No, I want to have a static vector query for each page load. We basically use a data object that implies a certain search (filter and vector) and then filterRefinement widgets. But the vector search only changes with another (different) page load (different data object loaded). Would that be possible? I guess even if it was possible it would be a misleading addition to your repo, right? |
If that solves for your use-case, happy to add I'll push out a new |
Could you update to |
I would add to the schema of the document: And by what you could search for a document similar to this. *1 - id or the whole document, or a variable with a vector (neither) |
@jasonbosco I do see the vector_query param. It might take a while until I can fully test it, but I will make sure to let you know, if it works how I hoped it would :) |
Before I finished implementing it, I realized the available vector similariy function is not what I was looking for. I have a model A which contains a set of attributes and a model B which also contains the same type of attributes. I want to match them in a way that I look for A's that have the same values as B where B has values and I want to discard any differences that come from values that A has but B doesn't. From a vector perspective: A1: [1 ,0 ,1] should match equally to B: [1,0,1] With the distance being 0 here. The function would be:
Using cosine similarity would result in vector A1 matching better. For more complex vectors that can even mean that a vector gets preferred even if it matches worse. However this is probably not a discussion for this repo. From my perspective you can close that issue as the parameter vector_query is known now :) Thanks for implementing the parameter, I really appreciate the work and typesense as an easy to setup search engine! |
If anyone's looking to implement semantic search with Typesense's vector search feature + Instantsearch.js UI, here's how: https://github.com/typesense/typesense-instantsearch-adapter#vector-search |
@jasonbosco hi, are there any ways to implement the same vector search with embedding from query string in React instant search? |
Is there a way to make vector search work with this repository and react instantsearch? I've looked into custom widgest by algolia and the federated search demo repo as it is at least using the multi search endpoint. I just couldn't find a way to make vector search work and after looking in the code, it seems it is not a permitted param for
collectionSpecificSearchParameters
.Can you give me a hint on which level I would need to implement it or if this repo is the right place for it?
The text was updated successfully, but these errors were encountered: