Bug 20389 - Indexing fields concatenated
Summary: Indexing fields concatenated
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching - Elasticsearch (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Bugs List
QA Contact:
Depends on:
Reported: 2018-03-13 14:49 UTC by claire.hernandez@biblibre.com
Modified: 2019-11-04 10:30 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Note You need to log in before you can comment on or make changes to this bug.
Description claire.hernandez@biblibre.com 2018-03-13 14:49:20 UTC
I would like to be able to specify multiple subfields to index as a value in a field. The subfields must be concatenated.

Example 1:

Author in unimarc in an authority:
700  1 $a Bermès $b Emmanuelle

I could record a fields in mappings:
author: "700a. .700b"

I would have in the field indexed:
author: "Emmanuelle Bermès"

Example 2:

in mappings:
author: "700b., .700a"
would give: 
author "Bermès, Emmanuelle"

With solr, we managed it with indexing plugins. If it is too early for this, we could manage it in mappings configuration maybe.
Comment 1 Katrin Fischer 2018-03-13 15:30:36 UTC
Might also be interesting for other use cases. Maybe a full title for sorting? MARC21: 245$a$b$n$p
Comment 2 Nicolas Legrand 2018-09-07 13:22:24 UTC
We just learned the hard way we will also need this :).
Comment 3 Alex Arnaud 2018-09-13 12:08:03 UTC
Any thoughts here about creating an index plugin system:

Currently we use Catmendu::* libraries to transform data. If i'm not wrong, we only can do that by using "Fixes" (a fix language) like:

marc_map(245ac, title)

We give these fixes at Catemdu that process the job itself.
This means that plugins should be written with this fix language too.

A second thing: there is a work on bug 19893 to replace these libraries and create some koha-specific code. So the plugin system should be designed differently in this case.
Comment 4 Joonas Kylmälä 2018-11-19 15:28:23 UTC
You should be able to concatenate the search fields (e.g. 245a$b$n as bug 19893 is now pushed to master. However, I don't think it supports adding commas between the MARC fields.
Comment 5 Séverine Queune 2019-10-01 13:14:28 UTC
Just tried in master : concatenation works fine using parenthesis : 700(ab)
Comment 6 Katrin Fischer 2019-10-14 21:51:31 UTC
(In reply to Séverine Queune from comment #5)
> Just tried in master : concatenation works fine using parenthesis : 700(ab)

Hi Claire, does this solve the problem?
Comment 7 claire.hernandez@biblibre.com 2019-11-04 10:30:11 UTC
I think yes, thank you.