[
https://issues.apache.org/jira/browse/METRON-1255?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16209201#comment-16209201
]
ASF GitHub Bot commented on METRON-1255:
----------------------------------------
Github user justinleet commented on a diff in the pull request:
https://github.com/apache/metron/pull/802#discussion_r145372604
--- Diff:
metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/dao/ElasticsearchMetaAlertDao.java
---
@@ -177,15 +178,18 @@ public MetaAlertCreateResponse
createMetaAlert(MetaAlertCreateRequest request)
public SearchResponse search(SearchRequest searchRequest) throws
InvalidSearchException {
// Wrap the query to also get any meta-alerts.
QueryBuilder qb = constantScoreQuery(boolQuery()
- .should(new QueryStringQueryBuilder(searchRequest.getQuery()))
- .should(boolQuery()
- .must(termQuery(MetaAlertDao.STATUS_FIELD,
MetaAlertStatus.ACTIVE.getStatusString()))
- .must(nestedQuery(
+ .must(boolQuery()
+ .should(new QueryStringQueryBuilder(searchRequest.getQuery()))
+ .should(nestedQuery(
ALERT_FIELD,
new QueryStringQueryBuilder(searchRequest.getQuery())
)
)
)
+ .must(boolQuery()
--- End diff --
Would you mind adding a comment explaining this? Basically something to the
effect of "Ensure that it's a meta alert with active status or that it's an
alert (signified by having no status)".
> MetaAlert search is not filtering on status
> -------------------------------------------
>
> Key: METRON-1255
> URL: https://issues.apache.org/jira/browse/METRON-1255
> Project: Metron
> Issue Type: Bug
> Reporter: Ryan Merriman
>
> Currently both active and inactive metaAlerts are being returned in a search.
> Only active metaAlerts should be returned.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)