0

I am trying to combine a full text search and a vector search together in OpenSearch. When I run this:

{
    "multi_match": {
        "query": "generic search term"
    }
}

I get 15 results. When I run this:

{
   "knn": {
       "embedding_vector": {
           "vector": [0.162953,...]
           "k": 3
        }
    }
}

I get 5 results. But when I run this:

    "bool" : {
        "should" : [
            {
                "multi_match": {
                    "query": "generic search term"
                }
            },
            {
                "knn": {
                    "embedding_vector": {
                        "vector": [0.162953,...],
                        "k": 3
                }
            }
        ],
        "minimum_should_match": 1

gives me only the vector search results. What am I doing wrong?

4
  • Did you tried with hybrid search? opensearch.org/docs/latest/vector-search/ai-search/… Commented Apr 10 at 12:21
  • I'm not doing semantic search, I'm doing full text search. Commented Apr 10 at 13:13
  • kNN (k-nearest neighbour) is used for vector search and not lexical (full text) search. Commented Apr 10 at 14:16
  • right im both doing a vector search and a full text search. Commented Apr 10 at 14:41

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.