Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Registered query: Allow to escape parameter values. #219

Open
lukas-vlcek opened this issue Feb 20, 2015 · 1 comment
Open

Registered query: Allow to escape parameter values. #219

lukas-vlcek opened this issue Feb 20, 2015 · 1 comment

Comments

@lukas-vlcek
Copy link
Member

We need to allow escaping input parameter values before they are applied to Mustache template. Specifically, we need to be able to escape regex special characters (like *).

This will probably lead to adding new functionality to https://github.com/searchisko/structured-content-tools

@lukas-vlcek
Copy link
Member Author

In some cases we can probably use \Q ... \E regex escape sequence directly in the Mustache template. More info about this here and here.

For example we can use:

      "terms": {
        "field": "sys_tags",
        "include": {
          "pattern": "^\\Q{{query}}\\E.*",
          "flags": "CASE_INSENSITIVE|UNICODE_CASE"
        }
      }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant