[Koha-bugs] [Bug 11232] Retrieve facets from Zebra

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Apr 9 06:08:46 CEST 2014


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11232

--- Comment #36 from wajasu <matted-34813 at mypacks.net> ---
Created attachment 26911
  -->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=26911&action=edit
0001-Bug-11232-support-zebra-facet-queries-in-search.patch

Minimal support for zebra facet queries with indexes being made
available in the zidx fields added to the Koha::getFacets routine.

Search falls back to current implementation when facet query has
and error or no results.  This enables folks to roll out index
changes.  Currently supports the existing facets.

Test Plan:
1) Setup a working git clone dev install with a database with biblios
   (be sure to have your KOHA_CONF and PERL5LIB set.
   dom, icu
2) Run searches with current facet behavior
   (keeping browser tab for later reference)
   (use staff client to find some biblios and on the marc tab
    write down the biblionumber for later use.  get about 5 or more)
   (enable syspref for showing facet counters in staff client admin)
3) (Optional) Setup yaz-client for manual validation (on a console tab)
yaz-client unix:/home/koha/koha-dev/var/run/zebradb/bibliosocket
base biblios
form xml
elem zebra::facet::Author:0
f @attrset Bib-1 @attr 1=1016 @attr 4=6 @attr 5=1 "Ferguson, Sinclair B."
... some hits
s
(should show  results when thedesignated index Author:0 is specified)
elem
Subject-to:0,Subject-geo:0,Subject-ut:0,Author:0,Title-series:0,itype:0,location:0,holdingbranch:0
s
(should show  all facets results if all are configured )
4) Apply patch
5) cd to your chosen .../koha-dev/etc/zebradb/marc_defs/marc21/biblios (on
another console tab)
6) xsltproc ../../../xsl/koha-indexdefs-to-zebra.xsl biblio-koha-indexdefs.xml
> biblio-zebra-indexdefs.xsl
  (rerun this after changing biblio-koha-indexdefs.xml)
7) from kohaclone dir (setup this up in another console tab for steps 7 & 8)
   run  misc/migration_tools/rebuild_zebra.pl --where "biblionumber
        in (n1, n1, ...)" -b -r --run-as-root -v
     where n1 ... are the biblios you write down above.  (For a quick index
turnaround)
   Later for a full database rebuild, that will use the new
biblio-zebra-indexdefs.xsl
   from kohaclone dir run misc/migration_tools/rebuild_zebra.pl -a -b -r
--run-as-root -v
   (--run-as-root if needed)
8) zebrasrv -f /home/koha/koha-dev/etc/koha-conf.xml
   (can watch this on output and cut RPN queries for yaz if you desire)
9) use browser to search as you did in step 2 to see if you have
   larger counters (when you have a bigger database/result)
10) if facets are satisfactory, we pass.  please report anomalies.

You can edit the C4/Search.pm  line that defines  $element_set_all_indexes
and make adjustments removing selectively,save and then do a search to see
things fallback to the current code behavior.

Write now this patch demonstrates this strategy as a baby step for a release.

Things that need to be done:
- clean code (warnings, comments, long/bad var names, etc)
- add facet usage syspref detection (if needed)
- pubdate, and other desired additions (can be a future/followup enhancment)
- think about UTF-8 and check if diacritics etc show in facet term
- discuss naming of some added indexes  Subject-to vs su-to, Subject-geo vs
su-geo
- handle HideLostItems, and check if Suppress is handled.
- grs1 and other adjustments (if needed)
- future enhancment can: support syspref/editing of element_indexes_all
  and the order to display
- communicate the adjustment to biblio-koha-indexdefs.xml for upgrades
  to take advantage.
- if this patch strategy is acceptable, the UNIMARC and NORMARC facets
  can be worked on. fallback allows us to rollout.
- no restrictions on the total amount of facets are configured
  (Author:0:100 might be worth trying)
- facet consolidation for the presentation UI is the same but could
  return all results to the UI and let CSS hide/unhide.
  (another bug exists for this)

I did NYTProf, but others can and suggest performance enhancements.
When zebra facet indexes are available no marc records are being read etc,
as of now, unless things fallback.

Note: Title-series:0  seemed to not show a 490a in a certain case where I
had 10 results with a certain resultset.  Weird, but me might just
decide to fallback for that index if its an issue.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list