Ett 1788 solr fields - #248
Conversation
… parameterization)
aelkiss
left a comment
There was a problem hiding this comment.
Queries are working locally for me with solr 9; I haven't tested locally with solr 6 yet.
I also still want to look some at the question of tests here.
I have some questions about some of the duplicated files, but the bigger question is when is the right time to try to disable interleave (A vs B) for solr 9 -- do we try to do that now, or do we wait until later? On the one hand, it may require fewer changes to keep it with interleave enabled than if we try to disable it. On the other, there are already some some workarounds here to make it work despite not having two different cores; this PR adds some additional workarounds, and I don't think we want to continue those workarounds indefinitely.
|
|
||
| side_by_side =0 | ||
| use_B_query= 0 | ||
| use_interleave=1 |
There was a problem hiding this comment.
Does it make sense to try to turn off interleave entirely for solr 9, since we don't have a separate core-y set up there?
There was a problem hiding this comment.
If use_interleave=1 works to disable interleave for solr9, that is something we should check
| interleaver_class = LS::Interleaver::Balanced | ||
| #interleaver_class = LS::Interleaver::AA | ||
|
|
||
| # Note that code does not read A_core_name to get default core name. The default core name and paths to solr are configured in mdp-lib/Config/uber.conf. |
There was a problem hiding this comment.
Is it worth trying to remove the A vs B stuff for solr 9 at this point, or does that introduce additional complications?
There was a problem hiding this comment.
Currently, it introduces some extra complications because we need to make sure each change works well with both Solr 6 and Solr 9. I believe it's much better to make one change at a time, step by step, to keep things manageable and clear.
There was a problem hiding this comment.
As far as I can tell, this isn't used; we should remove.
There was a problem hiding this comment.
Yes, that file could be removed.
There was a problem hiding this comment.
As far as I can tell this isn't used any more either; @carylwyatt could confirm. We could probably remove all instances of js_css_filelist.txt in the babel repo as well as mdp-misc/scripts/make_common and mdp-misc/scripts/make_concat. (Not on this PR, but we should at least avoid duplicating js_css_filelist.txt under solr9)
There was a problem hiding this comment.
Let's create a task to remove these specific files
There was a problem hiding this comment.
Do we need additional copies of the files under solr9 when they are the same as in the base Config directory (i.e. will they be found?). I think this is the case at least for langformat.yaml and bindings.pl.
If we do need them under solr9, does it make sense to make a symlink into the parent Config directory for them, rather than copying?
There was a problem hiding this comment.
We might consider setting up a symlink; however, this method creates dependencies between Solr 6 and Solr 9 config files, so it’s important to keep track of these details in our documentation. Duplicating the files can also make the transition smoother when we’re ready to retire Solr 6, since it allows us to safely delete the folder when the time comes.
There was a problem hiding this comment.
Note that Solr9/facetconfig.pl is still reading the original copy (edit: and Eugene has already pointed that out in a comment):
my $lang_format_file = $ENV{SDRROOT} . '/ls/lib/Config/langformat.yaml';
If we don't intend to use the Solr9 copy then that's argument for not having it. I would expect that data to be invariant no matter which Solr we are using.
|
Config is duplicated across two trees (ls/lib/Config and .../solr9) instead of one source with overrides. It may be causing a drift, such as sdrnum missing from the solr9 copy. It's worth thinking about consolidating them, it's not a priority/blocker, just a thought. |
| - [author2, 50] | ||
| - [issn, 1] | ||
| - [isbn, 1] | ||
| - [oclc, 1] |
There was a problem hiding this comment.
Looks like [sdrnum, 1] is missing here, should it be added back?
| healthcheck: | ||
| <<: *healthcheck-defaults | ||
| test: [ "CMD-SHELL", "curl -s -u admin:solrRocks 'http://solr-lss-dev-solr9:8983/solr/admin/collections?action=CLUSTERSTATUS&collection=core-x' | grep -q '\"state\":\"active\"'" ] | ||
| test: [ "CMD-SHELL", "curl -s -u admin:solrRocks 'http://solr-lss-dev-solr9:8983/admin/collections?action=CLUSTERSTATUS&collection=core-x' | grep -q '\"state\":\"active\"'" ] |
There was a problem hiding this comment.
Is the url correct? It changed from /solr/admin/collections to /admin/collections
There was a problem hiding this comment.
Yes, this seems to be an error, /admin/collections just gives a 404 and the health check fails.
| #my $rel_weights_file_A = $ENV{SDRROOT} . '/ls/lib/Config/dismax_A.yaml'; | ||
| #my $rel_weights_file_B = $ENV{SDRROOT} . '/ls/lib/Config/dismax_B.yaml'; | ||
|
|
||
| my $lang_format_file = $ENV{SDRROOT} . '/ls/lib/Config/langformat.yaml'; |
There was a problem hiding this comment.
Should this be using the new ls_config_dir variable?
| $C->set_object('MdpConfig', $config); | ||
|
|
||
| # additional configuration for click_logging and A/B testing | ||
| my $AB_test_config_filename = $ENV{SDRROOT} . '/ls/lib/Config/AB_test_config'; |
There was a problem hiding this comment.
Should this be using the new ls_config_dir variable?
There was a problem hiding this comment.
Yes, we can use the ls_config_dir here.
| volumes: | ||
| - solr1_data:/var/solr | ||
| command: [ "sh", "-c", "solr-foreground & sleep 150 && export SOLR_AUTHENTICATION_OPTS=-Dbasicauth=admin:solrRocks && solr create_collection -d /opt/solr/core-x -c core-x -shards 1 -replicationFactor 1 -p 8983 && wait" ] | ||
| command: [ "sh", "-c", "solr-foreground & sleep 150 && export SOLR_AUTHENTICATION_OPTS=-Dbasicauth=admin:solrRocks && solr create_collection -d /opt/solr/core-x -c core-x -shards 1 --replicationFactor 1 -p 8983 && wait" ] |
There was a problem hiding this comment.
Not sure where we are tracking the issue of the collection already existing, but I would recommend instead doing something like solr-foreground && create-collection-if-needed where create-collection-if-needed is a bash script that:
- waits until solr is up and responsive (polling perhaps every 5-10 seconds)
- checking if the core-x collection already exists
- if not, creating it
Let's try disabling the interleave test for Solr 9 later; it should be an optimization, probably in the user stories related to measuring relevance results. Right now, the focus is ensuring we can run queries on Solr 9 and Solr 6 in the production environment. I'll create a task to disable interleave. In this PR, I kept the interleave but pointed to only |
I have duplicated the Config folders because some fields used in Solr 6 have been removed from Solr 9. |
| }; | ||
| }; | ||
|
|
||
| subtest 'solr9 facetconfig has incompatible fields removed' => sub { |
There was a problem hiding this comment.
Good to have these tests. They don't really belong here though. Really this is testing a component of FacetConfig.pm (which I will rant about a little bit later) so I would create a file ls/t/LS/FacetConfig.t and populate it with
use strict;
use warnings;
use Test::More;
<this subtest>
done_testing();
Then restore this file to its original state.
| my $rel_weights_A = get_rel_weights_from_yaml($A_yaml_file_name); | ||
| my $rel_weights_B = get_rel_weights_from_yaml($B_yaml_file_name); | ||
| my $rel_weights_A = get_rel_weights_from_yaml($C, $A_yaml_file_name); |
There was a problem hiding this comment.
This module would be relatively easy to get fully under test, especially since this PR introduces tests that are at least adjacent. This module really isn't about much other than being glue. The eval on facetconfig.pl is awful. I would suggest a follow-up task to get everything here fully tested as a prelude to refactoring.
This PR is about the Jira ticket
The main goal was to split Solr 6/Solr 9 config files because Solr 9's schema removed the fields
ctrlnum, fulgeographic, fullgenre, and hlb3, documentation hereThe solution was to add
ls/lib/Config/solr9/as a copy ofls/lib/Config/and remove the fields from there. The folderls/lib/Config/is untouched and is the default configuration to start Babel accessing to Solr 6.A new
ls_config_dirconfig key has been defined. By default,LSS_CONFIG_DIR=ls/lib/Configand letsls/cgi/lsandLS::FacetConfig::get_rel_weights_from_yamlpick the right directory instead of hardcodingls/lib/Config. To connect to Solr9, the Compose profile LSS_CONFIG_DIR was defined inapache.yml/perl.yml.I've updated the
README.mdfile with the commands to run against Solr 9, addingLSS_CONFIG_DIR.I've tested these changes on both Solr 6 and Solr 9, and I get results. I'll listed the commands below, so you can reproduce them locally.
Testing Babel + Solr 6
Testing Babel + Solr 9
In
Solr 9, you should index the sample data on the server. The process for indexing data is explained here. I've tested it, and it works, but you will need to clone thelss_solr_configsrepository to your machine and follow the steps to run the scriptindexing_data.sh.If in the service
solr-lss-dev-solr9(docker logs solr-lss-dev-solr9) you see the errorCould not create a new core in /var/solr/data/core-x_shard1_replica_n1as another core is already defined there. This happens because the persist volumesbabel_solr1_dataandbabel_zoo1_dataexist from a previous run, and the create_collection call collided with the leftover directory. There is a Jira ticket to fix this problemTemporary solution: --> I'll create a task to fix this issue.
Following up on this ticket, it's a good time to start thinking about testing. Let's consider how we can verify that the existing LS tests cover both Solr 6 and Solr 9, and whether we might need to add any extra unit tests. Of course, this will be part of a different task and epic. Please feel free to add any additional tickets that came up during your review of this PR and that you think we should work on.
I've created some tests with Claude support on
ls/t/LS/Query/Facets.t