Class GLSearchFilter

java.lang.Object
globus.glmap.GLNativeObject
globus.glsearch.GLSearchFilter

public class GLSearchFilter extends GLNativeObject
A filter that narrows down results returned by GLSearch.
  • Method Details

    • createWithQuery

      @NonNull public static GLSearchFilter createWithQuery(@NonNull String query)
      Creates a filter that searches objects for the given query.

      Defaults: tag set = GLSearch.TagSetMask.ALL, match type = GLSearch.MatchType.WORD_START.

      Parameters:
      query - part of a word, a whole word, or a phrase to search
      Returns:
      filter instance
    • createWithQueryAndTag

      @NonNull public static GLSearchFilter createWithQueryAndTag(@NonNull String query, @NonNull String tag)
      Creates a filter that searches for query inside a single tag.
      Parameters:
      query - part of a word, a whole word, or a phrase to search
      tag - tag to test
      Returns:
      filter instance
    • createWithQuery

      public static GLSearchFilter createWithQuery(@NonNull String query, int tagSetMask)
      Creates a filter that searches for query inside predefined tag sets.
      Parameters:
      query - part of a word, a whole word, or a phrase to search
      tagSetMask - tag set mask (see GLSearch.TagSetMask)
      Returns:
      filter instance
    • createWithCategory

      public static GLSearchFilter createWithCategory(@NonNull GLSearchCategory category)
      Creates a filter that matches objects of a specific category.
      Parameters:
      category - Category
      Returns:
      filter instance
    • addTagHash

      public void addTagHash(int tagHash)
      Adds a tag using its hash. Tag hashes can be found in a vector object returned from search or found on map.
      Parameters:
      tagHash - Hash of the tag
    • addTag

      public void addTag(@NonNull String tag)
      Adds tag to search filter
      Parameters:
      tag - Tag
    • addTags

      public void addTags(@NonNull List<String> tags)
      Adds additional tags to search filter
      Parameters:
      tags - Tags array
    • setMatchType

      public void setMatchType(int matchType)
      Sets how the query string should be matched against object values.

      Default match type is GLSearch.MatchType.WORD_START.

      Parameters:
      matchType - match type