Search in sources :

Example 11 with AliasFilter

use of org.elasticsearch.search.internal.AliasFilter in project elasticsearch by elastic.

the class AbstractSearchAsyncAction method buildShardSearchRequest.

public final ShardSearchTransportRequest buildShardSearchRequest(ShardIterator shardIt, ShardRouting shard) {
    AliasFilter filter = aliasFilter.get(shard.index().getUUID());
    assert filter != null;
    float indexBoost = concreteIndexBoosts.getOrDefault(shard.index().getUUID(), DEFAULT_INDEX_BOOST);
    return new ShardSearchTransportRequest(request, shardIt.shardId(), getNumShards(), filter, indexBoost, startTime);
}
Also used : AliasFilter(org.elasticsearch.search.internal.AliasFilter) ShardSearchTransportRequest(org.elasticsearch.search.internal.ShardSearchTransportRequest)

Example 12 with AliasFilter

use of org.elasticsearch.search.internal.AliasFilter in project elasticsearch by elastic.

the class ShardValidateQueryRequest method readFrom.

@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    query = in.readNamedWriteable(QueryBuilder.class);
    int typesSize = in.readVInt();
    if (typesSize > 0) {
        types = new String[typesSize];
        for (int i = 0; i < typesSize; i++) {
            types[i] = in.readString();
        }
    }
    filteringAliases = new AliasFilter(in);
    explain = in.readBoolean();
    rewrite = in.readBoolean();
    nowInMillis = in.readVLong();
}
Also used : AliasFilter(org.elasticsearch.search.internal.AliasFilter) QueryBuilder(org.elasticsearch.index.query.QueryBuilder)

Example 13 with AliasFilter

use of org.elasticsearch.search.internal.AliasFilter in project elasticsearch by elastic.

the class ExplainRequest method readFrom.

@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    type = in.readString();
    id = in.readString();
    routing = in.readOptionalString();
    preference = in.readOptionalString();
    query = in.readNamedWriteable(QueryBuilder.class);
    filteringAlias = new AliasFilter(in);
    storedFields = in.readOptionalStringArray();
    fetchSourceContext = in.readOptionalWriteable(FetchSourceContext::new);
    nowInMillis = in.readVLong();
}
Also used : AliasFilter(org.elasticsearch.search.internal.AliasFilter) QueryBuilder(org.elasticsearch.index.query.QueryBuilder)

Example 14 with AliasFilter

use of org.elasticsearch.search.internal.AliasFilter in project elasticsearch by elastic.

the class ClusterSearchShardsResponse method readFrom.

@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    groups = new ClusterSearchShardsGroup[in.readVInt()];
    for (int i = 0; i < groups.length; i++) {
        groups[i] = ClusterSearchShardsGroup.readSearchShardsGroupResponse(in);
    }
    nodes = new DiscoveryNode[in.readVInt()];
    for (int i = 0; i < nodes.length; i++) {
        nodes[i] = new DiscoveryNode(in);
    }
    if (in.getVersion().onOrAfter(Version.V_5_1_1_UNRELEASED)) {
        int size = in.readVInt();
        indicesAndFilters = new HashMap<>();
        for (int i = 0; i < size; i++) {
            String index = in.readString();
            AliasFilter aliasFilter = new AliasFilter(in);
            indicesAndFilters.put(index, aliasFilter);
        }
    }
}
Also used : DiscoveryNode(org.elasticsearch.cluster.node.DiscoveryNode) AliasFilter(org.elasticsearch.search.internal.AliasFilter)

Example 15 with AliasFilter

use of org.elasticsearch.search.internal.AliasFilter in project elasticsearch by elastic.

the class ClusterSearchShardsResponse method writeTo.

@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeVInt(groups.length);
    for (ClusterSearchShardsGroup response : groups) {
        response.writeTo(out);
    }
    out.writeVInt(nodes.length);
    for (DiscoveryNode node : nodes) {
        node.writeTo(out);
    }
    if (out.getVersion().onOrAfter(Version.V_5_1_1_UNRELEASED)) {
        out.writeVInt(indicesAndFilters.size());
        for (Map.Entry<String, AliasFilter> entry : indicesAndFilters.entrySet()) {
            out.writeString(entry.getKey());
            entry.getValue().writeTo(out);
        }
    }
}
Also used : DiscoveryNode(org.elasticsearch.cluster.node.DiscoveryNode) AliasFilter(org.elasticsearch.search.internal.AliasFilter) Map(java.util.Map) HashMap(java.util.HashMap)

Aggregations

AliasFilter (org.elasticsearch.search.internal.AliasFilter)22 HashMap (java.util.HashMap)11 DiscoveryNode (org.elasticsearch.cluster.node.DiscoveryNode)10 ShardId (org.elasticsearch.index.shard.ShardId)7 ArrayList (java.util.ArrayList)6 Map (java.util.Map)6 ShardIterator (org.elasticsearch.cluster.routing.ShardIterator)6 BytesStreamOutput (org.elasticsearch.common.io.stream.BytesStreamOutput)6 NamedWriteableAwareStreamInput (org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput)6 StreamInput (org.elasticsearch.common.io.stream.StreamInput)6 Set (java.util.Set)5 IOException (java.io.IOException)4 List (java.util.List)4 ActionListener (org.elasticsearch.action.ActionListener)4 GroupShardsIterator (org.elasticsearch.cluster.routing.GroupShardsIterator)4 ShardRouting (org.elasticsearch.cluster.routing.ShardRouting)4 Index (org.elasticsearch.index.Index)4 Collections (java.util.Collections)3 HashSet (java.util.HashSet)3 CountDownLatch (java.util.concurrent.CountDownLatch)3