Skip to content

BM25 full-text search is not working; it only supports exact queries? #40250

Discussion options

You must be logged in to vote

Set analyzer_params.type to "chinese". Read this doc for more info: https://milvus.io/docs/analyzer-overview.md

import random
import time

from pymilvus import (
MilvusClient,DataType,Function,FunctionType, CollectionSchema,FieldSchema
)

client = MilvusClient(uri="http://localhost:19530")

collection_name = "AAA"
client.drop_collection(collection_name=collection_name)

functions = [
    Function(
        name="bm25",
        function_type=FunctionType.BM25,
        input_field_names=["text"],
        output_field_names="sparse_vector",
    )
]

analyzer_params = {
    "type": "chinese",
}
fields = [
    FieldSchema(name="id", dtype=DataType.INT64, is_primary=True),
    FieldSchema(name="…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@262146150
Comment options

@yhmo
Comment options

yhmo Feb 28, 2025
Collaborator

Answer selected by 262146150
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants