Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-1874

optimize patternreplacefilter

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.1
    • 3.1, 4.0-ALPHA
    • Schema and Analysis
    • None

    Description

      We can optimize PatternReplaceFilter:

      • don't need to create Strings since CharTermAttribute implements CharSequence, just match directly against it.
      • reuse the matcher, since CharTermAttribute is reused, too.
      • don't create Strings/waste time in replaceAll/replaceFirst if the term doesn't match the regex at all... check with find() first.

      There is more that could be done to make it faster for terms that do match, but this is simple and a start.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            rcmuir Robert Muir
            rcmuir Robert Muir
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment