Examples of index()


Examples of org.elasticsearch.action.termvector.TermVectorRequest.index()

    @Override
    public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) throws Exception {
        MultiTermVectorsRequest multiTermVectorsRequest = new MultiTermVectorsRequest();
        multiTermVectorsRequest.listenerThreaded(false);
        TermVectorRequest template = new TermVectorRequest();
        template.index(request.param("index"));
        template.type(request.param("type"));
        RestTermVectorAction.readURIParameters(template, request);
        multiTermVectorsRequest.ids(Strings.commaDelimitedListToStringArray(request.param("ids")));
        multiTermVectorsRequest.add(template, RestActions.getRestContent(request));
View Full Code Here

Examples of org.elasticsearch.action.update.UpdateRequest.index()

        message.append(String.format(" on index '%s'", request.index()));
        message.append(String.format(" on type '%s'", request.type()));
      } else if (item instanceof UpdateRequest) {
        UpdateRequest request = (UpdateRequest) item;
        message.append(String.format("for key '%s'", request.id()));
        message.append(String.format(" on index '%s'", request.index()));
        message.append(String.format(" on type '%s'", request.type()));
      } else if (item instanceof DeleteRequest) {
        DeleteRequest request = (DeleteRequest) item;
        message.append(String.format("for key '%s'", request.id()));
        message.append(String.format(" on index '%s'", request.index()));
View Full Code Here

Examples of org.elasticsearch.client.Client.index()

                barrier1.await();
                barrier2.await();
                for (; counter < max; counter++) {
                    Client client = client(counter);
                    long id = idGenerator.incrementAndGet();
                    client.index(Requests.indexRequest().index("test").type("type1").id(Long.toString(id))
                            .source(XContentFactory.jsonBuilder().startObject()
                                    .field("num", id % fieldNumLimit)
                                    .endObject()))
                            .actionGet();
                }
View Full Code Here

Examples of org.elasticsearch.cluster.metadata.AliasAction.index()

                aliases.add(alias);
            }
            for (String index : concreteIndices) {
                for (String alias : action.concreteAliases(state.metaData(), index)) {
                    AliasAction finalAction = new AliasAction(action.aliasAction());
                    finalAction.index(index);
                    finalAction.alias(alias);
                    finalActions.add(finalAction);
                    //if there is only delete requests, none will be added if the types do not map to any existing type
                    hasOnlyDeletesButNoneCanBeDone = false;
                }
View Full Code Here

Examples of org.elasticsearch.cluster.metadata.IndexMetaData.index()

        }
        for (MutableShardRouting shard : routingNode) {
            if (!indicesService.hasIndex(shard.index())) {
                final IndexMetaData indexMetaData = event.state().metaData().index(shard.index());
                if (logger.isDebugEnabled()) {
                    logger.debug("[{}] creating index", indexMetaData.index());
                }
                indicesService.createIndex(indexMetaData.index(), indexMetaData.settings(), event.state().nodes().localNode().id());
            }
        }
    }
View Full Code Here

Examples of org.elasticsearch.cluster.metadata.MetaData.index()

        String metaDataSource = MetaData.Builder.toXContent(metaData);
        System.out.println("ToJson: " + metaDataSource);

        MetaData parsedMetaData = MetaData.Builder.fromXContent(XContentFactory.xContent(XContentType.JSON).createParser(metaDataSource));

        IndexMetaData indexMetaData = parsedMetaData.index("test1");
        assertThat(indexMetaData.numberOfShards(), equalTo(1));
        assertThat(indexMetaData.numberOfReplicas(), equalTo(2));
        assertThat(indexMetaData.settings().getAsMap().size(), equalTo(2));
        assertThat(indexMetaData.mappings().size(), equalTo(0));
View Full Code Here

Examples of org.elasticsearch.cluster.routing.MutableShardRouting.index()

                // if its a primary, it will be recovered from the gateway, find one that is closet to it
                if (shard.primary()) {
                    try {
                        CommitPoint commitPoint = cachedCommitPoints.get(shard.shardId());
                        if (commitPoint == null) {
                            commitPoint = ((BlobStoreGateway) ((InternalNode) this.node).injector().getInstance(Gateway.class)).findCommitPoint(shard.index(), shard.id());
                            if (commitPoint != null) {
                                cachedCommitPoints.put(shard.shardId(), commitPoint);
                            } else {
                                cachedCommitPoints.put(shard.shardId(), CommitPoint.NULL);
                            }
View Full Code Here

Examples of org.elasticsearch.cluster.routing.RestoreSource.index()

            logger.trace("[{}] restoring shard  [{}]", restoreSource.snapshotId(), shardId);
        }
        try {
            IndexShardRepository indexShardRepository = repositoriesService.indexShardRepository(restoreSource.snapshotId().getRepository());
            ShardId snapshotShardId = shardId;
            if (!shardId.getIndex().equals(restoreSource.index())) {
                snapshotShardId = new ShardId(restoreSource.index(), shardId.id());
            }
            indexShardRepository.restore(restoreSource.snapshotId(), shardId, snapshotShardId, recoveryState);
            restoreService.indexShardRestoreCompleted(restoreSource.snapshotId(), shardId);
        } catch (Throwable t) {
View Full Code Here

Examples of org.elasticsearch.cluster.routing.RoutingTable.index()

                .build();
        RoutingTable routingTable = routingTable()
                .add(indexRoutingTable("test1").initializeEmpty(metaData.index("test1")))
                .build();

        ShardIterator shardIterator = routingTable.index("test1").shard(0).shardsIt(0);
        assertThat(shardIterator.size(), equalTo(3));
        assertThat(shardIterator.firstOrNull(), notNullValue());
        assertThat(shardIterator.remaining(), equalTo(3));
        assertThat(shardIterator.firstOrNull(), sameInstance(shardIterator.firstOrNull()));
        assertThat(shardIterator.remaining(), equalTo(3));
View Full Code Here

Examples of org.elasticsearch.cluster.routing.ShardRouting.index()

        if (inRelocation) {
            return true; // lets true, so we reroute in this case
        }

        // add the failed shard to the unassigned shards
        allocation.routingNodes().unassigned().add(new MutableShardRouting(failedShard.index(), failedShard.id(),
                null, failedShard.primary(), ShardRoutingState.UNASSIGNED, failedShard.version() + 1));

        return true;
    }
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.