Hello everybody,
I have an index whose settings look something like this
"settings" : {
"index" : {
...
"analysis" : {
"filter" : {
"suggestion_shingle" : {
"max_shingle_size" : "5",
"min_shingle_size" : "2",
"output_unigrams" : "true",
"type" : "shingle"
},
...
},
"analyzer" : {
"suggestion" : {
"filter" : [
"lowercase",
"suggestion_shingle"
],
"tokenizer" : "standard"
},
...
},
...
}
}
}
In the same index mapping I have a text field which uses the "suggestion" analyzer. I would like to be able to list (at search time) the shingles who match a certain query string, in the same fashion as the Explain API works.
For example, if my document collection was:
- "very long text"
- "this is a very long text"
- "much longer text"
and I searched "very long", I would expect a document ranking in which every document has a list of matching shingles which, in this specific case, would be
- ["very long", "very long text"]
- ["very long", "very long text"]
- []
Is there any way to retrieve those lists?