2
votes

I have a elastic search query like the following,

{
  "query": {
    "bool": {
      "must": [
        {
          "query_string": {
            "fields": ["title"],
            "query": "test"
          }
        }
      ],
      "must_not": [],
      "should": []
    }
  },
  "from": 0,
  "size": 50,
  "sort": [],
  "facets": {}
}

I am able to execute an elastic search query on certain fields by giving a fields param to query_string as mentioned above. In my index mapping i have around 50 fields indexed. How do i query for all but one field. Something like an exclude option to query string. Is it possible with Tire/Elastic Search ?

1
Can i get a complete indexed column list from tire in an array ? - Baaju

1 Answers

1
votes

I assumed it cannot be done and proceeded with getting all the mappings and parsing the hash which kinda sucks actually.