cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martijn C. Vos" <m....@hippo.nl>
Subject RE: Help me please!
Date Wed, 14 Dec 2005 15:56:46 GMT
Dan Nicolici <mailto:dan.nicolici@nexource.ro> wrote:

> The steps that I imagine I have to follow are:
> -          create a pipeline that aggregates all the other pipelines
> ("master pipeline"); 
> -          transform the resulting xml to a "lucene:index" document;
> -          transform the previous document with
> LuceneIndexTransformer (index automatically gets built); 
> -          use SearchGenerator for searching the index;
> 
> Is this a correct scenario?

I think it is. I'm not really an expert, but I'm currently working
on an old site (originally written by someone else) that uses the
LuceneIndexTransformer to index a bunch of xml files, and it seems
to be doing something very much like this. (All our recent sites
do all their indexing on a Slide repository and search with
dasl-queries.)

> 1. The "master pipeline" is supposed to be called manually (like
> typing it in the address bar) or can it be automated somehow (i. e.
> running once a nigh)?  

You can call it manually or use cron. Another of our sites is configured
to use cron to do something, so it's possible to do that from cocoon,
but I'm not sure how hard that is to configure and how custom all of
this stuff is.

> 2. What do I need the xml file that remains after
> LuceneIndexTransformer created the index for? 

Being a transformer, it needs to create some xml. If you don't need
it, ignore it.

> 4. Since I do not see question no. 3 being answered positive (I
> googled my brains out...), can anybody please write a super-simple part
> of a sitemap that illustrates all this?  

To create the index, we have something like this:

<map:match pattern="*/lucene-index.xml">
  <map:generate src="cocoon:/listing/{1}"/>
  <map:transform src="../stylesheets/templates/lucene/create-lucene-index.xsl">
    <map:parameter name="realpath" value="{realpath:/}"/>
    <map:parameter name="languageId" value="{1}"/>
  </map:transform>   
  <map:serialize type="xml"/>
</map:match>

<map:match pattern="listing/*">
  <map:generate type="xpathdirectory" src="{constants:datapath}/{1}">
    <map:parameter name="depth" value="2"/>
    <map:parameter name="xpath" value="."/>
    <map:parameter name="xmlFiles" value=".xml"/>
  </map:generate>
  <map:serialize type="xml"/>
</map:match>
            
<map:match pattern="*/lucene-create">
  <map:generate src="cocoon:/{1}/lucene-index.xml"/>
  <map:transform type="index"/>
  <map:serialize type="xml"/>
</map:match>

To search:
<map:match pattern="*/search">
  <map:generate type="search" label="content">
    <map:parameter name="index" value="{realpath:/}/{1}"/>
  </map:generate>
  <map:serialize type="xml"/>
</map:match>


mcv.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message