[opencms-dev] Search: field configuration ignored for XML content?

Christian Steinert christian at christian-steinert.de
Sat Aug 17 05:52:54 CEST 2013


Dear All   

We are using a custom XML content type. As part of this custom XML content type we also use a custom field configuration for the search.
In our template code we call CmsSearchBean.setField( new String[] {"title","content"}  ).  The probem is that  the only field that seems to be used by the search index is the "content" field. The content of the title field is ignored.

Did anybody have a similar problem?



Our field configuration looks like this:

      <fieldconfiguration>
        <name>berzin</name>
        <description>bla bla bla...</description>
        <fields>
          <field name="content" display="%(key.field.content)" store="compress" index="true" excerpt="true">
            <mapping type="dynamic" class="com.berzinarchives.cms.search.SearchFieldMappingForPageTitle">Title</mapping>            
            <mapping type="property-search">subtitle</mapping>
            <mapping type="content"/>
          </field>
          <field name="title" display="%(key.field.title)" store="false" index="true" boost="5.0">
            <mapping type="dynamic" class="com.berzinarchives.cms.search.SearchFieldMappingForPageTitle">Title</mapping>            
          </field>
          <field name="title-key" display="-" store="true" index="untokenized" boost="0.0">
            <mapping type="dynamic" class="com.berzinarchives.cms.search.SearchFieldMappingForPageTitle">Title</mapping>            
          </field>
        </fields>
      </fieldconfiguration>


I have looked at the lucene index with the external tool "luke". With this program I have no problems to search the "title" field and find the expected value that is generated by our dynamic field mapping class. But if I search for the same title in opencms then I get no results.

Any ideas would be appreciated.

Thanks a lot!
Christian



More information about the opencms-dev mailing list