Hi all, Typesense supports querying for similar do...
# community-help
n
Hi all, Typesense supports querying for similar documents, which is great. In my case I have string fields "content" and "tags".
content
is a screen-long text about everything and anything.
tags
is about 3 to 20 words, something like "Mozart, Bach" or "Deep Purple, Rainbow". Only music genres extracted from content. Imagine, I have
embedding_content
,
embedding_tags
for both fields - I can have more than one embedding per document, right? Now, for a document
X
I want to find documents with similar music genres (NOT documents having similar fluff in content) can I do something like this?
Copy code
curl '<http://localhost:8108/multi_search>' \
  -X POST \
  -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
  -d '{
        "searches": [
          {
            "collection": "docs",
            "q": "*",
            "vector_query": "embedding_tags:([], id: X)"
          }
        ]
      }'
f
https://typesense.org/docs/29.0/api/vector-search.html#querying-for-similar-documents Yes, it is possible to do what you're describing. It will query for the similar documents to the one that matches that id
n
👍 (documentaion speaks about one embedding field per document all the time... therefore stupid questions )))