We use Hybrid search a lot. Great feature!
Can we use multiple keywords when using BM25?
The example provided is only one keyword.
You can put multiple words into the query
. As per GraphQL - Vector search parameters | Weaviate - vector database , stop words are removed but the rest are all evaluated. If you add _additional {explainScore}
to your query you will see how your different keywords factored into the score.
Simple example:
{
Get {
MyClass(
limit: 30
bm25: {
query: "italy life insurance"
}
) {
text
_additional
{
score
explainScore
}
}
}
}
Response:
{
"data": {
"Get": {
"MyClass": [
{
"_additional": {
"explainScore": ", BM25F_insurance_frequency:11, BM25F_insurance_propLength:161, BM25F_italy_frequency:7, BM25F_italy_propLength:161, BM25F_life_frequency:1, BM25F_life_propLength:161",
"score": "4.4186454"
}
}
]
}
}
}
Note how all the keywords factored into the score.