Right now if you have "Blog.BlogIntroduction", using "Blog/Intro" would match but it would also match "BlogForIntrospection" which isn't expected.
Here's the code:
## Because the user might filter with "/" as separator we replace that by "%", because it could be "."
## (the space separator) or "/" (as it is in the document name).
## In addition, using "%" (any sequence of character) instead of "_" (any single character) gives the ability
## to filter on different levels:
## e.g. filtering on "Blog/Intro" will return "Blog.BlogIntroduction".
## On the other hand, it will also returns: "BlogForIntrospection", which might be unexpected.
#set ($locationFilterValue = $locationFilterValue.replaceAll('/', '%'))
I'm proposing to change to:
#set ($locationFilterValue = $locationFilterValue.replaceAll('/', '%.%'))
The issue with the current code is that when using "/" it'll still return result even though there's no location path separator which is wrong.