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

Format Solr schema.xml using update-fields.sh on Linux #11135

Merged
merged 2 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/sphinx-guides/source/admin/metadatacustomization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ a necessary re-index, but for your custom metadata you will need to keep track o

Please note also that if you are going to make a pull request updating ``conf/solr/schema.xml`` with fields you have
added, you should first load all the custom metadata blocks in ``scripts/api/data/metadatablocks`` (including ones you
don't care about) to create a complete list of fields. (This might change in the future.)
don't care about) to create a complete list of fields. (This might change in the future.) Please see :ref:`update-solr-schema-dev` in the Developer Guide.

Reloading a Metadata Block
--------------------------
Expand Down
2 changes: 1 addition & 1 deletion doc/sphinx-guides/source/container/configbaker-image.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Scripts
- Default script when running container without parameters. Lists available scripts and details about them.
* - ``update-fields.sh``
- Update a Solr ``schema.xml`` with a given list of metadata fields. See ``update-fields.sh -h`` for usage details
and :ref:`update-solr-schema` for an example use case.
and example use cases at :ref:`update-solr-schema` and :ref:`update-solr-schema-dev`.

Solr Template
^^^^^^^^^^^^^
Expand Down
19 changes: 18 additions & 1 deletion doc/sphinx-guides/source/developers/tips.rst
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,24 @@ Solr

Once some Dataverse collections, datasets, and files have been created and indexed, you can experiment with searches directly from Solr at http://localhost:8983/solr/#/collection1/query and look at the JSON output of searches, such as this wildcard search: http://localhost:8983/solr/collection1/select?q=*%3A*&wt=json&indent=true . You can also get JSON output of static fields Solr knows about: http://localhost:8983/solr/collection1/schema/fields

You can simply double-click "start.jar" rather that running ``java -jar start.jar`` from the command line. Figuring out how to stop Solr after double-clicking it is an exercise for the reader.
You can simply double-click "start.jar" rather than running ``java -jar start.jar`` from the command line. Figuring out how to stop Solr after double-clicking it is an exercise for the reader.

.. _update-solr-schema-dev:

Updating the Solr Schema (Developers)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Both developers and sysadmins need to update the Solr schema from time to time. One difference is that developers will be committing changes to ``conf/solr/schema.xml`` in git. To prevent cross-platform differences in the git history, when running the ``update-fields.sh`` script, we ask all developers to run the script from within Docker. (See :doc:`/container/configbaker-image` for more on the image we'll use below.)

.. code-block::

curl http://localhost:8080/api/admin/index/solr/schema | docker run -i --rm -v ./docker-dev-volumes/solr/data:/var/solr gdcc/configbaker:unstable update-fields.sh /var/solr/data/collection1/conf/schema.xml

cp docker-dev-volumes/solr/data/data/collection1/conf/schema.xml conf/solr/schema.xml

At this point you can do a ``git diff`` and see if your changes make sense before committing.

Sysadmins are welcome to run ``update-fields.sh`` however they like. See :ref:`update-solr-schema` in the Admin Guide for details.

Git
---
Expand Down
Loading