It'd be great if the Search Engine Config page in ES would document the various shortcuts available (ti for title, sn for local number, etc). Even better would be an interface to allow local creation of custom shortcuts. Maybe this could be a column added to the two mappings tabs to allow the definition of aliases? The hardcoded default aliases could be populated there in the default mapping?
I try to create code to at least display aliases in search fields table.
I propose a patch to display. So I change bug title. Allowing alias edition might be a lot of work so we should do it in another bug report.
Created attachment 113543 [details] [review] Bug 25054: Display search index aliases in Search Engine Configuration It'd be great if the Search Engine Configuration page would display the various aliases (shortcuts) available : ti for title, sn for local-number, etc. Patch changes Koha/SearchEngine/Elasticsearch/QueryBuilder.pm to move hard-coded vars at the beging and adds a method to provide to %index_field_convert via a method. Test plan : 1) Use Elasticsearch 2) Go to Administration > Search engine configuration (Elasticsearch) 3) Check you see new column 'Aliases' with for example ti for title. 4) Perform a search 'ti:<title>' and check you get results
Created attachment 113544 [details] [review] Bug 25054: Display search field aliases in Search Engine Configuration It'd be great if the Search Engine Configuration page would display the various aliases (shortcuts) available : ti for title, sn for local-number, etc. Patch changes Koha/SearchEngine/Elasticsearch/QueryBuilder.pm to move hard-coded vars at the beging and adds a method to provide to %index_field_convert via a method. Test plan : 1) Use Elasticsearch 2) Go to Administration > Search engine configuration (Elasticsearch) 3) Check you see new column 'Aliases' with for example ti for title. 4) Perform a search 'ti:<title>' and check you get results
replaces in bug title 'search index' by 'search field'.
I'm surprised by alias 'callnum' associate to 'local-classification' instead of 'Call-Number'. Is it really the link we're supposed to use ? Except that point, everything works fine !
(In reply to Séverine Queune from comment #6) > I'm surprised by alias 'callnum' associate to 'local-classification' instead > of 'Call-Number'. Is it really the link we're supposed to use ? > Except that point, everything works fine ! There is no field named 'Call-Number' in ES nor Zebra. In Zebra ccl.properties we also have : 'callnum' and 'lcn' aliases of 'Local-classification'
(In reply to Fridolin Somers from comment #7) > (In reply to Séverine Queune from comment #6) > > I'm surprised by alias 'callnum' associate to 'local-classification' instead > > of 'Call-Number'. Is it really the link we're supposed to use ? > > Except that point, everything works fine ! > > There is no field named 'Call-Number' in ES nor Zebra. > In Zebra ccl.properties we also have : > 'callnum' and 'lcn' aliases of 'Local-classification' Oups... Probably a local one... Sorry for that, I just need to sign it then !
Created attachment 113646 [details] [review] Bug 25054: Display search field aliases in Search Engine Configuration It'd be great if the Search Engine Configuration page would display the various aliases (shortcuts) available : ti for title, sn for local-number, etc. Patch changes Koha/SearchEngine/Elasticsearch/QueryBuilder.pm to move hard-coded vars at the beging and adds a method to provide to %index_field_convert via a method. Test plan : 1) Use Elasticsearch 2) Go to Administration > Search engine configuration (Elasticsearch) 3) Check you see new column 'Aliases' with for example ti for title. 4) Perform a search 'ti:<title>' and check you get results Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Created attachment 115099 [details] [review] Bug 25054: Display search field aliases in Search Engine Configuration It'd be great if the Search Engine Configuration page would display the various aliases (shortcuts) available : ti for title, sn for local-number, etc. Patch changes Koha/SearchEngine/Elasticsearch/QueryBuilder.pm to move hard-coded vars at the beging and adds a method to provide to %index_field_convert via a method. Test plan : 1) Use Elasticsearch 2) Go to Administration > Search engine configuration (Elasticsearch) 3) Check you see new column 'Aliases' with for example ti for title. 4) Perform a search 'ti:<title>' and check you get results Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 115100 [details] [review] Bug 25054: (QA follow-up) Add space after comma for multiple aliases Just a little formatting change to help readability by adding a space after comma: alias1, alias2, ...
This is the thing I constantly keep looking up. So I think this is quite helpful as a first step!
Pushed to master for 21.05, thanks to everybody involved!
Small enhancement, I choose to backport. Pushed to 20.11.x for 20.11.02
Is an enhancement and doesn't apply cleanly to 20.05. Not backporting, but please ask/rebase if needed.