IndexEmbedded objects into parent document

There is no built-in way to do that, no. @IndexedEmbedded fields are necessarily placed in an “parent” object field corresponding to the @IndexedEmbedded.

One way to create an “all” field would be to not use mapping annotations, but instead write a custom bridge for each entity, and manually do the job of extracting information from entities and pushing it to your single field. That’s a lot of work and most people won’t want to do that.

Alternatively, if you’re using the Elasticsearch backend, you could define your own value binder that assigns a native Elasticsearch mapping to your field. That native mapping could rely on Elasticsearch’s “copy_to” feature, and then you could search on that “copy” field.

But really, I’d challenge the need for such an “all” field to begin with. When searching, you can simply target multiple fields in the same predicate. So it would be enough for you to keep a list of all fields in a given entity, and pass that list to .fields(...) when searching. Theoretically you could even build such a list of fields after bootstrap by inspecting the metamodel.

Eventualy we’ll add a way to assign “groups” to fields, so that you can just reference the “all” group when searching and Hibernate Search will automatically target the corresponding fields, and maybe one day a way to materialize groups of fields with a feature similar to Elasticsearch’s “copy_to”. But we’re not there yet.