forked from D-Net/dnet-hadoop
added JSON payload to the SolrInputDocument, updated unit tests
This commit is contained in:
parent
a7a54aab47
commit
1dc7458de2
|
@ -213,7 +213,7 @@ public class StreamingInputDocumentFactory implements Serializable {
|
||||||
}
|
}
|
||||||
writer.close();
|
writer.close();
|
||||||
indexDocument.addField(INDEX_RESULT, results.toString());
|
indexDocument.addField(INDEX_RESULT, results.toString());
|
||||||
// indexDocument.addField(INDEX_JSON_RESULT, json);
|
indexDocument.addField(INDEX_JSON_RESULT, json);
|
||||||
} finally {
|
} finally {
|
||||||
outputFactory.remove();
|
outputFactory.remove();
|
||||||
eventFactory.remove();
|
eventFactory.remove();
|
||||||
|
|
|
@ -115,12 +115,12 @@ public class XmlIndexingJobTest extends SolrTest {
|
||||||
|
|
||||||
rsp = miniCluster.getSolrClient().query(new SolrQuery().add(CommonParams.Q, "isgreen:true"));
|
rsp = miniCluster.getSolrClient().query(new SolrQuery().add(CommonParams.Q, "isgreen:true"));
|
||||||
assertEquals(
|
assertEquals(
|
||||||
0, rsp.getResults().getNumFound(),
|
4, rsp.getResults().getNumFound(),
|
||||||
"the number of indexed records having isgreen = true");
|
"the number of indexed records having isgreen = true");
|
||||||
|
|
||||||
rsp = miniCluster.getSolrClient().query(new SolrQuery().add(CommonParams.Q, "openaccesscolor:bronze"));
|
rsp = miniCluster.getSolrClient().query(new SolrQuery().add(CommonParams.Q, "openaccesscolor:bronze"));
|
||||||
assertEquals(
|
assertEquals(
|
||||||
0, rsp.getResults().getNumFound(),
|
2, rsp.getResults().getNumFound(),
|
||||||
"the number of indexed records having openaccesscolor = bronze");
|
"the number of indexed records having openaccesscolor = bronze");
|
||||||
|
|
||||||
rsp = miniCluster.getSolrClient().query(new SolrQuery().add(CommonParams.Q, "isindiamondjournal:true"));
|
rsp = miniCluster.getSolrClient().query(new SolrQuery().add(CommonParams.Q, "isindiamondjournal:true"));
|
||||||
|
@ -135,14 +135,14 @@ public class XmlIndexingJobTest extends SolrTest {
|
||||||
|
|
||||||
rsp = miniCluster.getSolrClient().query(new SolrQuery().add(CommonParams.Q, "peerreviewed:true"));
|
rsp = miniCluster.getSolrClient().query(new SolrQuery().add(CommonParams.Q, "peerreviewed:true"));
|
||||||
assertEquals(
|
assertEquals(
|
||||||
0, rsp.getResults().getNumFound(),
|
35, rsp.getResults().getNumFound(),
|
||||||
"the number of indexed records having peerreviewed = true");
|
"the number of indexed records having peerreviewed = true");
|
||||||
|
|
||||||
rsp = miniCluster
|
rsp = miniCluster
|
||||||
.getSolrClient()
|
.getSolrClient()
|
||||||
.query(
|
.query(
|
||||||
new SolrQuery()
|
new SolrQuery()
|
||||||
.add(CommonParams.Q, "objidentifier:\"iddesignpres::ae77e56e84ad058d9e7f19fa2f7325db\"")
|
.add(CommonParams.Q, "objidentifier:\"57a035e5b1ae::236d6d8c1e03368b5ae72acfeeb11bbc\"")
|
||||||
.add(CommonParams.FL, "__json"));
|
.add(CommonParams.FL, "__json"));
|
||||||
assertEquals(
|
assertEquals(
|
||||||
1, rsp.getResults().getNumFound(),
|
1, rsp.getResults().getNumFound(),
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue