Bug 25054 - Display search field aliases in search engine configuration
Summary: Display search field aliases in search engine configuration
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching - Elasticsearch (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Fridolin Somers
QA Contact:
URL:
Keywords: Manual
Depends on:
Blocks:
 
Reported: 2020-04-03 18:58 UTC by Andrew Fuerste-Henry
Modified: 2022-06-06 20:24 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This adds a new column aliases to the search fields tabs of the search engine configuration table. The aliases table shows the abbreviated and alternative index names available for each defined index.
Version(s) released in:
21.05.00,20.11.02


Attachments
Bug 25054: Display search index aliases in Search Engine Configuration (10.78 KB, patch)
2020-11-12 09:18 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 25054: Display search field aliases in Search Engine Configuration (10.78 KB, patch)
2020-11-12 09:20 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 25054: Display search field aliases in Search Engine Configuration (10.85 KB, patch)
2020-11-15 15:10 UTC, Séverine Queune
Details | Diff | Splinter Review
Bug 25054: Display search field aliases in Search Engine Configuration (10.92 KB, patch)
2021-01-12 21:55 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 25054: (QA follow-up) Add space after comma for multiple aliases (1.25 KB, patch)
2021-01-12 21:55 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Fuerste-Henry 2020-04-03 18:58:13 UTC
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?
Comment 1 Fridolin Somers 2020-11-12 08:35:48 UTC
I try to create code to at least display aliases in search fields table.
Comment 2 Fridolin Somers 2020-11-12 09:09:43 UTC
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.
Comment 3 Fridolin Somers 2020-11-12 09:18:05 UTC
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
Comment 4 Fridolin Somers 2020-11-12 09:20:06 UTC
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
Comment 5 Fridolin Somers 2020-11-12 09:30:39 UTC
replaces in bug title 'search index' by 'search field'.
Comment 6 Séverine Queune 2020-11-13 12:30:30 UTC
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 !
Comment 7 Fridolin Somers 2020-11-13 15:28:11 UTC
(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'
Comment 8 Séverine Queune 2020-11-13 15:30:23 UTC
(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 !
Comment 9 Séverine Queune 2020-11-15 15:10:36 UTC
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>
Comment 10 Katrin Fischer 2021-01-12 21:55:09 UTC
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>
Comment 11 Katrin Fischer 2021-01-12 21:55:12 UTC
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, ...
Comment 12 Katrin Fischer 2021-01-12 21:55:58 UTC
This is the thing I constantly keep looking up. So I think this is quite helpful as a first step!
Comment 13 Jonathan Druart 2021-01-14 13:04:33 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 14 Fridolin Somers 2021-01-18 15:21:46 UTC
Small enhancement, I choose to backport.

Pushed to 20.11.x for 20.11.02
Comment 15 Andrew Fuerste-Henry 2021-01-29 16:14:36 UTC
Is an enhancement and doesn't apply cleanly to 20.05. Not backporting, but please ask/rebase if needed.