Description
Index definitions which have the valueRegex property (introduced in OAK-8934) set, cause the resulting indices to only have those values indexed which match that regex.
However at query time, we are allowing query for all values (irrespective of whether they match the valueRegex) against such indices, which might result in the query returning no results.
While solving it completely could be complex for fulltext queries (as seen in example below), we should start with logging a warning if we detect mismatch between query term and valueRegex.
Example 1 -
valueRegex=(["']|^)/
stored value=/content/test
query term=hello
In this case, query term doesn't match valueRegex and it is also not contained in the index.
Example 2 -
valueRegex = oak.*
stored value = oak - the next generation content repository
query term = repository
Query term doesn't match the valueRegex, but it still could still be searched and would return the node.