Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-2926

Provide a utility function to escape strings for standard Solr query syntax

    XMLWordPrintable

Details

    • New Feature
    • Resolution: Unresolved
    • Major
    • None
    • 16.0.0
    • Velocity
    • None
    • Unknown

    Description

      It is somethings necessary to build Solr query in Velocity, and we need to be able to escape special characters: https://solr.apache.org/guide/solr/latest/query-guide/standard-query-parser.html#escaping-special-characters

      Something like $escapetool.standardSolr or $escapetool.solr would be nice to have.

      Note (for both a workaround and an implementation suggestion) that it should be possible to escape for solr by just adding a backslash behind each character of the string. (this doesn't work and causes org.apache.solr.common.SolrException: org.apache.solr.search.SyntaxError: Non-hex character in Unicode escape sequence: {}){}

      Attachments

        Activity

          People

            Unassigned Unassigned
            rjakse Raphaƫl Jakse
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: