SolrDocWriter(XQueryComponent xQueryComponent, SolrCore core) { this.core = core; this.xqueryComponent = xQueryComponent; IndexConfiguration indexConfig = xQueryComponent.getSolrIndexConfig().getIndexConfig(); uriFieldName = indexConfig.getFieldName(FieldRole.URI); xmlFieldName = indexConfig.getFieldName(FieldRole.XML_STORE); }
private void writeLocal(SolrInputDocument solrDoc, NodeInfo node, String uri) { XmlIndexer indexer = null; try { indexer = xqueryComponent.getSolrIndexConfig().checkoutXmlIndexer(); try { indexer.index(node, uri); } catch (XMLStreamException e) { throw new LuxException(e); } UpdateDocCommand cmd = new UpdateDocCommand(core, indexer.createLuceneDocument(), uri); cmd.solrDoc = solrDoc; core.getUpdateHandler().addDoc(cmd); } catch (IOException e) { throw new LuxException(e); } finally { if (indexer != null) { xqueryComponent.getSolrIndexConfig().returnXmlIndexer(indexer); } } }