[Koha] Let's fix it together!

Jared Camins-Esakov jcamins at cpbibliography.com
Wed Jul 25 00:00:46 NZST 2012


Daniel,

I don't know if this is within the scope of the project, but as an
> example of a search that doesn't work, last year I spent a lot of time
> & effort failing to come up with a search query that would show all
> new titles at a branch.
>
> I constructed a CCL query I thought would return biblios having at
> least one item with both a given branch and an acquisition date in the
> last 30 days. But among the search results was a biblio with two
> items, one at the desired branch but acquired more than 30 days ago,
> and one acquired in the last 30 days but at a different branch.
>
> Galen ultimately confirmed for me that you can't query for an item
> that meets two conditions, as CCL queries extend across the whole
> biblio--if one item in a biblio meets one of the conditions and
> another item meets the other condition, the biblio is returned.
>

There are two issues going on with this search. The first is the indexing
configuration which is not part of the proposal. The second is the query
syntax. If we fixed the indexing (which wouldn't be too hard), writing a
search that took advantage of the composed index would still be highly
problematic. In fact, I think the only way to do it right now would be to
use PQF to do a regular expression search to find all books added at a
branch in the last two months. I'm making up a new composed index that
consists of "branch|acquisition date," and may be putting some of the terms
in the wrong order but here's an example of what I mean:
pqf=@attr 3=1 @attr 5=102 @attr 2=3 @attr 1=9952 "branch|20120[67]"

You could try the following, as well, though I wouldn't really recommend it:
ccl=itemacq,regexp-1,first-in-field:branch|20120[67]

I'm sure a similar search would be possible in Solr, as well, but it would
not be portable. Once you figured how how to do the search in Zebra, you
would have to start all over again if you decided to switch to Solr or vice
versa. In contrast, if we parsed queries ourselves, that search could be:
itemacq like "^branch|20120[67]"

(and it would work in both search engines)

You could also, of course, just use the PQF search and it would be
translated into something that Solr could understand.

Hope that helps clarify.

Regards,
Jared

-- 
Jared Camins-Esakov
Bibliographer, C & P Bibliography Services, LLC
(phone) +1 (917) 727-3445
(e-mail) jcamins at cpbibliography.com
(web) http://www.cpbibliography.com/


More information about the Koha mailing list