Help with isIndexSearchable

Description

I am struggling with my implementation, and I haven’t been able to figure out why this has been happening in the documentation. I am using a hybrid query, and attempting to encode a legal document. However, no matter what I try, I keep getting the same error. It seems like I’m configuring something wrong, but I don’t feel like this error message or the docs are useful.

weaviate.exceptions.WeaviateQueryError: Query call with protocol GRPC search failed with message <AioRpcError of RPC that terminated with:
status = StatusCode.UNKNOWN
details = “object search at index schema_section: local shard object search schema_section_tAdIk3D5F6jA: Searching by property ‘article_number’ requires inverted index. Is indexSearchable option of property ‘article_number’ enabled? Set it to true or leave empty”

            properties=[
                Property(name="content", data_type=DataType.TEXT, indexSearchable=True),
                Property(name="title", data_type=DataType.TEXT, indexSearchable=True),
                Property(name="article_number", data_type=DataType.INT),
                Property(name="section_number", data_type=DataType.INT, nullable=True),
                Property(name="category", data_type=DataType.TEXT),
                Property(name="effective_date", data_type=DataType.DATE),
                Property(name="document_source", data_type=DataType.TEXT),
            ]

Server Setup Information

  • Weaviate Server Version:
  • Deployment Method:
  • Multi Node? Number of Running Nodes:
  • Client Language and Version:
  • Multitenancy?:

Any additional Information

hi @Bennett_Summy !!

Welcome to our community :hugs: !!

IndexSearchable will only be applicable to text and text, as per this doc. So you cannot search an integer field.

indexFilterable on the other hand will allow you to filter by that property.

It means you can do this:

collection.query.bm25(query="greeting", filters=wvc.query.Filter.by_property("article_number").equal(1))

However, you cannot do this:

collection.query.bm25(query="Hello", query_properties=["article_id"])

Now, if you want to check the resulting properties, you can check with:

collection.config.get().to_dict().get("properties")

for instance:

[{'name': 'content',
  'dataType': ['text'],
  'indexFilterable': True,
  'indexSearchable': True,
  'indexRangeFilters': False,
  'tokenization': 'word',
  'moduleConfig': {'none': {}}},
 {'name': 'title',
  'dataType': ['text'],
  'indexFilterable': True,
  'indexSearchable': True,
  'indexRangeFilters': False,
  'tokenization': 'word',
  'moduleConfig': {'none': {}}},
 {'name': 'article_number',
  'dataType': ['int'],
  'indexFilterable': True,
  'indexSearchable': False,
  'indexRangeFilters': False,
  'tokenization': None,
  'moduleConfig': {'none': {}}},
 {'name': 'section_number',
  'dataType': ['int'],
  'indexFilterable': True,
  'indexSearchable': False,
  'indexRangeFilters': False,
  'tokenization': None,
  'moduleConfig': {'none': {}}},
 {'name': 'category',
  'dataType': ['text'],
  'indexFilterable': True,
  'indexSearchable': True,
  'indexRangeFilters': False,
  'tokenization': 'word',
  'moduleConfig': {'none': {}}},
 {'name': 'effective_date',
  'dataType': ['date'],
  'indexFilterable': True,
  'indexSearchable': False,
  'indexRangeFilters': False,
  'tokenization': None,
  'moduleConfig': {'none': {}}},
 {'name': 'document_source',
  'dataType': ['text'],
  'indexFilterable': True,
  'indexSearchable': True,
  'indexRangeFilters': False,
  'tokenization': 'word',
  'moduleConfig': {'none': {}}}]

Let me know if this helps!

Thanks!