cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eike Jordan <jor...@fiz-chemie.de>
Subject Re: Lucene XML Indexing Behavior
Date Tue, 28 Jul 2009 16:18:02 GMT
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
> 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
> 


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

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


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


Mime
View raw message