Parameter expansion and functions

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Parameter expansion and functions

Dariusz Wojtas

I am using SOLR 7.1
I've read some time ago the article
It's very helpful, knowing the trick with dummy parameter as a workaround
in some cases is very helpful.

It is possible to use constructs like this in solrsonfig.xml
<lst name="defaults">
    <str name="varA">10</str>
     <str name="varB">${dummyParam:${varA}} and some other content</str>
It resolves as expected. This way I may calculate some parameters on the

But is there any chance to make this feature more complex?
Can I do something conditionally inside?
Can I use logical operators, or some other functions to construct local
I know, one may say it may break security, etc.
Let it be turned off by default, let it require allowing local parameters
by name, to be allowed this. but can it be done?

My current need is to define the buusted query on the fly, but this feature
could help me in the past also. Example:

I have static 'q' param:
    <str name="q">{!edismax
              qf='idx_IDs^5 idx_names^3 idx_address^1'

Sometimes it is longer.
And I'd like to decide on the fly which fields should be included in the
query, same as their weights.
It works if I want to assign parametrized weight:
    <str name="q">{!edismax
              qf='idx_IDs^5 idx_names^3

But can I make it more dynamic? Conditionals? I ytried with the  {!switch
case.... default... v... } but it looks like this function expansion is
applied at some later stage, and it fails when I try to put it in "q"

Best regards,
Dariusz Wojtas