code: void executeQueryAndGetResults(StringBuilder q, String _id, EntityMetadata m, List results,
              CouchDBQueryInterpreter interpreter) throws IOException, URISyntaxException, ClientProtocolException
      {
          HttpResponse response = null;
          try
          {
              response = getResponse(q, _id);
              JsonArray array = getJsonFromResponse(response);
              if (interpreter != null && interpreter.isAggregation())
              {
                  setAggregatedValuesInResult(results, interpreter, array);
              }
              else if (interpreter != null && interpreter.getColumns() != null && interpreter.getColumns().length != 0)
              {
                  setSpecificFieldsInResult(interpreter.getColumnsToOutput(), m, results, array);
              }
              else
              {
                  setEntitiesInResult(m, results, array);
              }
          }
          finally
          {
              CouchDBUtils.closeContent(response);
          }
      }
docs: Execute query and get results.
  
  @param q
  the q
  @param _id
  the _id
  @param m
  the m
  @param results
  the results
  @param interpreter
  the interpreter
  @throws IOException
  Signals that an I/O exception has occurred.
  @throws URISyntaxException
  the URI syntax exception
  @throws ClientProtocolException
  the client protocol exception