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

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Mar 20 05:25:09 CET 2014


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

--- Comment #19 from David Cook <dcook at prosentient.com.au> ---
IMPORTANT CONFIGURATION UPDATE:

So I was wrong before about the need to define "zebra::facet::field:type" style
retrieval elements within retrievalinfo.

In fact, we just need to add one "retrieval" element to the bottom of the
config before the closing </retrievalinfo> tag, and it is this:

<retrieval syntax="xml"/>

YAY!!!

This means that we don't have to individually define every single facet index.
This means that facets could be highly flexible!

--

The solution became apparent after consulting the following documents:

http://lists.indexdata.dk/pipermail/zebralist/2009-June/002251.html

http://www.indexdata.com/yaz/doc/tools.retrieval.html

http://lists.indexdata.dk/pipermail/zebralist/2012-May/002536.html

Hdl stated "if I enable multiple retrieval facilities (MODS, XML, DC etc...),
then zebra::meta and zebra::facet seems to be
disabled ([25]". 

So, I looked into the Zebralist a bit and noticed someone who "wanted" to block
the Zebra Special Retrieval Elements (such as zebra::meta and zebra::facet). 

Adam from Indexdata said, "There is no to disable it as such. But you can use
the retrieval facility of YAZ to specify valid element set names + formats."

So I looked into the retrieval facility a bit more...and noticed that the
"name" attribute of the "retrieval" node was optional. If you used it, you
could specify a single element. 

However, what happens if you remove the name completely? What if you make the
"retrieval" element less restrictive?

It turns out that you re-gain access to those Zebra Special Retrieval Elements,
which we were excluding because our configuration was too restrictive!

I'm placing my updated guide to the bottom of this bug. 

I have a few more notes before that though:

First, I should mention that using something like "zebra::facet::Title:0" won't
work, unless you're indexing strings with a type of "0" in record.abs or the
DOM equivalent (which I can't recall at the moment). At least, that's my best
guess. I've seen Paul Poulain use something like "zebra::facet::Title:0" and it
worked with Arabic, so I assume they were indexing with the type 0 in their
indexing config.

Second, you have to use actual indexes for facets. You can't use the CCL
short-hand like "ti". Also, capitals matter. In my previous examples, I said
you could use "title", but I should've checked first as it's actually "Title". 

Third, chaining indexes and types (e.g. "zebra::facet::f1:t1,f2:t2,.." as noted
in the Indexdata config) will now work, while it wouldn't when defining facets
individually.

--

Updated Guide

1) Check your koha-conf.xml and check for where your <retrievalinfo> is
defined. It should be based on an <xi:include>. If you're using packages, it'll
probably be something like "marc21-retrieval-info-bib-dom.xml" (depending on
your marc flavour and indexing filter).

2) Add the line "<retrieval syntax="xml"/>" at the bottom of the document
before the closing </retrievalinfo> tag. 

3) Restart Zebra (using koha-reset-zebra with the packages or manually
otherwise)

4) yaz-client [unix socket defined in koha-conf.xml]

base biblios
format xml
elements zebra::facet::Title:w,Author:w,itype:w
find test
show

--

You should be presented with a facet list for "Title", "Author", and "Itype". 

I'm currently not sure about the meaning of "coccur" (co-occurrence?) but
"occur" is the number of times the term shows up in the search results.

--

Cool, eh?

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


More information about the Koha-bugs mailing list