Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-9480

Log a warning for improper usage of an index with valueRegex set

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.42.0
    • indexing
    • None

    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.

       

       

      Attachments

        Issue Links

          Activity

            People

              amrverma Amrit Verma
              amrverma Amrit Verma
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: