Examples of parent()


Examples of org.elasticsearch.action.delete.DeleteRequest.parent()

        controller.registerHandler(DELETE, "/{index}/{type}/{id}", this);
    }

    @Override public void handleRequest(final RestRequest request, final RestChannel channel) {
        DeleteRequest deleteRequest = new DeleteRequest(request.param("index"), request.param("type"), request.param("id"));
        deleteRequest.parent(request.param("parent"));
        deleteRequest.routing(request.param("routing"));
        deleteRequest.timeout(request.paramAsTime("timeout", DeleteRequest.DEFAULT_TIMEOUT));
        deleteRequest.refresh(request.paramAsBoolean("refresh", deleteRequest.refresh()));
        deleteRequest.version(RestActions.parseVersion(request));
        // we just send a response, no need to fork
View Full Code Here

Examples of org.elasticsearch.action.explain.ExplainRequest.parent()

    }

    @Override
    public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
        final ExplainRequest explainRequest = new ExplainRequest(request.param("index"), request.param("type"), request.param("id"));
        explainRequest.parent(request.param("parent"));
        explainRequest.routing(request.param("routing"));
        explainRequest.preference(request.param("preference"));
        String sourceString = request.param("source");
        String queryString = request.param("q");
        if (request.hasContent()) {
View Full Code Here

Examples of org.elasticsearch.action.get.GetRequest.parent()

        final GetRequest getRequest = new GetRequest(request.param("index"), request.param("type"), request.param("id"));
        getRequest.listenerThreaded(false);
        getRequest.operationThreaded(true);
        getRequest.refresh(request.paramAsBoolean("refresh", getRequest.refresh()));
        getRequest.routing(request.param("routing"))// order is important, set it after routing, so it will set the routing
        getRequest.parent(request.param("parent"));
        getRequest.preference(request.param("preference"));
        getRequest.realtime(request.paramAsBoolean("realtime", null));
        getRequest.ignoreErrorsOnGeneratedFields(request.paramAsBoolean("ignore_errors_on_generated_fields", false));

        String sField = request.param("fields");
View Full Code Here

Examples of org.elasticsearch.action.index.IndexRequest.parent()

        for (Map<String, Object> comment : comments) {
          String commentId = extractCommentId(comment);
          IndexRequest irq = indexRequest(indexName).type(commentTypeName).id(commentId)
              .source(prepareCommentIndexedDocument(spaceKey, issueKey, comment));
          if (commentIndexingMode == CommentIndexingMode.CHILD) {
            irq.parent(issueKey);
          }
          esBulk.add(irq);
        }
      }
    }
View Full Code Here

Examples of org.elasticsearch.action.index.IndexRequest.parent()

        for (Map<String, Object> changelog : changelogs) {
          String commentId = extractChangelogId(changelog);
          IndexRequest irq = indexRequest(indexName).type(changelogTypeName).id(commentId)
              .source(prepareChangelogIndexedDocument(jiraProjectKey, issueKey, changelog));
          if (changelogIndexingMode == IssueCommentIndexingMode.CHILD) {
            irq.parent(issueKey);
          }
          esBulk.add(irq);
        }
      }
    }
View Full Code Here

Examples of org.elasticsearch.action.index.IndexRequest.parent()

        String id = request.hasParam("id") ? request.param("id") : getIdForDoc(doc);

        // create an IndexRequest for this document
        IndexRequest indexRequest = new IndexRequest(index, type, id);
        indexRequest.routing(request.param("routing"));
        indexRequest.parent(request.param("parent"));
        indexRequest.source(doc);
        indexRequest.timeout(request.paramAsTime("timeout", IndexRequest.DEFAULT_TIMEOUT));
        indexRequest.refresh(request.paramAsBoolean("refresh", indexRequest.refresh()));

        // TODO: this caused issues, do we need it?
View Full Code Here

Examples of org.elasticsearch.action.index.IndexRequest.parent()

                            throw new RoutingMissingException(indexRequest.index(), indexRequest.type(), indexRequest.id());
                        }
                    }

                    SourceToParse sourceToParse = SourceToParse.source(indexRequest.source()).type(indexRequest.type()).id(indexRequest.id())
                            .routing(indexRequest.routing()).parent(indexRequest.parent());
                    long version;
                    Engine.IndexingOperation op;
                    if (indexRequest.opType() == IndexRequest.OpType.INDEX) {
                        Engine.Index index = indexShard.prepareIndex(sourceToParse).version(indexRequest.version()).versionType(indexRequest.versionType()).origin(Engine.Operation.Origin.PRIMARY);
                        indexShard.index(index);
View Full Code Here

Examples of org.elasticsearch.action.index.IndexRequest.parent()

            BulkItemRequest item = request.items()[i];
            if (item.request() instanceof IndexRequest) {
                IndexRequest indexRequest = (IndexRequest) item.request();
                try {
                    SourceToParse sourceToParse = SourceToParse.source(indexRequest.source()).type(indexRequest.type()).id(indexRequest.id())
                            .routing(indexRequest.routing()).parent(indexRequest.parent());
                    if (indexRequest.opType() == IndexRequest.OpType.INDEX) {
                        Engine.Index index = indexShard.prepareIndex(sourceToParse).version(indexRequest.version()).origin(Engine.Operation.Origin.REPLICA);
                        indexShard.index(index);
                    } else {
                        Engine.Create create = indexShard.prepareCreate(sourceToParse).version(indexRequest.version()).origin(Engine.Operation.Origin.REPLICA);
View Full Code Here

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

    @Override
    public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) throws Exception {
        UpdateRequest updateRequest = new UpdateRequest(request.param("index"), request.param("type"), request.param("id"));
        updateRequest.listenerThreaded(false);
        updateRequest.routing(request.param("routing"));
        updateRequest.parent(request.param("parent")); // order is important, set it after routing, so it will set the routing
        updateRequest.timeout(request.paramAsTime("timeout", updateRequest.timeout()));
        updateRequest.refresh(request.paramAsBoolean("refresh", updateRequest.refresh()));
        String replicationType = request.param("replication");
        if (replicationType != null) {
            updateRequest.replicationType(ReplicationType.fromString(replicationType));
View Full Code Here

Examples of org.elasticsearch.index.mapper.ParsedDocument.parent()

                .field("x_field", "x_value")
                .endObject()
                .bytes()).type("type").id("1"));

        // no _parent mapping, used as a simple field
        assertThat(doc.parent(), nullValue());
        assertThat(doc.rootDoc().get("_parent"), nullValue());
    }

    @Test
    public void parentSetInDocNotExternally() throws Exception {
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.