Github user nickwallen commented on a diff in the pull request:
https://github.com/apache/metron/pull/1218#discussion_r223513924
--- Diff:
metron-platform/metron-solr/src/test/java/org/apache/metron/solr/integration/SolrSearchIntegrationTest.java
---
@@ -223,6 +225,23 @@ public void returns_column_data_for_multiple_indices()
throws Exception {
Assert.assertEquals(null, fieldTypes.get("fake.field"));
}
+ @Test
+ public void queries_fields() throws Exception {
+ SearchRequest request = JSONUtils.INSTANCE.load(fieldsQuery,
SearchRequest.class);
+ SearchResponse response = getIndexDao().search(request);
+ Assert.assertEquals(10, response.getTotal());
+
+ List<SearchResult> results = response.getResults();
+ Assert.assertEquals(10, response.getResults().size());
+
+ // validate the source fields contained in the search response
+ for (int i = 0; i < 10; ++i) {
+ Map<String, Object> source = results.get(i).getSource();
+ Assert.assertNotNull(source);
+
Assert.assertNotNull(source.get(Constants.Fields.SRC_ADDR.getName()));
--- End diff --
Solr does not return the Metron GUID; unlike Elasticsearch.
---