Bug 26221 - Advance Search under collection and shelving location problem
Summary: Advance Search under collection and shelving location problem
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching - Zebra (show other bugs)
Version: 20.05
Hardware: PC Linux
: P5 - low minor
Assignee: Bugs List
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-15 18:15 UTC by Vidya
Modified: 2021-06-14 21:29 UTC (History)
0 users

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vidya 2020-08-15 18:15:50 UTC
I Installed Debian 10 and Koha 20.05.
the site is available at: http://45.82.73.122
Everything works fine except Advance Search.
Problem- 1:
When I do a Advance Search in Collection for a subject, I get "0" result
and the search link is somethin like this: (limit=mc-itype%3AHIN)
http://45.82.73.122/cgi-bin/koha/opac-search.pl?advsearch=1&idx=kw&idx=kw&idx=kw&do=Search&limit=mc-ccode%3AHIN&sort_by=relevance

In the same link if I delete "mc-",  (limit=itype%3AHIN) I get all the results.

Problem-2:
If I do an Advance Search for Shelving Location the search result is "0".
The search link will be something like this: (mc-loc%3AZOR)
http://45.82.73.122/cgi-bin/koha/opac-search.pl?advsearch=1&idx=kw&idx=kw&idx=kw&do=Search&limit=mc-loc%3AZOR&sort_by=relevance

In this search url, if I change "mc-loc" to "location", I get the result.
http://45.82.73.122/cgi-bin/koha/opac-search.pl?advsearch=1&idx=kw&idx=kw&idx=kw&do=Search&limit=location%3AZOR&sort_by=relevance

Problem-3:
On the home page (left side) I added a " Subject Search Form. Here I defined each collection as <option value="ccode:GEN">General</option> 
On selection, the page changes and I get the correct result.
Conclusion:
1. mc-ccode is not working but ccode is working
2. mc-loc is not working but location is working.
Can anyone suggest a way to over come this?
Comment 1 Katrin Fischer 2020-08-16 07:37:37 UTC
I have made some tests on master and the searches for locations and collections work correctly there.

Do you have any customizations on the Zebra files or other Koha files?
Comment 2 Vidya 2020-08-16 13:38:35 UTC
No. I did not edit any Koha or Zebra files.
Comment 3 Vidya 2020-08-16 15:31:24 UTC
I have installed yaz-icu package for Indian language support.
I have edited /etc/koha/zebradb/etc/default.idx
#charmap word-phrase-utf.chr
icuchain words-icu.xml
again
#charmap word-phrase-utf.chr
icuchain phrases-icu.xml

When I indexed without enabling icuchain, Collection and Shelving location worked, but language search failed.
So the problem occurs only when yas-icu is enabled
Comment 4 Vidya 2020-08-16 17:45:21 UTC
It is not a bug in Koha. It happened because after installing yaz-icu, one need to do the following changes.
sudo apt-get install yaz-icu
go to : cd  /usr/share/idzebra-2.0/tab/
Copy the following 4 files to new location:
1. icu.idx
2. phrases-icu.xml
3. string.chr
4. words-icu.xml
cp icu.idx phrases-icu.xml string.chr words-icu.xml /etc/koha/zebradb/etc/
Edit default.idx and  comment charmap and add icuchain
sudo nano default.idx
Here I found only charmap string.chr so commented that in both places.
#charmap word-phrase-utf.chr
icuchain words-icu.xml
and 
#charmap word-phrase-utf.chr
icuchain phrases-icu.xml
Create a copy of words-icu.xml
cp /etc/koha/zebradb/etc/words-icu.xml /etc/koha/zebradb/etc/icu.xml
cd
sudo nano /etc/koha/zebradb/etc/icu.xml
change <icu_chain locale="en"> to <icu_chain locale="en_IN.UTF-8">
Give the admin rights by running following commands.
sudo chown -R library-koha:library-koha /etc/koha/zebradb/etc
sudo koha-zebra --restart <library instance name>
sudo koha-rebuild-zebra -v -f <library instance name>
Now I got everything working perfectly. In Advance Search,  I am able to do Collection and Shelving Location search and language search also.
Comment 5 Katrin Fischer 2020-08-16 21:11:57 UTC
Thank you for sharing your solution!