Class FuzzyQuery

All Implemented Interfaces:
Query

public class FuzzyQuery extends AbstractWrapperQuery
A fuzzy query is meant to search for approximatively matching terms.
It works by wrapping another query. Only queries translating to Solr's BooleanQuery or TermQuery may be "fuzzied" this way. Furthermore, it obvisouly only makes sense for text queries, even it'd technically work for dates, numbers, ...
  • Constructor Details

    • FuzzyQuery

      public FuzzyQuery(Query query)
      Build a fuzzy query.
      Parameters:
      query - the wrapped Query.
  • Method Details

    • build

      Description copied from interface: Query
      Build the solr query string representing the Query object.
      Returns:
      the solr query string representing the Query object.
      Throws:
      QuerySyntaxException - if the query can't be built because of a syntax error.
    • buildAsJson

      Description copied from interface: Query
      Build the solr query representing the Query object.
      The return type may be either String or Map<String, Object> following the Solr JSON Query DSL.
      Returns:
      the solr query representing the Query object. Can be empty in case of empty query.
      Throws:
      QuerySyntaxException - if the query can't be built because of a syntax error.