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

Fixes a few issues about FilterQuery in listconfig, #686

Closed
Yuanuo opened this issue Oct 29, 2019 · 1 comment
Closed

Fixes a few issues about FilterQuery in listconfig, #686

Yuanuo opened this issue Oct 29, 2019 · 1 comment

Comments

@Yuanuo
Copy link
Contributor

Yuanuo commented Oct 29, 2019

1, if FilterQuery (such as q) is configured in the Listconfig, it will not be replaced with a real search string if it contains %(query).

2, The new Listconfig is forced to specify Locale as en, and the configuration of en is also read first in hard-coded, and if you want to use a List configuration in a multilingual environment, it always read en's configuration (although there may be other implementation methods, such as creating multiple List configurations). So add a macro "%(locale)" and you can configure it in this way with q={!qf="content_%(locale)"}%(query).

Made such a code change: Yuanuo@9d7513c

@dSeidel
Copy link
Contributor

dSeidel commented Oct 8, 2021

Hi @Yuanuo , thanks for the suggestion. I added the macros to the master branch (pushed soon) as you suggested. Nevertheless, be very careful using it. There are multiple reasons for this hint:

  1. In the integrated list, the query is already modified to use (see CmsSimpleSearchConfigurationParser#getQueryModifier)
  2. The field is intentionally called "Filter query" and you should not set "q=" there. It's made for "fq=".
  3. The integrated list is a feature to get search up easily with limited configuration. If you want more complex configurations, maybe use your own type or a dynamic function, backed up with cms:search using a json configuration and this configuration can be part of a JSP - meaning you can tweak the configuration as you like without macros.

Moreover, be aware that the "Filter query" options must be url encoded in the current master branch, ie., you have to write the macros url encoded.

@dSeidel dSeidel closed this as completed Oct 8, 2021
jenkinsalkacon pushed a commit that referenced this issue Oct 13, 2021
and %(locale) to the additionalsolrparams as suggested in GitHub issue
#686.

Note that the macros - like the whole additionalsolrparams must be
provided url encoded, i.e. %25%28query%29 and %25%28locale%29.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants