You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@solr.apache.org by Stefan <st...@gmx.de> on 2022/04/21 09:24:10 UTC
property substitution in the solrconfig.xml
Hi all,
I am currently struggling with property substitution in the solrconfig.xml.
I am using version 8.11.0
My solrconfig.xml looks something like
<requestHandler name="/select" class="solr.SearchHandler">
<lst name="defaults">
<str name="defType">edismax</str>
<str name="qf">
name^${name.weight}
...
</str>
I have some default values defined in the core.properties file, which
looks like
...
name.weight=1.0
...
I want to override some of those defaults and i am using the Config API
as recommended here
https://solr.apache.org/guide/8_11/configuring-solrconfig-xml.html#config-api-to-override-solrconfig-xml
After that, my configoverlay.json looks like
{
"userProps": {
"name.weight": "10.0",
...
}
}
After setting all up like this and querying documents on the name field,
the scores of the documents are wrong because the weight from the
core.properties is used
instead of the weight from the configoverlay.json.
For some reason the property substitution is not working as i am
expecting it.
Isn't it like, configoverlay.json has a higher priority than the
properties from core.properties?
So that the values of configoverlay.json should be used for property
substitution in the solrconfig.xml?
Thanks,
Stefan
Re: property substitution in the solrconfig.xml
Posted by Eric Pugh <ep...@opensourceconnections.com>.
If you are playing around with weights, maybe look instead at using ParamSets to define your various experiments, and then swap between them?
> On Apr 21, 2022, at 12:01 PM, Shawn Heisey <ap...@elyograg.org> wrote:
>
> On 4/21/22 03:24, Stefan wrote:
>> After setting all up like this and querying documents on the name field,
>> the scores of the documents are wrong because the weight from the
>> core.properties is used
>> instead of the weight from the configoverlay.json.
>
> As far as I am aware, the configoverlay.json file overrides settings in solrconfig.xml, it doesn't override core.properties. I haven't actually used the config-modifying API, so I do not know what settings are possible in the config overlay.
>
> Thanks,
> Shawn
>
_______________________
Eric Pugh | Founder & CEO | OpenSource Connections, LLC | 434.466.1467 | http://www.opensourceconnections.com <http://www.opensourceconnections.com/> | My Free/Busy <http://tinyurl.com/eric-cal>
Co-Author: Apache Solr Enterprise Search Server, 3rd Ed <https://www.packtpub.com/big-data-and-business-intelligence/apache-solr-enterprise-search-server-third-edition-raw>
This e-mail and all contents, including attachments, is considered to be Company Confidential unless explicitly stated otherwise, regardless of whether attachments are marked as such.
Re: property substitution in the solrconfig.xml
Posted by Shawn Heisey <ap...@elyograg.org>.
On 4/21/22 03:24, Stefan wrote:
> After setting all up like this and querying documents on the name field,
> the scores of the documents are wrong because the weight from the
> core.properties is used
> instead of the weight from the configoverlay.json.
As far as I am aware, the configoverlay.json file overrides settings in
solrconfig.xml, it doesn't override core.properties. I haven't actually
used the config-modifying API, so I do not know what settings are
possible in the config overlay.
Thanks,
Shawn