I need to search within a an array nested in another array. Let's say I have the following document
schema foos {
document foos {
struct foo {
field bars type array<string> {}
}
field baz type string {
indexing: summary
}
field foos type array<foo> {
indexing: summary
struct-field bars { indexing: attribute } // breaks due to non-primitive typing
}
}
}
I need to be able to search within the bars field or at least access that field within a rank-profile whilst also being able to search based on baz. My first thought at a solution would be to structure it as follows:
schema foos {
document foos {
field id type string {
indexing: summary
}
field baz type string {
indexing: summary | attribute
}
field foos type array<reference<foo>> {
indexing: summary
}
}
}
schema foo {
document foo {
field foos_ref type reference<foos> {
indexing: attribute
}
field bars type array<string> {
indexing: summary | index
}
}
import field foos_ref.baz as baz {}
}
This would allow me to search within the foo cluster then get the corresponding foos reference, but the overall goal is to provide the user a list of foos documents which would require multiple searches from the list of returned foo documents resulting in slow searches overall.
If there is a recommended way to handle situations like these, any help would be appreciated. Thank you.