Class SearchIndexNameMatcher

  • All Implemented Interfaces:
    Predicate<String>

    public class SearchIndexNameMatcher
    extends Object
    implements Predicate<String>
    A predicate that checks whether an index pattern matches the current search shard target.
    • Constructor Detail

      • SearchIndexNameMatcher

        public SearchIndexNameMatcher​(String indexName,
                                      String clusterAlias,
                                      ClusterService clusterService)
        Creates a new index name matcher.
        Parameters:
        indexName - he name of the local index.
        clusterAlias - the cluster alias of this search shard target. If it is a local target, the alias should be null or equal to RemoteClusterAware.LOCAL_CLUSTER_GROUP_KEY.
        clusterService - the cluster service.
    • Method Detail

      • test

        public boolean test​(String pattern)
        Given an index pattern, checks whether it matches against the current shard. If this shard represents a remote shard target, then in order to match the pattern contain the separator ':', and must match on both the cluster alias and index name.
        Specified by:
        test in interface Predicate<String>