In Elasticsearch fields config field_config.yaml, default type as a field 'ci_raw'. This is used for exact search. This field is missing for type standard number 'stdno'.
One can see here the call with ci_raw https://git.koha-community.org/Koha-community/Koha/src/commit/2f583efa5b399dee241cdb128d0e849b432314b6/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm#L400
Created attachment 141403 [details] [review] Bug 31695: Type standard number is missing field ci_raw in field_config.yaml In Elasticsearch fields config field_config.yaml, default type as a field 'ci_raw'. This is used for exact search. This field is missing for type standard number 'stdno'. Test plan : 1) Use Elasticsearch search engine 2) For authorities, configure a search field with type 'standard number' 3) Go to authorities search 4) Perform a search on an existing value, with 'contains' => Result is found with or without patch 5) Perform a search on an existing value, with 'is exactly' => Result is found only with patch
I'm not sure how to do step 2 - happy to test if you can show how to do that.
(In reply to David Nind from comment #3) > I'm not sure how to do step 2 - happy to test if you can show how to do that. I mean in Administration > Search engine configuration (Elasticsearch) In tab Search fields, choose a field and change its type to "Std. Number". For example "identifier-standard" is already of this type. In tab Authorities use this search field on some MARC field. Rebuild authorities index. And create of edit an authority with this MARC field.
Created attachment 149228 [details] [review] Bug 31695: Type standard number is missing field ci_raw in field_config.yaml In Elasticsearch fields config field_config.yaml, default type as a field 'ci_raw'. This is used for exact search. This field is missing for type standard number 'stdno'. Test plan : 1) Use Elasticsearch search engine 2) For authorities, configure a search field with type 'standard number' 3) Go to authorities search 4) Perform a search on an existing value, with 'contains' => Result is found with or without patch 5) Perform a search on an existing value, with 'is exactly' => Result is found only with patch Signed-off-by: Kevin Carnes <kevin.carnes@ub.lu.se>
Created attachment 149231 [details] [review] Bug 31695: Type standard number is missing field ci_raw in field_config.yaml In Elasticsearch fields config field_config.yaml, default type as a field 'ci_raw'. This is used for exact search. This field is missing for type standard number 'stdno'. Test plan : 1) Use Elasticsearch search engine 2) For authorities, configure a search field with type 'standard number' 3) Go to authorities search 4) Perform a search on an existing value, with 'contains' => Result is found with or without patch 5) Perform a search on an existing value, with 'is exactly' => Result is found only with patch Signed-off-by: Kevin Carnes <kevin.carnes@ub.lu.se>
Hi Frido or Kevin, can you please update/detail the test plan a little? What I tried without the patch: * Add 035$a to an authority record with 12345678 * Search for it in staff: entire record, contains = it's found * Search for it in staff: entire record, is exactly = it's found There is no standard number option in the index pull down for authorities.
Created attachment 149583 [details] [review] Bug 31695: Type standard number is missing field ci_raw in field_config.yaml In Elasticsearch fields config field_config.yaml, default type as a field 'ci_raw'. This is used for exact search. This field is missing for type standard number 'stdno'. Test plan : 1) In the staff interface, go to Administration, and search for SearchEngine 2) Make sure that the SearchEngine preference is set to Elasticsearch and save 3) Return to Administration and select "Search engine configuration" 4) Change the type of "Heading-Main" to "Std. Number" and save 5) Rebuild the index (e.g. "koha-elasticsearch --rebuild -d kohadev") 6) Go to the main staff page and select Authorities 7) Search for a heading (e.g. "A Dual-language book") => Result is found with or without patch 8) Click on the sliders and select "is exactly" for the operator and search => Result is found only with patch 9) Apply the patch 10) Rebuild the index (e.g. "koha-elasticsearch --rebuild -d kohadev") 11) Click on the sliders and select "is exactly" for the operator and search => Result is found only with patch Signed-off-by: Kevin Carnes <kevin.carnes@ub.lu.se>
Created attachment 149642 [details] [review] Bug 31695: Type standard number is missing field ci_raw in field_config.yaml In Elasticsearch fields config field_config.yaml, default type as a field 'ci_raw'. This is used for exact search. This field is missing for type standard number 'stdno'. Test plan : 1) In the staff interface, go to Administration, and search for SearchEngine 2) Make sure that the SearchEngine preference is set to Elasticsearch and save 3) Return to Administration and select "Search engine configuration" 4) Change the type of "Heading-Main" to "Std. Number" and save 5) Rebuild the index (e.g. "koha-elasticsearch --rebuild -d kohadev") 6) Go to the main staff page and select Authorities 7) Search for a heading (e.g. "A Dual-language book") => Result is found with or without patch 8) Click on the sliders and select "is exactly" for the operator and search => Result is found only with patch 9) Apply the patch 10) Rebuild the index (e.g. "koha-elasticsearch --rebuild -d kohadev") 11) Click on the sliders and select "is exactly" for the operator and search => Result is found only with patch Signed-off-by: Kevin Carnes <kevin.carnes@ub.lu.se> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Pushed to master for 23.05. Nice work everyone, thanks!
Nice work everyone! Pushed to stable for 22.11.x
Backported to 22.05.x for upcoming 22.05.13.
applied to 21.11 for 21.11.21