Slackbot
09/21/2023, 1:45 PMJack Wilsdon
09/21/2023, 1:57 PMkey and value field instead, meaning we don't end up with a bunch of extra fields. i.e. from:
{
"key1": "value1",
"key2": "value2"
}
To:
[
{ "key": "key1", "value": "value1" },
{ "key": "key2", "value": "value2" }
]Jason Bosco
09/21/2023, 5:08 PM{
"field": {
"nestedA": "valueA",
"nestedB": "valueB"
}
}
And say the user searches for valueA, then the highlight object, will just replace the leaf matched field from a string value to the highlight object like this:
{
"field": {
"nestedA": {
"matched_tokens": [
"valueA"
],
"snippet": "<mark>valueA</mark>",
"value": "valueA"
},
"nestedB": "valueB"
}
}
While preserving the rest of the object's structure as isJason Bosco
09/21/2023, 5:09 PMvalueA in the original document became the following object in the highlight:
{
"matched_tokens": [
"valueA"
],
"snippet": "<mark>valueA</mark>",
"value": "valueA"
}Jason Bosco
09/21/2023, 5:11 PMNarayan Acharya
09/22/2023, 2:36 AMJack Wilsdon
09/22/2023, 9:59 AMJack Wilsdon
09/22/2023, 9:59 AMKishore Nallan
09/22/2023, 2:51 PMKishore Nallan
09/22/2023, 2:52 PMJack Wilsdon
09/22/2023, 2:53 PM