title: How to form the Json value for the given elastic search search query in node js
body: <p>Hi I'm new in node js I was created the search query in elastic search as follows:</p>
  
  <pre><code>   {
    "query": {
      "bool": {
        "must": [
          {
            "query_string": {
              "query": "healthy"
            }
          },
          {
            "term": {
              "status": 1
            }
          }
        ],
        "should": [
          {
            "term": {
              "associatedUserIds": 248
            }
          },
          {
            "term": {
              "createrFriendsId": 248
            }
          },
          {
            "term": {
              "communityMembers": 248
            }
          }
        ]
      }
    }
  }
  </code></pre>
  
  <p>and the filter fields are changed dynamically by based on user request.I had a difficult to form the JSON variable for above query .Is anyone guide me to achive this?.Thanks in advance. </p>