How to configure weaviate env

version: ‘3.7’
services:
weaviate:
image: harbor.xxx.com/common/weaviate:1.27.0
ports:
- “8081:8080”
environment:
- QUERY_DEFAULTS_LIMIT=20
- AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED=true
- PERSISTENCE_DATA_PATH=/var/lib/weaviate
- TRANSFORMERS_INFERENCE_API=http://xx.55.145.120:21992/encode
- ENABLE_MODULES=text2vec-transformers
volumes:
- ./data:/var/lib/weaviate

The TRANSFORMERS_INFERENCE_API interface is OK, but when I was about to use the following curl interface to test whether weaviate is good, a problem occurred
curl -X POST “xxxx.xx:8081/v1/graphql” -H “Content-Type: application/json” -d ‘{
“query”: “{ Get { Article (nearText: {concepts: ["Hello, World!"]}) { text } } }”
}’
{“errors”:[{“locations”:[{“column”:18,“line”:1}],“message”:“Unknown argument "nearText" on field "Article" of type "GetObjectsObj". Did you mean "nearVector" or "nearObject"?”,“path”:null}]}

hi @ywen !!

Welcome to our community! :hugs:

This error message will surface when you create a collection without a vectorizer.

In that case, Weaviate is not able to vectorize your query. So it doesn’t even expose the nearText option.

Here is an example on how to create a collection with a vectorizer:

from weaviate import classes as wvc

collection = client.collections.create(
    "Article",
    vectorizer_config=wvc.config.Configure.Vectorizer.text2vec_openai(),
    generative_config=wvc.config.Configure.Generative.openai(),
)
collection.data.insert({"text": "This is a test"})

Let me know if this helps!