Github user merrimanr commented on a diff in the pull request:
https://github.com/apache/metron/pull/909#discussion_r163859462
--- Diff:
metron-platform/metron-indexing/src/test/java/org/apache/metron/indexing/dao/SearchIntegrationTest.java
---
@@ -724,6 +503,52 @@ public void sort_query_sorts_results_ascending()
throws Exception {
}
}
+ @Test
+ public void sort_ascending_with_missing_fields() throws Exception {
+ SearchRequest request =
JSONUtils.INSTANCE.load(sortAscendingWithMissingFields, SearchRequest.class);
+ SearchResponse response = dao.search(request);
+ Assert.assertEquals(10, response.getTotal());
+ List<SearchResult> results = response.getResults();
+ Assert.assertEquals(10, results.size());
+
+ // the remaining are missing the 'threat:triage:score' and should be
sorted last
+
Assert.assertFalse(results.get(0).getSource().containsKey("threat:triage:score"));
--- End diff --
Done
---