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

support for Solr-8.x (--reload-core raises org.apache.solr.core.SolrResourceNotFoundException) (story currency.xml NOT found & elevate.xml NOT found) #1827

Open
8lurry opened this issue Dec 13, 2021 · 2 comments

Comments

@8lurry
Copy link

8lurry commented Dec 13, 2021

Running an Standalone solr core on Solr-8.11.0 and trying to do::

$ python manage.py build_solr_schema --configure-directory="$SOLR_HOME/my_core/conf" --reload-core=my_core

initially raises:

org.apache.solr.core.SolrResourceNotFoundException

looking at the trace I found out that solr asks for currency.xml
looking at the source code, I blame the following line of code:

<fieldType name="currency" class="solr.CurrencyField" precisionStep="8" defaultCurrency="USD" currencyConfig="currency.xml" />

after commenting out (NOT a solution but works for triages) line 211 & 625 from schema.xml template and retrying the::

$ python manage.py build_solr_schema --configure-directory="$SOLR_HOME/my_core/conf" --reload-core=my_core

raises:

org.apache.solr.handler.component.QueryElevationComponent$InitializationException

looking at the trace, I found out that solr looks for elevate.xml
looking at the source code, I blame the code block starting from here:

<searchComponent name="elevator" class="solr.QueryElevationComponent" >
to line 1085,
after commenting out (NOT a solution but works for triages) this code-block from solrconfig.xml template, Solr reloads without complaining.

How do we want to fix this?

PS: solr-cloud has completely different structure (zookeeper and all) and is NOT a concern of this issue.

@spapas
Copy link

spapas commented Nov 29, 2022

Both currency.xml and elevate.xml are here: solr-8.11.2\example\example-DIH\solr\solr\conf

@DhavalGojiya
Copy link

DhavalGojiya commented Apr 23, 2024

Why this Issue :

This issue has been created due to specific requirements in the your solr core configuration files:

  1. schema.xml Dependency: The presence of the declaration in the schema.xml file necessitates the existence of the currency.xml configuration file. This declaration indicates the use of a custom field type named "currency" with specific attributes such as precision step, default currency, and a reference to the currency.xml configuration. See the line of code below, which exists in the schema.xml file:

    <fieldType name="currency" class="solr.CurrencyField" precisionStep="8" defaultCurrency="USD" currencyConfig="currency.xml" />

  2. solrconfig.xml Dependency: Additionally, the solrconfig.xml file includes a configuration for the QueryElevationComponent search component named "elevator". This component is crucial for elevating certain search results and requires proper configuration to function correctly. See the line of code below, which exists in the solrconfig.xml file:

    <searchComponent name="elevator" class="solr.QueryElevationComponent" >

Solution 1 (Not recommended) :

  1. In the schema.xml file:
    Comment out the displayed line <fieldType **** of code.
  2. In the solrconfig.xml file:
    Comment out the displayed line <searchComponent **** of code.

Solution 2 :

When you create first time core in your machine, Use this command:

./solr create_core -c <CORE_NAME> -d sample_techproducts_configs

This command configures the core with advanced configsets, resulting in the 'conf' folder containing both 'elevate.xml' and 'currency.xml' files.

Solution 3 :

If your core is already created and has been indexed with a significant amount of data, creating a new core from scratch may not be desirable. In such cases, navigate to the 'configsets' folder within your Solr installation directory. The path may vary depending on the version of Solr installed.

An example of the path structure is as follows:

/solr-8.9.0/server/solr/configsets/sample_techproducts_configs/conf

From this 'conf' folder within the 'configsets', simply copy the 'elevate.xml' and 'currency.xml' files and paste them into the 'conf/' directory of your core.

For instance, if your core resides at:

/solr-8.9.0/server/solr/<YOUR_CORE>/conf/

Paste the files into this location.

These steps ensure that your existing core is equipped with the necessary configurations without the need to recreate it from scratch.

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

3 participants