Multiple search terms with radius

For our search engine I want to search in PDF documents for related search terms.

For example: oil mist

It is relevant that each reference contains oil and mist.

In addition, I would like to determine how many words are between the two search terms. However, I cannot find the right parameter for this.

My search query currently looks like this

{ 
    "query": {
        "match_phrase": { 
            "attachment.content": {
                "query": "oil mist"
            }
        } 
    },
    "_source": ["filename", "folder", "attachment.date", "attachment.author", "attachment.language", "attachment.title"],
    "highlight" : {
        "number_of_fragments": 150,
        "fields" : {
            "attachment.content" : { "type": "plain" }
        }
    }
}

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