本文整理汇总了Java中org.apache.solr.client.solrj.request.UpdateRequest.setPath方法的典型用法代码示例。如果您正苦于以下问题:Java UpdateRequest.setPath方法的具体用法?Java UpdateRequest.setPath怎么用?Java UpdateRequest.setPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.solr.client.solrj.request.UpdateRequest
的用法示例。
在下文中一共展示了UpdateRequest.setPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: insertTestDocuments
import org.apache.solr.client.solrj.request.UpdateRequest; //导入方法依赖的package包/类
private void insertTestDocuments (int n, int nkids, boolean preserveDV) throws Exception {
UpdateRequest req = new UpdateRequest();
req.setPath(UPDATE_DOCVALUES);
if (preserveDV) {
req.setParam(UpdateDocValuesProcessor.UPDATEDV_VALUE_FIELD, WEIGHT_DV);
}
for (int i = 1; i <= n; i++) {
SolrInputDocument doc = new SolrInputDocument();
doc.addField(URI, uri(i));
doc.addField(TEXT_FIELD, "This is document " + i);
// NOTE: must provide a value for at least one document in order to create the field:
// it's not enough to just put it in the solr schema
if (! preserveDV) {
doc.addField(WEIGHT_DV, 0);
}
for (int j = 1; j <= nkids; j++) {
SolrInputDocument kid = new SolrInputDocument();
kid.addField(URI, uriChild(i, j));
kid.addField(TEXT_FIELD, "This is child document " + i + "/" + j);
doc.addChildDocument(kid);
}
req.add(doc);
}
solr.request(req);
solr.commit(false, true, true);
}
示例2: updateDocValues
import org.apache.solr.client.solrj.request.UpdateRequest; //导入方法依赖的package包/类
private UpdateRequest updateDocValues () {
UpdateRequest req = new UpdateRequest();
req.setParam(UpdateDocValuesProcessor.UPDATEDV_KEY_FIELD, URI);
req.setParam(UpdateDocValuesProcessor.UPDATEDV_VALUE_FIELD, WEIGHT_DV);
req.setPath(UPDATE_DOCVALUES);
return req;
}