Hello, when I perform a query search in the Weaviate console as shown below, I receive the following data as a result. I want to create a GraphQL search using the ‘name’ and ‘quantity’ from the ‘ingredients’ key, and also use the ‘color’ value from the ‘properties’ key. How can I achieve this?
{
Get {
Adata (limit:2) {
code
description
name
ingredients {
code
name
quantity
unit
}
properties {
color
region
viscosity
}
}
}
}
Result:
{
"data": {
"Get": {
"Adata": [
{
"code": "prd002",
"description": "Savory Caesar Salad",
"ingredients": [
{
"code": "xxx",
"name": "Romaine lettuce",
"quantity": "100",
"unit": "gr"
},
{
"code": "xxx",
"name": "Grilled chicken",
"quantity": "100",
"unit": "gr"
},
{
"code": "xxx",
"name": "Parmesan cheese",
"quantity": "50",
"unit": "gr"
},
{
"code": "xxx",
"name": "Croutons",
"quantity": "30",
"unit": "gr"
},
{
"code": "xxx",
"name": "Caesar dressing",
"quantity": "20",
"unit": "gr"
}
],
"name": "Savory Caesar Salad",
"properties": [
{
"color": "#a02",
"region": "#c02",
"viscosity": "#b02"
}
]
},
{
"code": "prd001",
"description": "Sweet Strawberry Spinach Salad",
"ingredients": [
{
"code": "xxx",
"name": "Baby spinach",
"quantity": "100",
"unit": "gr"
},
{
"code": "xxx",
"name": "Strawberries",
"quantity": "100",
"unit": "gr"
},
{
"code": "xxx",
"name": "Goat cheese",
"quantity": "50",
"unit": "gr"
},
{
"code": "xxx",
"name": "Candied pecans",
"quantity": "30",
"unit": "gr"
},
{
"code": "xxx",
"name": "Balsamic glaze",
"quantity": "20",
"unit": "gr"
}
],
"name": "Sweet Strawberry Spinach Salad",
"properties": [
{
"color": "#a01",
"region": "#c01",
"viscosity": "#b01"
}
]
}
]
}
}
}
Server Setup Information
- Weaviate Server Version:
semitechnologies/weaviate:1.23.10
My Schema
{
"classes": [
{
"class": "Adata",
"description": "Information from data",
"vectorizer": "text2vec-openai",
"moduleConfig": {
"text2vec-openai": {
"model": "ada",
"type": "text"
}
},
"properties": [
{
"dataType": [
"text"
],
"description": "Product name",
"moduleConfig": {
"text2vec-openai": {
"skip": "false",
"vectorizePropertyName": "false"
}
},
"name": "name"
},
{
"dataType": ["object"],
"name": "ingredients",
"nestedProperties": [
{"dataType": ["text"], "name": "code"},
{"dataType": ["text"], "name": "name"},
{"dataType": ["number"], "name": "quantity"},
{"dataType": ["text"], "name": "unit"}
],
"description": "The ingredients",
"moduleConfig": {
"text2vec-openai": {
"skip": "false",
"vectorizePropertyName": "false"
}
}
},
{
"dataType": ["object"],
"name": "properties",
"nestedProperties": [
{"dataType": ["text"], "name": "color"},
{"dataType": ["text"], "name": "viscosity"},
{"dataType": ["text"], "name": "region"}
],
"description": "The properties",
"moduleConfig": {
"text2vec-openai": {
"skip": "false",
"vectorizePropertyName": "false"
}
}
},
{
"dataType": [
"text"
],
"description": "The code",
"moduleConfig": {
"text2vec-openai": {
"skip": "false",
"vectorizePropertyName": "false"
}
},
"name": "code"
}
]
}
]
}