To reproduce: - Have zebrasrv running with the default configuration - Enable the public server - Point your browser to http://localhost:9998 (or whatever port you have for the public server) => FAIL: you will notice Caveat: (extracted from the zebrasrv docs) "Unfortunately, the data found in the CQL-to-PQF text file must be added by hand-craft into the explain section of the YAZ Frontend Server configuration file to be able to provide a suitable explain record. Too bad, but this is all extreme new alpha stuff, and a lot of work has yet to be done .."
Any ideas on how this could/should be done? I am toying with the idea of a command line script that could read pqf.properties and koha-conf.xml and generate correct Explain documents.
(In reply to Magnus Enger from comment #1) > Any ideas on how this could/should be done? I am toying with the idea of a > command line script that could read pqf.properties and koha-conf.xml and > generate correct Explain documents. I think it needs to be done as you propose it. It'd be awesome :-D
magnuse++
IndexData talk about doing it the otherway around, generating the mapping from the Explain doc. Guess that is not feasible for us... http://www.indexdata.com/metaproxy/doc/ref-cql_rpn.html
I think there also needs to be one explain document per instance (in a package install), since different instances can/will have SRU running on different ports. Working on the command line script to generate Explain now.
Created attachment 60732 [details] [review] Bug 12836 - Add script to rewrite SRU Explain file The standard SRU Explain file provided with Koha is static and out of date. This patch adds a script in misc/maintenance/generate_explain.pl that can generate a new Explain file, based on Koha's config files and an optional extra config file. See the POD in the script for more details. This is a preview, NOT READY FOR SIGNOFF.
Preview patch attached. Early opinions very welcome! TODO: - I will try to do some more work on the configInfo section. - This is only for biblios, authorities need some attention too, perhaps Question: What should we do about the old etc/zebradb/explain-biblios.xml? Delete it and make running the new script mandatory for those who want to enable SRU? Or provide some default etc/zebradb/explain-biblios.xml, based on the default settings in Koha? Guess the latter makes sense?
(In reply to Magnus Enger from comment #7) > Preview patch attached. Early opinions very welcome! > > TODO: > - I will try to do some more work on the configInfo section. > - This is only for biblios, authorities need some attention too, perhaps > > Question: > What should we do about the old etc/zebradb/explain-biblios.xml? Delete it > and make running the new script mandatory for those who want to enable SRU? > Or provide some default etc/zebradb/explain-biblios.xml, based on the > default settings in Koha? Guess the latter makes sense? Interesting ! Providing a default explain for the default settings makes a lot of sense.
Created attachment 60791 [details] [review] Bug 12836 - Add script to rewrite SRU Explain file The standard SRU Explain files provided with Koha is static and out of date. This patch does two things - Add a script in misc/maintenance/generate_explain.pl that can generate a new Explain file, based on Koha's config files and an optional extra config file. See the POD in the script for more details. - Replace the old Explain files provided with Koha with two new files, generated by the script described above and based on the standard Koha/Zebra config. To test: - Have a look at etc/zebradb/explain-authorities.xml and etc/zebradb/explain-biblios.xml and see if they make sense as example files. Check that the list of indexes corresponds to the indexes set up in etc/zebradb/pqf.properties. - Run "perldoc misc/maintenance/generate_explain.pl" to see available options and a decription of the config file. - Run generate_explain.pl with different options and settings in the config file, and check that the output Explain docs make sense. This patch will not break anything. It is more about documentation. The Explain file documents the SRU server, it does not configure it.
My patch does not take into account the need for per-instance Explain docs. That will have to be a separate bug.
There is a lot of output running this from inside the koha-shell as 'perl misc/maintanence/generate_explain.pl' Looking at /etc/koha/sites/kohadev/koha-conf.xml Use of uninitialized value $publicserver in split at misc/maintenance/generate_explain.pl line 216. Use of uninitialized value $host in concatenation (.) or string at misc/maintenance/generate_explain.pl line 217. Use of uninitialized value $port in concatenation (.) or string at misc/maintenance/generate_explain.pl line 217. SRU is listening on host and port Use of uninitialized value $pqf_properties_file in concatenation (.) or string at misc/maintenance/generate_explain.pl line 221. Looking at Use of uninitialized value $file_name in -e at /usr/share/perl5/File/Slurp.pm line 116. Use of uninitialized value $file_name in sysopen at /usr/share/perl5/File/Slurp.pm line 193. Use of uninitialized value $file_name in concatenation (.) or string at /usr/share/perl5/File/Slurp.pm line 194. read_file '' - sysopen: No such file or directory at misc/maintenance/generate_explain.pl line 225. Am I missing something?
I've still on luck testing this. I think it might be missing -x -rwxrwxr-x 1 vagrant vagrant 4414 Dec 13 2016 fix_mysql_constraints.pl -rw-r--r-- 1 vagrant vagrant 8796 Oct 15 2017 generate_explain.pl I also get a lot of errors running it from the command line: kohadev-koha@kohadevbox:/home/vagrant/kohaclone$ perl misc/maintenance/generate_explain.pl Use of uninitialized value $publicserver in split at misc/maintenance/generate_explain.pl line 216. Use of uninitialized value $file_name in -e at /usr/share/perl5/File/Slurp.pm line 116. Use of uninitialized value $file_name in sysopen at /usr/share/perl5/File/Slurp.pm line 193. Use of uninitialized value $file_name in concatenation (.) or string at /usr/share/perl5/File/Slurp.pm line 194. read_file '' - sysopen: No such file or directory at misc/maintenance/generate_explain.pl line 225. Magnuse, can you please take a look and add some more instructions if necessary?