DX: BM25 should throw if `indexSearchable` disabled
Author: databyjpCreated Sep 24, 2024Updated Sep 29, 2026
LabelsDeveloper ExperienceDXgood-first-issueautoclosedfeature requestcommunity
Describe your feature request
Currently, performing a search with indexSearchable disabled causes Weaviate to return no results.
It would be clearer if it threw an error instead, as returning nil results could be misleading, especially if hybrid search is used.
MRE:
import weaviate
from weaviate.classes.config import Configure, Property, DataType, Reconfigure
from weaviate.classes.query import MetadataQuery, Filter
client = weaviate.connect_to_local()
coll_name = "TestCollection"
client.collections.delete(name=coll_name)
coll = client.collections.create(
name=coll_name,
properties=[
Property(
name="text",
data_type=DataType.TEXT,
index_searchable=False,
# index_filterable=False,
),
Property(name="title", data_type=DataType.TEXT),
],
)
props = [{"title": f"Title {i}", "text": f"Text {i}"} for i in range(10)]
coll.data.insert_many(props)
print(len(coll))
resp = coll.query.bm25(
query="text",
limit=5,
# filters=Filter.by_property("text").equal("1"),
return_metadata=MetadataQuery(score=True),
)
print(resp)
for o in resp.objects:
print(o)
print(o.metadata.score)
client.close()Code of Conduct
- I have read and agree to the Weaviate's Contributor Guide and Code of Conduct
Source: weaviate/weaviate