[
https://issues.apache.org/jira/browse/METRON-1801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16642556#comment-16642556
]
ASF GitHub Bot commented on METRON-1801:
----------------------------------------
Github user nickwallen commented on a diff in the pull request:
https://github.com/apache/metron/pull/1218#discussion_r223513848
--- Diff:
metron-platform/metron-elasticsearch/src/test/java/org/apache/metron/elasticsearch/integration/ElasticsearchSearchIntegrationTest.java
---
@@ -352,6 +350,24 @@ public void different_type_filter_query() throws
Exception {
Assert.assertEquals("data 1", results.get(0).getSource().get("ttl"));
}
+ @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()));
+ Assert.assertNotNull(source.get(Constants.GUID));
--- End diff --
Elasticsearch must now always return the GUID to populate the UI. We
cannot rely on the document ID being the same as the Metron GUID.
> Allow Customization of Elasticsearch Document ID
> ------------------------------------------------
>
> Key: METRON-1801
> URL: https://issues.apache.org/jira/browse/METRON-1801
> Project: Metron
> Issue Type: Sub-task
> Reporter: Nick Allen
> Assignee: Nick Allen
> Priority: Major
>
> The user should be able to customize the document ID that is set by the
> client when indexing documents into Elasticsearch. The user should be able
> to use the Metron GUID, define their own custom document ID, or choose to not
> have the document ID set by the client.
>
> This task covers Elasticsearch only. An additional task should be created to
> cover Solr.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)