v6: Filter containsAny(String) sends a scalar, which the server always rejects

Open Beginner friendly
#630 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
java

Research direction

Read src/main/java/io/weaviate/client6/v1/api/collections/query/Filter.java around the containsAny(String) overload and compare it with the List overload. Check the existing filter tests for how value_text_array is serialized, then confirm the single string is sent as a one-element array; the related overloads are noted as potentially affected. Done means the request matches the server’s array contract.

Written by the indexing model from the issue text.

Description

Summary

Filter.property(p).containsAny(String value), the single-value overload, sends a scalar value_text. The server rejects ContainsAny with a scalar on every property type and transport, so this overload can never succeed. It is also the one Java picks for containsAny("x"), so it's the easiest one to call.

https://github.com/weaviate/java-client/blob/ff57caed14df5778ef715132d618383da559c1cc/src/main/java/io/weaviate/client6/v1/api/collections/query/Filter.java#L458-L460

Reproduction (client 6.3.2, server 1.39.13)

Property tags is text[]:

collection.query.fetchObjects(q -> q.filters(Filter.property("tags").containsAny("tag1")));
// sent: value_text: "tag1"
// WeaviateApiException: ... extract contains values: value type should be []string but is string

collection.query.fetchObjects(q -> q.filters(Filter.property("tags").containsAny(List.of("tag1"))));
// sent: value_text_array { values: "tag1" }   → works

The server gives the same error for a scalar ContainsAny on a plain text property, and over GraphQL. So the server contract is "always an array", and the single-value overload doesn't follow it.

Expected

containsAny(String) sends a one-element value_text_array. Removing the overload would also work, since varargs covers it. The same probably applies to containsAll and containsNone, and to the single-value overloads of the other types, though I've only verified String.

Dominant language
Java
Stars
34
Forks
29
Avg merge
2d 10h
Merged PRs (30d)
2

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from weaviate/java-client

All issues in weaviate/java-client

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.