code: @GET
      @Path("search")
      @Consumes(Servlets.JSON_MEDIA_TYPE)
      @Produces(Servlets.JSON_MEDIA_TYPE)
      public Response search(@QueryParam("query") String query,
                             @DefaultValue(LIMIT_OFFSET_DEFAULT) @QueryParam("limit") int limit,
                             @DefaultValue(LIMIT_OFFSET_DEFAULT) @QueryParam("offset") int offset) {
          boolean dslQueryFailed = false;
          Response response = null;
          try {
              response = searchUsingQueryDSL(query, limit, offset);
              if (response.getStatus() != Response.Status.OK.getStatusCode()) {
                  dslQueryFailed = true;
              }
          } catch (Exception e) {
              if (LOG.isDebugEnabled()) {
                  LOG.debug("Error while running DSL. Switching to fulltext for query {}", query, e);
              }
  
              dslQueryFailed = true;
          }
  
          if ( dslQueryFailed ) {
              response = searchUsingFullText(query, limit, offset);
          }
  
          return response;
      }
docs: Search using a given query.
  
  @param query search query in DSL format falling back to full text.
  @param limit number of rows to be returned in the result, used for pagination. maxlimit > limit > 0. -1 maps to atlas.search.defaultlimit property value
  @param offset offset to the results returned, used for pagination. offset >= 0. -1 maps to offset 0
  @return JSON representing the type and results.