Hi
Thanks for your reply. I presume when you said
Quote:
I guess you could set the prefix for @IndexEmbedded to the empty string.
You mean do the following:
Code:
@IndexEmbedded(prefix="")
I will give this a try. I understand what you mean about not a recommended approach. I will probably look at this as an option. I noticed that our domain model has a deep object graph and the data i need creates fields like this
Code:
topObject.setOfObjects.object.reference
topObject.setOfAnotherObjects.object.object.reference
...and so on..depending on the data i need to index
So the query I need to generate looks like this
Code:
topObject.setOfObjects.object.reference:test topObject.setOfAnotherObjects.object.object.reference:test ...and so on
I tried to group fields together but the @IndexEmbedded worked to a certain point but when there was other objects I was getting different field names. For example
Code:
@Indexed
Class A
@IndexEmbedded(prefix="risk.")
Set<B> projects
Class B
@ContainedIn
A a
@Field(name="data" ...)
String reference
@IndexEmbedded(prefix="risk."
Set<C> c
C
@ContainedIn
B
@Field(name="data" ...)
String reference
[code]
So indexing the above looks like this:
[code]
risk.data
risk.risk.data
[/code]
where as I would like to do
[code]
risk.data
And get all contents (e.g. references from all of the object graph into one field.
I will try what you mentioned.
Cheers