{
  "from": "@offset@",
  "size": "@limit@",
  "query":{
    "bool":{
      "filter":{
        "terms":{
          "permissions": [@permissions@]
        }
      },
      "should": {
        "match_phrase": {
          "summary": {
            "query": "@term@",
            "boost": 3
          }
        }
      },
      "must":{
        "query_string":{
          "fields": ["summary", "description","location"],
          "query": "@term_query@"
        }
      },
      "must_not": {
        "exists": {
          "field": "parentId"
        }
      }
    }
  },
  "highlight" : {
    "number_of_fragments" : 2,
    "fragment_size" : 150,
    "no_match_size" : 0,
    "order": "score",
    "fields" : {
      "description" : {
        "pre_tags" : ["<span class='searchMatchExcerpt'>"],
        "post_tags" : ["</span>"]
      },
      "summary" : {
        "pre_tags" : ["<span class='searchMatchExcerpt'>"],
        "post_tags" : ["</span>"]
      },
      "location" : {
        "pre_tags" : ["<span class='searchMatchExcerpt'>"],
        "post_tags" : ["</span>"]
      }
    }
  }
}