GitHub user zd-project opened a pull request:
https://github.com/apache/storm/pull/2753
STORM-3133: Fixed bug of unnecessary inclusion of empty search result
`FindNMatches()` didn't correctly filter out empty match result in
`substringSearch()` and hence send back an empty map to user. I don't know if
this the desired behavior but a fix to current behavior will make metrics for
logviewer easier to implement.
An example of current behavior:
```Json
{
"fileOffset": 1,
"searchString": "sdf",
"matches": [
{
"searchString": "sdf",
"fileName": "word-count-1-1530815972/6701/worker.log",
"matches": [],
"port": "6701",
"isDaemon": "no",
"startByteOffset": 0
}
]
}
```
Desired behavior:
```Json
{
"fileOffset": 1,
"searchString": "sdf",
"matches": []
}
```
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/zd-project/storm STORM-3143
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/storm/pull/2753.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2753
----
commit 6ac9146d44b647f43fd3f74e03ee1a06094c1f07
Author: Zhengdai Hu <zhengdai.hu@...>
Date: 2018-07-05T18:20:43Z
STORM-3133: Fixed bug of unnecessary inclusion of empty search result
----
---