Check if keyword is in text

So I have about 22,000 Boolean-like Keywords(e.g. ("stock market") ("trading"), ("ecology"|"pollution"), etc.) in an index and I want to query for those documents whose keyword can be found in a certain text.

   {
  "mapping": {
    "properties": {
                   "id": {
                          "type": "long"
                         },
                   "word": {
                          "type": "text",
                           "fields": {
                                      "keyword": {
                                                  "type": "keyword",
                                                   "ignore_above": 256
                                                 }
                                      }
      },
    }
  }
}

These are examples of what this index's records look like:

"id" : 41074
"word" : """("Technical-Vocational-Livelihood "|"TVL")  ("Track")""",


 "id" : 38684,
 "word" : """("Special Education Program")""",

Now, I want to filter only the documents whose "word" can be found in a specific text, E.G.

…Here, a student has the following options: prepare for college education, look for work, or start a business after graduation. K-12, which took effect in 2016, has four tracks: academic, technical-vocational-livelihood (TVL), arts and design and sports. “Before, when you drop out of high school, you are really a dropout; as you are expected to proceed to college or higher education…

Can you help me out with what I want to achieve? I was thinking of filtering the records by using the filter API and a script. Any help would be appreciated. Thanks!

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