[Yazlist] Metaproxy sort filter

Tim Thompson timathom at gmail.com
Fri Oct 2 03:46:56 UTC 2015


Thanks, I updated Metaproxy, and the sort filter is working now, with a
couple of exceptions. I am only passing through MARCXML, but I have three
different routes defined for different virtual DB configurations. If I
place the sort filter inside my "default" or "utf8" routes, it seems to
work fine if I query their associated databases independently. But is it
possible to sort the entire result set, from all routes together? (See
routes below.)

Also, if I move the sort filter inside the "oclc" route and try to query
one of its databases, then in my MARCXML results, all of the 005 values are
set to the current time (e.g., "20151001233024.0"). I'm guessing this has
something to do with the "FD" USMARC syntax in that route?

--Tim


    <route id="default">
      <filter type="sort">
        <sort xpath="/marc:record/marc:controlfield[@tag = '005']"
namespaces="marc=http://www.loc.gov/MARC21/slim" prefetch="5000"
ascending="false" debug="true"/>
      </filter>
      <filter type="record_transform">
        <retrievalinfo xmlns="http://indexdata.com/yaz" version="1.0">
          <retrieval syntax="usmarc" name="F"/>
          <retrieval syntax="usmarc" name="B"/>
          <retrieval syntax="xml" name="marcxml"
identifier="info:srw/schema/1/marcxml-v1.1">
            <backend syntax="usmarc" name="F">
              <marc inputformat="marc" outputformat="marcxml"
inputcharset="marc-8" outputcharset="utf-8"/>
            </backend>
          </retrieval>
        </retrievalinfo>
      </filter>
      <filter type="log">
        <message>Default</message>
      </filter>
      <filter type="z3950_client"/>
      <filter type="bounce"/>
    </route>
      <route id="oclc">
      <filter type="record_transform">
        <retrievalinfo xmlns="http://indexdata.com/yaz" version="1.0">
          <retrieval syntax="usmarc" name="F"/>
          <retrieval syntax="usmarc" name="B"/>
          <retrieval syntax="xml" name="marcxml"
identifier="info:srw/schema/1/marcxml-v1.1">
            <backend syntax="usmarc" name="FD">
              <marc inputformat="marc" outputformat="marcxml"
inputcharset="marc-8" outputcharset="utf-8"/>
            </backend>
          </retrieval>
        </retrievalinfo>
      </filter>
      <filter type="log">
        <message>OCLC</message>
      </filter>
      <filter type="z3950_client"/>
      <filter type="bounce"/>
    </route>
    <route id="utf8">
      <filter type="record_transform">
        <retrievalinfo xmlns="http://indexdata.com/yaz" version="1.0">
          <retrieval syntax="usmarc" name="F"/>
          <retrieval syntax="usmarc" name="B"/>
          <retrieval syntax="xml" name="marcxml"
identifier="info:srw/schema/1/marcxml-v1.1">
            <backend syntax="usmarc" name="F">
              <marc inputformat="marc" outputformat="marcxml"
inputcharset="utf-8" outputcharset="utf-8"/>
            </backend>
          </retrieval>
        </retrievalinfo>
      </filter>
      <filter type="log">
        <message>UTF-8</message>
      </filter>
      <filter type="z3950_client"/>
      <filter type="bounce"/>
    </route>


--
Tim A. Thompson
Metadata Librarian (Spanish/Portuguese Specialty)
Princeton University Library

On Thu, Oct 1, 2015 at 3:00 PM, Adam Dickmeiss <adam at indexdata.dk> wrote:

>
>
> On 09/23/2015 09:55 PM, Tim Thompson wrote:
>
> Hello,
>
> In Metaproxy, I would like to be able to sort a result set of MARC records
> by date last modified. Following the example in the documentation, I've
> declared a sort filter in my config file, but it doesn't seem to have any
> effect (I'm also unsure of where to place it in the filter sequence):
>
> <filter type="sort">
>     <sort xpath="/marc:record/marc:controlfield[@tag = '005']"
> namespaces="marc=http://www.loc.gov/MARC21/slim" prefetch="500"
> ascending="false" debug="true"/>
> </filter>
>
> This is in the context of a multiplex search configuration.
>
>
> The filter only deals witih XML so if you work with MARC, be sure it's
> MARCXML that passed through. That means you'll have to convert from MARC to
> XML and, if the client asks for MARC, you'll  have to convert from XML to
> MARC again.. Fortunately that's lossless.
>
>       <filter type="record_transform">
>         <retrievalinfo  xmlns="http://indexdata.com/yaz"
> <http://indexdata.com/yaz> version="1.0">
>           <retrieval syntax="usmarc">
>             <backend syntax="xml" name="marcxml">
>               <marc inputformat="xml" outputformat="marc"
>                     inputcharset="utf-8" outputcharset="marc-8"/>
>             </backend>
>           </retrieval>
>       ..
>       </filter>
>      <filter type="sort">
>         <sort
>             xpath=...     />
>      </filter>
>      <filter type="record_transform">
>       <retrievalinfo  xmlns="http://indexdata.com/yaz"
> <http://indexdata.com/yaz> version="1.0">
>        <retrieval syntax="xml" name="marcxml"
>              identifier="info:srw/schema/1/marcxml-v1.1">
>          <backend syntax="usmarc" name="F">
>           <marc inputformat="marc" outputformat="marcxml"
>              inputcharset="marc-8" outputcharset="utf-8"/>
>          </backend>
>        </retrievalinfo>
>     </retrieval>
>
> See config-record-transform.xml in Metaproxy. Please upgrade to Metaproxy
> 1.10.0, due to a recent bug fix in the sort filter.
>
> / Adam
>
>
> Thanks in advance,
> Tim
>
> --
> Tim A. Thompson
> Metadata Librarian (Spanish/Portuguese Specialty)
> Princeton University Library
>
>
>
> _______________________________________________
> Yazlist mailing listYazlist at lists.indexdata.dkhttp://lists.indexdata.dk/cgi-bin/mailman/listinfo/yazlist
>
>
>
> _______________________________________________
> Yazlist mailing list
> Yazlist at lists.indexdata.dk
> http://lists.indexdata.dk/cgi-bin/mailman/listinfo/yazlist
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.indexdata.dk/pipermail/yazlist/attachments/20151001/feb0d759/attachment-0001.html>


More information about the Yazlist mailing list