This message was deleted.
# community-help
s
This message was deleted.
j
Here's the schema I am using for this:
Copy code
{
  "name": "things",
  "enable_nested_fields": true,
  "fields": [
    {
      "name": "tags.value",
      "type": "string[]",
      "optional": true
    }
  ]
}
j
We didn't include unmatched fields/values in arrays of objects to avoid redundant data and increase response sizes. So the access pattern typically is, you'd first check
highlight.field
for a display value and fall back to
document.field
if it's not present
j
I must have been seeing things then 😄 cheers. I'll get the associated
key
field (non-indexed) from the document then (using the positional index of the tag in the highlight data).
👍 1
j
(Side note: we had to include all objects, even if they don't have a match, inside an array of objects though, to preserve the array index)
j
But just the indexed fields, right?
j
Correct
👍 1
j
Perfect, thanks for the help 😄
j
Oh wait, it's technically the fields in
query_by
which could be a subset of the indexed fields
j
Oh 🤔 changing
tags.value
in my
query_by
to just
tags
makes it return the key! Is this expected (even though
key
isn't indexed) or should I not depend on this behaviour?
j
That is indeed expected behavior. Basically highlights will return fields in query_by
Although, need to check if we have a test case for this!
j
Ah fantastic - I'm glad I'm not going crazy 😁 I must have changed
tags
to
tags.value
at some point in my
query_by
. The only indexed field in
tags
is
value
anyway, so I will switch it back to
tags
. Appreciated!
👍 1