/** * Index one document (in XML format), see {@link #convertSolrDocInXML(SolrInputDocument)}. * * @param docXML a textual representation of the document in XML format. * @throws Exception */ public void indexDocument(String docXML) throws Exception { String xml = "<add>" + docXML + "</add>"; DirectXmlRequest xmlreq = new DirectXmlRequest("/update", xml); mServer.request(xmlreq); }
/**Indexing API for document in xml format**/ public void indexDocument(String docXML) throws Exception { String xml = "<add>" + docXML + "</add>"; DirectXmlRequest xmlreq = new DirectXmlRequest("/update", xml); server.request(xmlreq); }
/** * Submits a batch of update instructions in XML format. * * @param docXML input XML that represents one or more update instruction. * @throws Exception */ public void submitXML(String docXML) throws Exception { DirectXmlRequest xmlreq = new DirectXmlRequest("/update", docXML); mServer.request(xmlreq); }
SolrClient client = new HttpSolrClient("http://localhost:8983/solr/jiva/"); String dataDir = System.getProperty("user.dir"); File xmlFile = new File(dataDir + "/Alovera-Juice.xml"); if (xmlFile.exists()) { InputStream is = new FileInputStream(xmlFile); String str = IOUtils.toString(is); DirectXmlRequest dxr = new DirectXmlRequest("/update", str); client.request(dxr); client.commit(); }
core.request(new DirectXmlRequest("/update", submission)); } catch (Exception ex) { log.error("Error submitting documents to Solr!", ex);
/** * Index a specific annotation * * @param object : The annotation's object * @param pid : The annotation payload * @throws IndexerException if there were errors during indexing */ private void annotate(DigitalObject object, Payload payload) throws IndexerException { String pid = payload.getId(); if (propertiesId.equals(pid)) { return; } try { Properties props = new Properties(); props.setProperty("metaPid", pid); String doc = index(object, payload, null, ANOTAR_RULES_OID, props); if (doc != null) { doc = "<add>" + doc + "</add>"; anotar.request(new DirectXmlRequest("/update", doc)); if (anotarAutoCommit) { anotar.commit(); } } } catch (Exception e) { log.error("Indexing failed!\n-----\n", e); } }
/**Indexing API for document do be indexed in HashMap format**/ public void indexDocument(HashMap<String,Object>indexMap) throws Exception { SolrInputDocument solrDoc=this.buildSolrDocument(indexMap); String docXML=this.convertSolrDocInXML(solrDoc); String xml = "<add>" + docXML + "</add>"; DirectXmlRequest xmlreq = new DirectXmlRequest("/update", xml); server.request(xmlreq); }
solr.request(new DirectXmlRequest("/update", submission)); } catch (Exception ex) { log.error("Error submitting documents to Solr!", ex);
/** * Index one document using a key-value map representation. * * @param keyValueMap key-value map (field name, field text). * @throws Exception */ public void indexDocument(HashMap<String,Object> keyValueMap) throws Exception { SolrInputDocument solrDoc = SolrUtils.buildSolrDocument(keyValueMap); String docXML=this.convertSolrDocInXML(solrDoc); String xml = "<add>" + docXML + "</add>"; DirectXmlRequest xmlreq = new DirectXmlRequest("/update", xml); mServer.request(xmlreq); }
DirectXmlRequest xmlRequest = new DirectXmlRequest(getRequestHandler(), bodyAsString);