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

Provide a way to run a custom Elasticsearch query as the default search #14842

Closed
MikeAlhayek opened this issue Dec 5, 2023 · 1 comment · Fixed by #14843
Closed

Provide a way to run a custom Elasticsearch query as the default search #14842

MikeAlhayek opened this issue Dec 5, 2023 · 1 comment · Fixed by #14843
Milestone

Comments

@MikeAlhayek
Copy link
Member

Is your feature request related to a problem? Please describe.

In the search module, the only available option to conduct a search is using query-string or multi-match query by providing a list of default fields to search. What if I want to customize the query for example by using fuzziness or other options? Currently, there is no simply way to configure the default search to use advance search options.

Describe the solution you'd like

I think we should add a way for the user to define the a custom query that we would use to perform the search. For example, I want to define this query to be used when the a user search the default index.

{
  "query": {
    "match": {
      "Content.ContentItem.FullText": {
        "query": "{{ term }}",
        "fuzziness": "AUTO",
        "analyzer": "whitespace"
      }
    }
  }
}
@sebastienros
Copy link
Member

Use JSON encoding in the template renderer such that by default all inputs are encoded.
Devs can still user {{ terms | raw }} is they want to bypass it.

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

Successfully merging a pull request may close this issue.

2 participants