cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chuck Burd <crb...@gmail.com>
Subject Lucene XML Indexing Behavior
Date Tue, 28 Jul 2009 15:47:37 GMT
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?

Best,

Chuck Burd
crburd@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-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message