Interface QueryParserAdaptor<Q,S,E extends Throwable>

Type Parameters:
Q - the query type used by the query engine implementation
S - the sort type used by the query engine implementation
E - the exception it throws

public interface QueryParserAdaptor<Q,S,E extends Throwable>
Adaptor class to wrap search parser implementations and encapsulate changes between search versions of query building.
Author:
Andy
  • Method Details

    • getFieldQuery

      Q getFieldQuery(String field, String queryText, AnalysisMode analysisMode, LuceneFunction luceneFunction) throws E
      Parameters:
      field - String
      queryText - String
      analysisMode - AnalysisMode
      luceneFunction - LuceneFunction
      Returns:
      Q
      Throws:
      E extends Throwable
    • getRangeQuery

      Q getRangeQuery(String field, String lower, String upper, boolean includeLower, boolean includeUpper, AnalysisMode analysisMode, LuceneFunction luceneFunction) throws E
      Parameters:
      field - String
      lower - String
      upper - String
      includeLower - boolean
      includeUpper - boolean
      analysisMode - AnalysisMode
      luceneFunction - LuceneFunction
      Returns:
      Q
      Throws:
      E extends Throwable
    • getMatchAllQuery

      Q getMatchAllQuery() throws E
      A query that matches all docs
      Returns:
      Q
      Throws:
      E
    • getMatchNoneQuery

      Q getMatchNoneQuery() throws E
      A query that matches no docs.
      Returns:
      Q
      Throws:
      E
    • getLikeQuery

      Q getLikeQuery(String field, String sqlLikeClause, AnalysisMode analysisMode) throws E
      Parameters:
      field - String
      sqlLikeClause - String
      analysisMode - AnalysisMode
      Returns:
      Q
      Throws:
      E extends Throwable
    • getSearchParameters

      SearchParameters getSearchParameters()
      Returns:
      SearchParameters
    • getSortField

      String getSortField(String field) throws E
      Parameters:
      field - String
      Returns:
      String
      Throws:
      E extends Throwable
    • getIdentifierQuery

      Q getIdentifierQuery(String field, String stringValue, AnalysisMode analysisMode, LuceneFunction luceneFunction) throws E
      Wrap generating a potentially complex id + version query
      Parameters:
      field - String
      stringValue - String
      analysisMode - AnalysisMode
      luceneFunction - LuceneFunction
      Returns:
      Q
      Throws:
      E extends Throwable
    • getIdentifieLikeQuery

      Q getIdentifieLikeQuery(String field, String stringValue, AnalysisMode analysisMode) throws E
      Wrap generating a potentially complex id + version query
      Parameters:
      field - String
      stringValue - String
      analysisMode - AnalysisMode
      Returns:
      Q
      Throws:
      E extends Throwable
    • sortFieldExists

      boolean sortFieldExists(String noLocalField)
      Parameters:
      noLocalField - String
      Returns:
      boolean
    • getFieldQuery

      Q getFieldQuery(String field, String value) throws E
      Parameters:
      field - String
      value - String
      Returns:
      Q
      Throws:
      E
    • buildSort

      S buildSort(List<Ordering> list, FunctionEvaluationContext functionContext) throws E
      Parameters:
      list - List
      functionContext - FunctionEvaluationContext
      Returns:
      S
      Throws:
      E
    • getFuzzyQuery

      Q getFuzzyQuery(String luceneFieldName, String term, Float minSimilarity) throws E
      Parameters:
      luceneFieldName - String
      term - String
      minSimilarity - Float
      Returns:
      Q
      Throws:
      E
    • getField

      String getField()
      Get the default field
      Returns:
      String
    • getPhraseSlop

      int getPhraseSlop()
      Get the default phrase slop
      Returns:
      int
    • getFieldQuery

      Q getFieldQuery(String luceneFieldName, String term, AnalysisMode analysisMode, Integer slop, LuceneFunction luceneFunction) throws E
      Parameters:
      luceneFieldName - String
      term - String
      analysisMode - AnalysisMode
      slop - Integer
      luceneFunction - LuceneFunction
      Returns:
      Q
      Throws:
      E extends Throwable
    • getPrefixQuery

      Q getPrefixQuery(String luceneFieldName, String term, AnalysisMode analysisMode) throws E
      Parameters:
      luceneFieldName - String
      term - String
      analysisMode - AnalysisMode
      Returns:
      Q
      Throws:
      E extends Throwable
    • getSpanQuery

      Q getSpanQuery(String luceneFieldName, String first, String last, int slop, boolean inOrder) throws E
      Parameters:
      luceneFieldName - String
      first - String
      last - String
      slop - int
      inOrder - boolean
      Returns:
      Q
      Throws:
      E extends Throwable
    • getWildcardQuery

      Q getWildcardQuery(String luceneFieldName, String term, AnalysisMode mode) throws E
      Parameters:
      luceneFieldName - String
      term - String
      mode - AnalysisMode
      Returns:
      Q
      Throws:
      E extends Throwable
    • getNegatedQuery

      Q getNegatedQuery(Q query) throws E
      Invert a query - add a mandatory must not match anything query alnogside
      Parameters:
      query - Q
      Returns:
      Q
      Throws:
      E extends Throwable
    • getExpressionAdaptor

      QueryParserExpressionAdaptor<Q,E> getExpressionAdaptor()
      Utility to build conjunctions, disjunctions and negation
      Returns:
      QueryParserExpressionAdaptor
    • getMatchAllNodesQuery

      Q getMatchAllNodesQuery()
      A query that matches all alfresco nodes (not extra stuff that may be in the underlying index)
      Returns:
      Q
    • getDatetimeSortField

      String getDatetimeSortField(String field, PropertyDefinition propertyDef)
      Parameters:
      field - String
      propertyDef - PropertyDefinition
      Returns:
      String