1

Giving Weaviate a go using python client with the example for wine reviews, not sure if this is a function error:

Query:

query_result = ( client.query
    .get("Wine",["title","description"])
    .with_limit(5)
    .with_near_text({"concepts" : ["white"]})
    .do())

Response:

{'errors': [{'locations': [{'column': 20, 'line': 1}], 'message': 'Unknown argument "nearText" on field "Wine" of type "GetObjectsObj". Did you mean "nearVector" or "nearObject"?', 'path': None}]}

An empty query do return results as expected.

Schema:

{
    "classes": [
        {
            "class": "Wine",
            "invertedIndexConfig": {
                "bm25": {
                    "b": 0.75,
                    "k1": 1.2
                },
                "cleanupIntervalSeconds": 60,
                "stopwords": {
                    "additions": null,
                    "preset": "en",
                    "removals": null
                }
            },
            "properties": [
                {
                    "dataType": [
                        "text"
                    ],
                    "name": "title",
                    "tokenization": "word"
                },
                {
                    "dataType": [
                        "text"
                    ],
                    "name": "description",
                    "tokenization": "word"
                }
            ],
            "replicationConfig": {
                "factor": 1
            },
            "shardingConfig": {
                "virtualPerPhysical": 128,
                "desiredCount": 1,
                "actualCount": 1,
                "desiredVirtualCount": 128,
                "actualVirtualCount": 128,
                "key": "_id",
                "strategy": "hash",
                "function": "murmur3"
            },
            "vectorIndexConfig": {
                "skip": false,
                "cleanupIntervalSeconds": 300,
                "maxConnections": 64,
                "efConstruction": 128,
                "ef": -1,
                "dynamicEfMin": 100,
                "dynamicEfMax": 500,
                "dynamicEfFactor": 8,
                "vectorCacheMaxObjects": 1000000000000,
                "flatSearchCutoff": 40000,
                "distance": "cosine"
            },
            "vectorIndexType": "hnsw",
            "vectorizer": "none"
        }
    ]
}

Weaviate should return the results "wine reviews" related to "white"

Bob van Luijt
  • 7,153
  • 12
  • 58
  • 101
Dan Porter
  • 21
  • 3

2 Answers2

1

I realised there was no vectorization by default, I solved the error by adding the model. The results are inaccurate though, don't yield the right results even if including exact keywords.

class_obj = {
    "class": "Wine",
    "vectorizer": "text2vec-transformers",
    "properties": [
        {
            "name": "title",
            "dataType": ["text"]
        },
        {
            "name": "description",
            "dataType": ["text"]
        }
    ],
    "moduleConfig": {
        "text2vec-transformers": {
            "vectorizeClassName": True
        }
    }
}
Dan Porter
  • 21
  • 3
0

We first have to understand, what nearText does actually. It queries(searches for) the nearest entries in the database, to the text(s) you provided with nearText.vectorize your entries.

In your provided schema, you used

{
    "classes": [
        {
            "class": "Wine",
            "vectorizer": "none"
        }
    ]
}

Explicitly mentioning No Vectorizer. Thus, not finding any vectorizer and throwing an error.

You needed to add some vectorizer like text2vec-openai as well as make the vectorizeClassName to True.

class_obj = {
    "class": "Wine",
    "vectorizer": "text2vec-openai",
    "moduleConfig": {
        "text2vec-openai": {
            "vectorizeClassName": True
        }
    }  # Or "text2vec-cohere" or "text2vec-huggingface"
}

This works for me. Hope works for you to!

Sawradip Saha
  • 1,151
  • 11
  • 14