forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Scherler <thorsten.scherler....@juntadeandalucia.es>
Subject Re: SolrForrest plugin
Date Thu, 15 Jan 2009 11:39:54 GMT
El mié, 14-01-2009 a las 12:11 +0100, Andrzej Bialecki escribió:
> Hi devs,
> 
> I found this Forrest plugin at the Forrest site. If you guys have a 
> moment to spare I'd really appreciate your advice.
> 
> I'm a complete newbie to Forrest, the only things I know how to do is to 
> fill in the blanks in the default site xdocs and generate static html. 
> It's not much, I'm afraid.

Should be enough. ;)

Since the plugin is still in the whiteboard you need to use the TRUNK of
forrest. Best to get started with the plugin:

cd
$FORREST_HOME/whiteboard/plugins/org.apache.forrest.plugin.output.solr
forrest run

http://localhost:8888/index.html -> here you find some samples and basic
instructions.

> Now, I need to index the content of a Forrest site in Solr, using a 
> custom schema - e.g. the "id" in my case should be equivalent to the 
> full URL of the page of the deployed site.

You have seen http://wiki.apache.org/solr/SolrForrest and
http://forrest.apache.org/pluginDocs/plugins_0_80/org.apache.forrest.plugin.output.solr/

> 
> First, I'm stuck conceptually - sitting in the top-level dir of the 
> forrest site, what is it that I have to do to produce a file with the 
> Solr <add> documents? 

Actually that is doing the plugin to you.
http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.solr/output.xmap?view=markup
...
<!-- Output xdocs as solr docs -->
<map:match pattern="**.solr">
 <map:generate src="cocoon://{1}.xml"/>
 <map:transform src="{lm:solr.transform.xdocs.solrDoc}">
  <map:parameter name="document-url" value="{1}.xml"/>
  <map:parameter name="project" value="{properties:project.name}"/>
 </map:transform>
 <map:serialize/>
</map:match>

You are talking about to extend the ./resources/stylesheets/xdocs-to-solrDoc.xsl with your
custom attributes. 
First have a look at the plugins xsl to get an idea about how we are doing things.

Now copy the file to your project into your stylesheet dir (default is src/documentation/resources/stylesheets/
= {project.stylesheets-dir}).

Let forrest know that you want to provide a custom location by adding the following in your
project locationmap.xml after the "locator" element:
<match pattern="solr.transform.xdocs.solrDoc">
 <location src="{project.stylesheets-dir}/xdocs-to-solrDoc.xsl"/>
</match>

>>From here you need to implement your logic. 

> I already added the Solr output plugin to 
> skinconf.xml. I discovered that I can get this via webapp, but I'd 
> rather not actually run the webapp.

hmm, skinconf.xml has nothing to do with the plugin. Where did you get
the expression that you need to edit this file? You need to add the
plugin to "project.required.plugins". 

> 
> Second, how can I modify the schema of the produced documents, so that 
> e.g. the id is the full URL - a configurable root URL plus the page 
> name, and so that I can add other metadata to the docs?

You will need to create your own xsl to override the default one as
described above.

> 
> Thanks in advance for any help that you can provide!

Please keep on asking if this are still not very clear. 

salu2
-- 
Thorsten Scherler <thorsten.at.apache.org>
Open Source Java <consulting, training and solutions>

Sociedad Andaluza para el Desarrollo de la Sociedad 
de la Información, S.A.U. (SADESI)





Mime
View raw message