Ejemplo n.º 1
0
 /**
  * Performs a fast check of the search parameters. This method does not check if the query stored
  * in the parameters parses.
  *
  * @param params the search parameters to check
  * @return this checked SearchParams
  * @throws IllegalArgumentException if parameters are not valid
  */
 public static SearchParams checkValidFast(SearchParams params) {
   IndexChecker.checkName(params.getIndexSpec().getName());
   checkQueryFast(params.getQuery());
   QueryOptionsChecker.checkValid(params);
   return params;
 }
Ejemplo n.º 2
0
 /**
  * Checks the search specification is valid, specifically, has a valid index specification, a
  * non-null query, a non-null number of documents to return specification, a valid cursor if
  * present, valid sort specification list, a valid collection of field names for sorting, and a
  * valid scorer specification.
  *
  * @param params the SearchParams to check
  * @return this checked SearchParams
  * @throws IllegalArgumentException if some part of the specification is invalid
  * @throws SearchQueryException if the query is unparsable
  */
 public static SearchParams checkValid(SearchParams params) {
   checkValidFast(params);
   checkQueryParses(params.getQuery());
   return params;
 }