code: public function build() {
          $built = array();
          if ($this->from != null)
              $built['from'] = $this->from;
          if ($this->size != null)
              $built['size'] = $this->size;
          if ($this->sort && is_array($this->sort))
              $built['sort'] = $this->sort;
          if (!$this->query)
              throw new \ElasticSearch\Exception("Query must be specified");
          else
              $built['query'] = $this->query->build();
          return $built;
      }
docs: Build the DSL as array
  
  @throws \ElasticSearch\Exception
  @return array