Examples of IndexRequest


Examples of com.basho.riak.client.http.request.IndexRequest

        return convert(res.get());
    }

    public StreamingOperation<IndexEntry> fetchIndex(IndexSpec indexSpec) {
       
        IndexRequest req = convert(indexSpec);
        IndexResponseV2 response = client.index(req);
        return new IndexSource(response);
    }
View Full Code Here

Examples of com.basho.riak.pbc.IndexRequest

 
    }

    public PBStreamingIndex fetchIndex(IndexSpec indexSpec) throws IOException {
       
        IndexRequest req = convert(indexSpec);
       
        final IndexSource indexSource = client.index(req);
        return new PBStreamingIndex(indexSource);
    }
View Full Code Here

Examples of com.dotcms.repackage.org.elasticsearch.action.index.IndexRequest

            try {
                if(con.isWorking()) {
                    mapping=gson.toJson(mappingAPI.toMap(con));
                   
                    if(!reindexOnly)
                        req.add(new IndexRequest(info.working, "content", id)
                                    .source(mapping));
                    if(info.reindex_working!=null)
                        req.add(new IndexRequest(info.reindex_working, "content", id)
                                    .source(mapping));
                }
   
                if(con.isLive()) {
                    if(mapping==null)
                        mapping=gson.toJson(mappingAPI.toMap(con));
                   
                    if(!reindexOnly)
                        req.add(new IndexRequest(info.live, "content", id)
                                .source(mapping));
                    if(info.reindex_live!=null)
                        req.add(new IndexRequest(info.reindex_live, "content", id)
                                .source(mapping));
                }
            }
            catch(DotMappingException ex) {
                Logger.error(this, "Can't get a mapping for contentlet with id_lang:"+id+" Content data: "+con.getMap(), ex);
View Full Code Here

Examples of org.apache.hadoop.hbase.hbql.statement.select.IndexRequest

        if (withArgs.hasAnIndex()) {
            final byte[] upperBytes = Arrays.copyOf(lowerBytes, lowerBytes.length);
            // Increment final byte because the range in index is inclusive/exclusive
            upperBytes[lowerBytes.length - 1]++;
            return new IndexRequest(lowerBytes, upperBytes, columnAttribs);
        }
        else {
            // Use Get if no server filter is used
            if (withArgs.getServerExpressionTree() == null) {
                final Get get = new Get(lowerBytes);
View Full Code Here

Examples of org.apache.hadoop.hbase.hbql.statement.select.IndexRequest

        final Scan scan = new Scan();
        this.setStartStopRows(scan, keyAttrib);
        withArgs.setScanArgs(scan, columnAttribs);
        final RowRequest rowRequest = withArgs.hasAnIndex()
                                      ? new IndexRequest(scan.getStartRow(), scan.getStopRow(), columnAttribs)
                                      : new ScanRequest(scan);

        return Lists.newArrayList(rowRequest);
    }
View Full Code Here

Examples of org.elasticsearch.action.index.IndexRequest

                    logger.warn("river was closing while processing wikipedia page [{}]/[{}]. Operation skipped.",
                            page.getID(), page.getTitle());
                    return;
                }

                bulkProcessor.add(new IndexRequest(indexName, typeName, page.getID()).source(builder));
            } catch (Exception e) {
                logger.warn("failed to construct index request", e);
            }
        }
View Full Code Here

Examples of org.elasticsearch.action.index.IndexRequest

      List<Map<String, Object>> comments = extractComments(document);
      if (comments != null && !comments.isEmpty()) {
        String issueKey = extractDocumentId(document);
        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

      List<Map<String, Object>> comments = extractIssueComments(issue);
      if (comments != null && !comments.isEmpty()) {
        String issueKey = extractIssueKey(issue);
        for (Map<String, Object> comment : comments) {
          String commentId = extractCommentId(comment);
          IndexRequest irq = indexRequest(indexName).type(commentTypeName).id(commentId)
              .source(prepareCommentIndexedDocument(jiraProjectKey, issueKey, comment));
          if (commentIndexingMode == IssueCommentIndexingMode.CHILD) {
            irq.parent(issueKey);
          }
          esBulk.add(irq);
        }
      }
    }

    if (changelogIndexingMode.isExtraDocumentIndexed()) {
      List<Map<String, Object>> changelogs = extractIssueChangelogs(issue);
      if (changelogs != null && !changelogs.isEmpty()) {
        String issueKey = extractIssueKey(issue);
        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

        // Get the id from request or if not available generate an id for the document
        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?
        // indexRequest.version(RestActions.parseVersion(request));
        // indexRequest.versionType(VersionType.fromString(request.param("version_type"),
        // indexRequest.versionType()));

        indexRequest.percolate(request.param("percolate", null));
        indexRequest.opType(IndexRequest.OpType.INDEX);

        // TODO: force creation of index, do we need it?
        // indexRequest.create(true);

        String replicationType = request.param("replication");
        if (replicationType != null) {
            indexRequest.replicationType(ReplicationType.fromString(replicationType));
        }

        String consistencyLevel = request.param("consistency");
        if (consistencyLevel != null) {
            indexRequest.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel));
        }

        // we just send a response, no need to fork
        indexRequest.listenerThreaded(true);

        // we don't spawn, then fork if local
        indexRequest.operationThreaded(true);

        return indexRequest;
    }
View Full Code Here

Examples of org.elasticsearch.action.index.IndexRequest

     * The default content type to use to generate source documents when indexing.
     */
    public static XContentType INDEX_CONTENT_TYPE = XContentType.JSON;

    public static IndexRequest indexRequest() {
        return new IndexRequest();
    }
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.