/** * @param fieldname */ public void removeField(String fieldname) { doc.removeField(fieldname); }
/** * @param fieldname */ public void removeField(String fieldname) { doc.removeField(fieldname); }
dest.removeField(fieldName); // to prevent add in already exist dest field Collection<Object> fieldValues = source.getFieldValues(fieldName); for (Object fieldValue : fieldValues) {
dest.removeField(fieldName); // to prevent add in already exist dest field Collection<Object> fieldValues = source.getFieldValues(fieldName); for (Object fieldValue : fieldValues) {
break; case remove: inputDoc.removeField(fn); break; case removeregex: final String regex = ((HashMap<String, String>) op).get(k); if (regex.matches(fieldStringValue)) { inputDoc.removeField(fn);
.map(App::json2SolrInputDocument) .map(d -> { skipFieldsEquals.forEach(f -> d.removeField(f.getText())); if(!skipFieldsStartWith.isEmpty()) { d.getFieldNames().removeIf(name -> skipFieldsStartWith.stream()
input.removeField(col.name()); for (String nv : newvals) { input.addField(col.name(), nv);
doc.removeField(TREENODE_ROOT); doc.removeField(TREENODE_PARENTS); doc.removeField(TREENODE_DEPTH);
doc.removeField(TREENODE_ROOT); doc.removeField(TREENODE_PARENTS); doc.removeField(TREENODE_DEPTH);
doc.removeField(multiTextFieldName); doc.put(multiTextFieldName, outputField); return doc;
/** * Tag slower documents and add them to the shrank core */ private void tagAndAddSlowThothDocuments() throws IOException, SolrServerException { // Query to return top MAX_NUMBER_SLOW_THOTH_DOCS slower thoth documents QueryResponse qr = realTimeServer.query( new SolrQuery() .setQuery(createThothDocsAggregationQuery()) .addSort(QTIME, SolrQuery.ORDER.desc) .setRows(MAX_NUMBER_SLOW_THOTH_DOCS) ); for (SolrDocument solrDocument: qr.getResults()){ SolrInputDocument si = ClientUtils.toSolrInputDocument(solrDocument); // Remove old ID and version si.removeField(ID); si.removeField("_version_"); // Tag document as slow si.addField(SLOW_QUERY_DOCUMENT, true); LOG.debug("Adding slow query document for server " + serverDetail.getName()); shrankServer.add(si); } }
new_target_doc.removeField(EntityField.ANCESTRY.solrName()); new_target_doc.addField(EntityField.ANCESTRY.solrName(), ancestors);
SolrInputField xmlField = solrInputDocument.removeField(xmlFieldName); SolrInputField luxIdField = solrInputDocument.removeField(idFieldName); String uri = (String) solrInputDocument.getFieldValue(indexConfig.getFieldName(FieldRole.URI)); Document luceneDocument = cmd.getLuceneDocument();
if (document.getDocument() instanceof SolrInputDocument) { SolrInputDocument doc = (SolrInputDocument)document.getDocument(); doc.removeField(CmsSearchField.FIELD_SEARCH_EXCLUDE); } else {
@Override public void copyCollection(String reindexScrollTimeout, String src, String dst) throws DatastoreClientServiceException { SolrQuery solrQuery = new SolrQuery(); solrQuery.setRows(1000); solrQuery.setQuery("*:*"); solrQuery.addSort("id", SolrQuery.ORDER.asc); // Pay attention to this line String cursorMark = CursorMarkParams.CURSOR_MARK_START; boolean done = false; QueryResponse response; try { do { solrQuery.set(CursorMarkParams.CURSOR_MARK_PARAM, cursorMark); response = getClient().query(src, solrQuery); List<SolrInputDocument> documents = new ArrayList<>(); for (SolrDocument document: response.getResults()) { SolrInputDocument inputDocument = getConverter().toSolrInputDocument(document); inputDocument.removeField("_version_"); documents.add(inputDocument); } getClient().add(dst, documents); } while (cursorMark.equals(response.getNextCursorMark())); getClient().commit(dst); } catch (Exception e) { throw new DatastoreClientServiceException(e); } }
solrResource.addDoc(attId, doc); doc.removeField(TREENODE_ATTACHED + treeNodeId); for (Object id : treeNodeParents) { doc.addField(TREENODE_ATTACHED + treeNodeId, id);
solrResource.addDoc(attId, doc); doc.removeField(TREENODE_ATTACHED + treeNodeId); for (Object id : treeNodeParents) { doc.addField(TREENODE_ATTACHED + treeNodeId, id);
private void addEventToTarget(SolrInputDocument doc, DcsEvent event) throws IOException, SolrServerException { add(doc, EventField.DATE, event.getDate()); add(doc, EventField.DETAIL, event.getDetail()); add(doc, EventField.OUTCOME, event.getOutcome()); add(doc, EventField.TYPE, event.getEventType()); // Always remove the dynamic event_date_* field to make sure there is at most one String event_date_field = EventField.DYNAMIC_DATE_TYPE_PREFIX.solrName() + event.getEventType(); doc.removeField(event_date_field); doc.addField(event_date_field, event.getDate()); } }