Class TreeMaker

    • Field Detail

      • ROLE

        public static final String ROLE
        The component role.
    • Method Detail

      • toQuery

        public <V extends WrappedValueQuery toQuery​(V value,
                                                      String stringOperator,
                                                      BiFunction<V,​Query.Operator,​Query> toQuery,
                                                      String language,
                                                      Map<String,​Object> contextualParameters)
        Gets the query given the parameters.
        If the provided operator as string represents a real server-side Query.Operator, then it is just the provided BiFunction which is applied.
        Otherwise, the operator is a client-side one, and it will be transformed by modifying the value (by adding wildcards for instance), and deducting the server-side Query.Operator. Then, the BiFunction is applied with the transformed value and the deducted Query.Operator.
        Type Parameters:
        V - The type of WrappedValue
        Parameters:
        value - The value
        stringOperator - The operator as string
        toQuery - A function applied to a transformed value (not necessarily the one given by the method, as it can be transformed by adding wildcard chars, escaping...) and a real Query.Operator (deducted from the given client-side string operator)
        language - The language
        contextualParameters - The contextual parameters
        Returns:
        The result query
      • escapeQueryCharsForLikeQuery

        protected static String escapeQueryCharsForLikeQuery​(String string,
                                                             Map<String,​Object> contextualParameters)
        Escape special Solr query characters of the user input, before building the query in order to append '*' character(s)
        Parameters:
        string - The string to escape.
        contextualParameters - the search contextual parameters.
        Returns:
        The escaped string.