Chuck Burd wrote:
Thanks, that worked great!

I have a question regarding the behavior of Lucene in my Cocoon implementation. When my XML files are indexed, the text nodes of child elements are not included.

With this XML source:
<title><quote rend="inline">Webs of Significance"</quote>: The Abraham Lincoln Historical Digitization Project, New Technology, and the Democratization of History.</title>

I would like the search:
title:webs

to return the above <title> as a result.

Can I change the behavior of the indexer to include the content of child elements so that the search would work?

Configuration is described quite detailed in the userdocs [1]
You should add something like

<lucene-xml-indexer logger="core.search.lucene">
  <store-fields>root-elements, title, some, other, elements</store-fields>
</lucene-xml-indexer>

to your lucene.xconf.

The <content-view-query> configuration parameter may also be helpful in
certain circumstances

~eike

[1] http://cocoon.apache.org/2.1/userdocs/concepts/xmlsearching.html


Best,

Chuck Burd
crb...@gmail.com

On Jul 28, 2009, at 9:48 AM, Eike Jordan wrote:

Chuck Burd wrote:
I'm using Cocoon 2.1.
Is there a way to configure the Lucene default Boolean search behavior by a setting within cocoon.xconf?

Well, cocoon 2.1(.11) comes with lucene 1.4.3 and a default implementation in SimpleLuceneCocoonSearcherImpl. The configuration of this component via cocoon.xconf is restricted to analyzer, default_searchfield, default_query
and index_directory.

But you may modify SimpleLuceneCocoonSearcherImpl in order to fulfill your
requirements.

Replace:
355 Query query = QueryParser.parse(query_string, default_field, analyzer);

with:
355 QueryParser parser = new QueryParser(default_field, analyzer);
356            parser.setOperator(QueryParser.AND);
357            Query query = parser.parse(query_string);

hth
~eike



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



--
Eike Jordan  <jor...@fiz-chemie.de>

| FIZ CHEMIE BERLIN
| Franklin Str. 11               ------    ,__o
| 10587 Berlin                  ------   _-\_<,
|                              ------   (+)/'(+)
| Tel. : 0049-30-39977 214


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

Reply via email to