use of de.tblsoft.solr.pipeline.bean.Document in project solr-cmd-utils by tblsoft.
the class NetbaseReader method processBatch.
private void processBatch(Gson gson, String response) {
JsonElement jsonResponse = gson.fromJson(response, JsonElement.class);
Iterator<JsonElement> hitsIterator = jsonResponse.getAsJsonObject().get("results").getAsJsonArray().get(0).getAsJsonObject().get("statements").getAsJsonArray().iterator();
while (hitsIterator.hasNext()) {
Document document = new Document();
for (Entry<String, JsonElement> entry : hitsIterator.next().getAsJsonObject().entrySet()) {
if (entry.getValue().isJsonArray()) {
} else if (entry.getValue().isJsonPrimitive()) {
document.addField(entry.getKey(), entry.getValue().getAsString());
}
}
executer.document(document);
}
}
use of de.tblsoft.solr.pipeline.bean.Document in project solr-cmd-utils by tblsoft.
the class OpenThesaurusReader method token2document.
void token2document(String[] lineParts) {
for (String token : lineParts) {
Document document = new Document();
document.setField("token", token);
executer.document(document);
}
}
use of de.tblsoft.solr.pipeline.bean.Document in project solr-cmd-utils by tblsoft.
the class PipelineSaxContentHandler method startElement.
@Override
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException {
currentName = null;
if ("document".equals(localName)) {
currentDocument = new Document();
}
if ("field".equals(localName)) {
currentName = atts.getValue("name");
}
currentValue = new StringBuilder();
}
use of de.tblsoft.solr.pipeline.bean.Document in project solr-cmd-utils by tblsoft.
the class SolrQueryLogReader method logRow.
protected void logRow(SolrLogRow solrLogRow) {
Document document = new Document();
document.addField("coreName", solrLogRow.getCoreName());
document.addField("hits", String.valueOf(solrLogRow.getHits()));
document.addField("fileName", solrLogRow.getLogFile());
document.addField("dirName", currentDirName);
document.addField("queryTime", String.valueOf(solrLogRow.getqTime()));
document.addField("date", date2String(solrLogRow.getTimestamp()));
document.addField("url", solrLogRow.getUrl());
document.addField("raw", solrLogRow.getRaw());
executer.document(document);
}
use of de.tblsoft.solr.pipeline.bean.Document in project solr-cmd-utils by tblsoft.
the class StandardReader method endDocument.
@Override
public void endDocument() {
executer.document(document);
document = new Document();
}
Aggregations