Common Indexing Mistakes

One million product-catalog objects, three deliberately wrong schema choices. Run each card to see the failure mode. Fix it from the Weaviate console, then re-run to see the difference.

connecting...

1. Range query without a rangeable index

price_cents has a filterable inverted bucket but no rangeable one. The range query works - but the engine has to walk the bucket value by value to satisfy BETWEEN 30000 AND 40000. On a 1M-object catalog that lands in the hundreds-of-ms range. Enable indexRangeFilters and the same query gets a sorted bitmap structure to consult, ending in single-digit ms.

price_cents int filterable=true rangeable=false

products.query.fetch_objects(
    filters=(
        Filter.by_property("price_cents").greater_or_equal(30000)
        & Filter.by_property("price_cents").less_or_equal(40000)
    ),
    limit=10,
    return_properties=["name", "brand", "category", "price_cents", "sku"],
)

Press Run query to execute.

2. "Any of" filter on a WORD-tokenized path

Filter spec_sheet_path against any of five known GoPro spec-sheet paths. With FIELD tokenization the engine compares each stored path as one opaque token and returns exactly the five matches. Under WORD tokenization each value splinters on / and - and ., so the filter degenerates into "does the path contain any of these tokens" — sweeping in accessory, comparison, and review URLs that merely share gopro or spec or products with the genuine paths.

spec_sheet_path text tokenization=word

products.query.fetch_objects(
    filters=Filter.by_property("spec_sheet_path").contains_any([
        "/products/cameras/gopro/hero-12-black/spec.pdf",
        "/products/cameras/gopro/hero-11-silver/spec.pdf",
        "/products/cameras/gopro/max-360/spec.pdf",
        "/products/cameras/gopro/hero-mini/spec.pdf",
        "/products/cameras/gopro/fusion-4k/spec.pdf",
    ]),
    limit=10,
    return_properties=["spec_sheet_path", "category", "brand", "name"],
)

Press Run query to execute.

3. Equality filter on a non-filterable property

Filter category == "Cameras > Action" against a property with no inverted filterable bucket. Weaviate refuses upfront with requires inverted index - the category facet on the storefront stops working entirely.

category text filterable=false tokenization=field

products.query.fetch_objects(
    filters=Filter.by_property("category").equal("Cameras > Action"),
    limit=10,
    return_properties=["name", "brand", "category", "sku", "price_cents"],
)

Press Run query to execute.