com.groupdocs.search

Class SearchQuery



  • public abstract class SearchQuery
    extends Object

    Represents a search query.

    • Method Detail

      • getFieldName

        public String getFieldName()

        Gets the field name.

      • getChildCount

        public int getChildCount()

        Gets the number of child queries.

      • getFirstChild

        public SearchQuery getFirstChild()

        Gets the first child query.

      • getSecondChild

        public SearchQuery getSecondChild()

        Gets the second child query.

      • getSearchParameters

        public final SearchParameters getSearchParameters()

        Gets or sets the search parameters.

      • setSearchParameters

        public final void setSearchParameters(SearchParameters value)

        Gets or sets the search parameters.

      • toString

        public abstract String toString()

        Returns a System.String that represents the current SearchQuery instance.

        Overrides:
        toString in class Object
        Returns:
        A System.String that represents the current SearchQuery instance.
      • createWordQuery

        public static SearchQuery createWordQuery(String term)

        Creates a simple word query.

        Parameters:
        term - The term to search for.
        Returns:
        A simple word query.
      • createRegexQuery

        public static SearchQuery createRegexQuery(String pattern)

        Creates a regular expression query.

        Parameters:
        pattern - The regular expression pattern to match.
        Returns:
        A regular expression query.
      • createRegexQuery

        public static SearchQuery createRegexQuery(String pattern,
                                   int options)

        Creates a regular expression query.

        Parameters:
        pattern - The regular expression pattern to match.
        options - A bitwise combination of the enumeration values that modify the regular expression. This value must contain RegexOptions.IgnoreCase flag.
        Returns:
        A regular expression query.
      • createNumericRangeQuery

        public static SearchQuery createNumericRangeQuery(long start,
                                          long end)

        Creates a numeric range query.

        Parameters:
        start - The start value of a range.
        end - The end value of a range.
        Returns:
        A numeric range query.
      • createDateRangeQuery

        public static SearchQuery createDateRangeQuery(com.aspose.ms.System.DateTime start,
                                       com.aspose.ms.System.DateTime end)

        Creates a date range query.

        Parameters:
        start - The start value of a range.
        end - The end value of a range.
        Returns:
        A date range query.
      • createPhraseSearchQuery

        public static SearchQuery createPhraseSearchQuery(SearchQuery... queries)

        Creates a phrase search query.

        Parameters:
        queries - The child queries.
        Returns:
        A phrase search query.
      • createFieldQuery

        public static SearchQuery createFieldQuery(String fieldName,
                                   SearchQuery query)

        Adds a field to the specified query.

        Parameters:
        fieldName - The field name.
        query - The query to add the field.
        Returns:
        A query with the field.
      • createNotQuery

        public static SearchQuery createNotQuery(SearchQuery query)

        Creates a not query.

        Parameters:
        query - The query to negate.
        Returns:
        A not query.
      • createAndQuery

        public static SearchQuery createAndQuery(SearchQuery leftQuery,
                                 SearchQuery rightQuery)

        Creates an and query.

        Parameters:
        leftQuery - The left child query.
        rightQuery - The right child query.
        Returns:
        An and query.
      • createOrQuery

        public static SearchQuery createOrQuery(SearchQuery leftQuery,
                                SearchQuery rightQuery)

        Creates an or query.

        Parameters:
        leftQuery - The left child query.
        rightQuery - The right child query.
        Returns:
        An or query.
      • createWildcardQuery

        public static SearchQuery createWildcardQuery(byte count)

        Creates wildcard for phrase search.

        Parameters:
        count - The number of words.
        Returns:
        A wildcard.
      • createWildcardQuery

        public static SearchQuery createWildcardQuery(byte minCount,
                                      byte maxCount)

        Creates wildcard for phrase search.

        Parameters:
        minCount - The minimum number of words.
        maxCount - The maximum number of words.
        Returns:
        A wildcard.