"Hierarchical" search of a value

Hello everyone !

Here is a sample of my data :

                  "TARGET":"This is the value I search XYZ123 bla bla",

I need to search elasticsearch datas from java. I am using Querybuilders library.
I need to search every data that has "XYZ123" in "TARGET" field.

I could use : QueryBuilders.wildcardQuery("content.typeA.typeB.TARGET","XYZ123");

But the problem is : my data doesn't always follow this hierarchy. I don't know how many types there will be between "content." and ".TARGET". Sometimes there is none, sometimes more ...

So here is my question : is there a way to just search every data samples that has a field "TARGET" with the value "XYZ123" in the content block ?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.