Slackbot
10/09/2023, 9:16 AMAadarsh
10/09/2023, 9:27 AMdocument key along with text_match_info in the hit list result object index.Patrick Tamstrup
10/09/2023, 9:32 AMPatrick Tamstrup
10/09/2023, 9:33 AM{
"id": "abc123",
"persons": [{
"person_id": "xyz123",
"name": "John Smith",
"address": "123 Some Street",
"city": "Somerset",
"postcode": "1234"
}, ... ]
}Patrick Tamstrup
10/09/2023, 10:02 AM{
"name": "houses",
"num_documents": 0,
"enable_nested_fields": true,
"fields": [
{
"name": "id",
"type": "string"
},
{
"name": "persons",
"type": "object[]",
"schema": {
"fields": [
{
"name": "person_id",
"type": "string"
},
{
"name": "name",
"type": "string"
},
{
"name": "address",
"type": "string"
},
{
"name": "city",
"type": "string"
}
]
}
}
]
}
I then import the following document:
{
"id": "1",
"persons": [
{
"person_id": "p1",
"name": "John James Smith",
"address": "321 Example Street",
"city": "Oxford"
}
]
}Patrick Tamstrup
10/09/2023, 10:03 AM?q=james&query_by=persons.name I get the following result:Patrick Tamstrup
10/09/2023, 10:03 AM{
"facet_counts": [],
"found": 1,
"hits": [
{
"document": {
"id": "1",
"persons": [
{
"address": "321 Example Street",
"city": "Oxford",
"name": "John James Smith",
"person_id": "p1"
}
]
},
"highlight": {
"persons": [
{
"name": {
"matched_tokens": [
"James"
],
"snippet": "John <mark>James</mark> Smith"
}
}
]
},
"highlights": [],
"text_match": 578730123365187700,
"text_match_info": {
"best_field_score": "1108091338752",
"best_field_weight": 15,
"fields_matched": 1,
"score": "578730123365187705",
"tokens_matched": 1
}
}
],
"out_of": 1,
"page": 1,
"request_params": {
"collection_name": "houses",
"per_page": 10,
"q": "james"
},
"search_cutoff": false,
"search_time_ms": 1
}Patrick Tamstrup
10/09/2023, 10:03 AMJason Bosco
10/09/2023, 3:04 PMJason Bosco
10/09/2023, 3:05 PMpersons.name, persons.address and persons.city...Patrick Tamstrup
10/12/2023, 7:53 AMschema specification I did for a nested object is invalid? So the fields are essentially not indexed the way I did it?Jason Bosco
10/12/2023, 12:59 PM