Import XML (SRW, “Search/Retrieve Web Service Protocol”)

Author Message

Urs °

Monday 16 July 2007 2:52:08 am

We have an external search application based on lucene und we discuss now how we get the search results into our new website. It seems that the XML standard ( SRW: http://de.wikipedia.org/wiki/Z39.50_International_Next_Generation ) might be a good solution. Is there a possibility to import an XML file (SRW) in eZ publish? Can you recommend an extension or support document which explains how I can do it?
many thanks

Michael Maclean

Monday 16 July 2007 4:45:08 am

SRW isn't currently available in eZ, but it's fairly easy to handle XML-based protocols using an extension. I suspect that the way to go about it might be to write a template fetch operator, a bit like the one in this tutorial:

http://ez.no/ezpublish/documentation/development/extensions/building_an_ez_publish_module

You could write code in PHP to handle creating and executing the queries, and then return results which can then be displayed using the template system as normal. If you were to go down this route, I'm sure that other people would be interested in using it.

There is also an existing Lucene extension for eZ, which is in Subversion here: http://pubsvn.ez.no/community/trunk/extension/lucene/ , however it has since been deprecated in favour of a system based on Solr: http://projects.ez.no/ezsolr.

eZpedia community documentation project | http://ezpedia.org

Urs °

Monday 16 July 2007 5:24:30 am

Hi Michael
thanks for the quick answer.

We can't use a lucene extension because we develop our own lucene search (extern). Have you any experience with SRW? Can you recommend it or would you use another XML standard, in example with the extension "Import XML Data"?

http://ez.no/community/contribs/import_export/import_xml_data

Thanks
Urs

Michael Maclean

Monday 16 July 2007 7:04:21 am

I haven't used it myself, though it looks interesting. That Import XML contribution is designed to import a set of content objects from an XML file, for permanent display in the site, if you see what I mean - it could be used to restore a site from a backup, perhaps.

I think however if you're running a search server, you will want to search based on form input, or other dynamic information, for which you will need to write some kind of interface to the search service. I think the template fetch operator is the best way to go here, or perhaps you could write a module with a view that does all the work before the page is loaded.

I think I'll edit this post when I've thought of a clearer way of expressing what I mean...

eZpedia community documentation project | http://ezpedia.org

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 00:20:50
Script start
Timing: Jan 31 2025 00:20:50
Module start 'layout'
Timing: Jan 31 2025 00:20:50
Module start 'content'
Timing: Jan 31 2025 00:20:50
Module end 'content'
Timing: Jan 31 2025 00:20:50
Script end

Main resources:

Total runtime0.0249 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0046 588.2813151.2266
Module start 'layout' 0.00460.0032 739.5078220.7188
Module start 'content' 0.00790.0155 960.22661,001.7578
Module end 'content' 0.02340.0015 1,961.984433.9922
Script end 0.0249  1,995.9766 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002510.1463140.0002
Check MTime0.00114.3145140.0001
Mysql Total
Database connection0.00072.832710.0007
Mysqli_queries0.00228.896930.0007
Looping result0.00000.036410.0000
Template Total0.00114.210.0011
Template load0.00083.245910.0008
Template processing0.00020.987310.0002
Override
Cache load0.00062.335210.0006
General
dbfile0.002510.159780.0003
String conversion0.00000.019140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs