Query Multiple/All Arbitrary-Named Fields

Imagine this 'hypothetical' relational table:

doc         |     sentence            |    words
1                    1                      a,b,c
1                    2                     w,e,a,s
2                    1                    o,w,s,a,q,e,r
2                    2                     p,w,e,x,c,z
2                    3                    o,m,b,v,c,x

My aim is to be able to query perfect match some keywords to the words field and retrieve the doc number and sentence number. E.g. Retrieve entries which contain the word "o", and I would get doc 2, sentence 1 and doc 2 sentence 3. Now the reason for this being hypothetical is because of the variable number of words per sentence/document hence looking into 'schema-less' alternatives to achieve this.

From my limited ES knowledge, I thought the following structure might be good for organizing the data but not sure how query-friendly this is since when querying you would need to specify the field and in this case the Document and sentence names are variable (a doc can have 3 sentences, or 100 sentences etc) hence cannot use the querying a nested object(?). I came across the _all for query_string. Is this appropriate for the aim I'm after? Better alternatives maybe?

                       Words: [a,b,c]
                       Words: [w,e,a,s]
                       Words: [o,w,s,a,q,e,r]
                       Words: [p,w,e,x,c,z]
                       Words: [o,m,b,v,c,x]

There's several ways for dealing with these kinds of relationships in Elasticsearch. You might be better off going through


to figure out which is best for your problem/ query needs.

Hope this helps,