Elasticsearch return match fields

I am trying

GET _search
  "query": {
    "match": {

I need to find which field the match happened, if that can be found. I am open to use another query, the idea is to search a value in all index and all docs and come up with with relevant doc and field where match happened.


Have a look at named_queries and highlighting. Neither of them work super well with the _all field but those are how you figure out which field matched.

My document looks like this

        "_index": "edm_demo",
        "_type": "financial_products",
        "_id": "AVbujNiLuNZXbYrTuzVl",
        "_score": 1.8980293,
        "_source": {
          "PROD_ID": 300440,
          "CUSIP": "982967-58-7",
          "SYMBOL": "MCRFX",
          "NAME": "All-Cap Energy & Resources Fund",
          "INDUSTRY": "Legal Services",
          "SHARES": 1948.45,
          "DIVYIELD": 0.56032,
          "HIGH": 4428.29,
          "LOW": 3985.46,
          "VOLUME": 3764.05,
          "CHANGE": 0.623993

I tried many highlight queries even without all some like

GET edm_demo/financial_products/_search
  "query": {
    "query_string": {
  "highlight": {
    "title": {
    }  }

But I got no success, in Kibana -sense I can't see a thing. Is it some issue of kibana or there is no highlight resulted expected out of it.
I can't figured out how to use named query in my conditions as I don't even have field names with me.

I am trying to dump a database in elasticsearch, when user search a value I want to show which table and which column had that value. The alternate solution I got is to dump in column based index only, but then each document has just one value. Is it a good strategy?. Any suggestions are really appreciated.

Next time can you wrap code blocks in ```? It makes them easier to read. I've used my admin powers to edit your post above.

As to your highlighting problems, have a look at required_field_match.