You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# The 'language' field is not strictly needed by the analyzer itself here, as detection is automatic.# However, you might keep it for metadata purposes.
# 5B. Perform a full-text search with Language Identifier Tokenizer# No need to specify analyzer_name in search_params; it's detected automatically for the query.
89
+
print("\n--- Search results for Language Identifier Tokenizer ---")
90
+
results_langid_jp=client.search(
91
+
collection_name=COLLECTION_NAME,
92
+
data=["神隠し"],
93
+
limit=2,
94
+
output_fields=["text"],
95
+
search_params={"metric_type": "BM25"}, # Analyzer automatically determined by language_identifier
96
+
consistency_level="Strong",
97
+
)
98
+
print("\nSearch results for '神隠し' (Language Identifier Tokenizer):")
99
+
forresultinresults_langid_jp[0]:
100
+
print(result)
101
+
102
+
results_langid_en=client.search(
103
+
collection_name=COLLECTION_NAME,
104
+
data=["the Rings"],
105
+
limit=2,
106
+
output_fields=["text"],
107
+
search_params={"metric_type": "BM25"}, # Analyzer automatically determined by language_identifier
108
+
consistency_level="Strong",
109
+
)
110
+
print("\nSearch results for 'the Rings' (Language Identifier Tokenizer):")
0 commit comments