/** {@inheritDoc} */
 @Override
 public void validate(IndexExpression indexExpression) throws InvalidRequestException {
   try {
     String json = UTF8Type.instance.compose(indexExpression.value);
     Search.fromJson(json).validate(schema);
   } catch (Exception e) {
     throw new InvalidRequestException(e.getMessage());
   }
 }
 /** {@inheritDoc} */
 @Override
 public boolean requiresScanningAllRanges(List<IndexExpression> clause) {
   Search search = search(clause);
   return search.usesRelevanceOrSorting();
 }
 /**
  * Returns the {@link Search} contained in the specified list of {@link IndexExpression}s.
  *
  * @param clause A list of {@link IndexExpression}s.
  * @return The {@link Search} contained in the specified list of {@link IndexExpression}s.
  */
 private Search search(List<IndexExpression> clause) {
   IndexExpression indexedExpression = indexedExpression(clause);
   String json = UTF8Type.instance.compose(indexedExpression.value);
   return Search.fromJson(json);
 }