@Maroubra FTS returns document IDs for the search terms. So while searching across an array of JSON objects within a document it would look for the searched terms - in your case within fields: animals.type and animals.color.
The terms in these fields for the document are flattened out…
Unfortunately, as of today FTS will return results for your search terms that are present in the fields indexed and not necessarily within the same nested object within the array.
I believe we do have a ticket for this on our roadmap, although I can’t promise you at the moment on when we’ll make builds available with it.
Hi, just wanted to know whether this functionality is available.
Also, I could see another link with the same problem but it seems to have some solution suggested by Gabriel_P1.
Could you please have a look at it as well?
This functionality is not yet supported natively in FTS, primarily due to reprioritisation.
As there is already a way to achieve this over N1QL-FTS query as mentioned in the other post you were referring to.
ref - FTS inside array - #14 by keshav_m ( i suppose this)
So when you look up addresses.city:beach - the document would be a hit, but if you request the fields alongside the hit.ID from the index - you would see the above flattened structure.
Indexing array object positions is something we’re considering to improve on but haven’t just yet.