[opencms-dev] Search on name of resources in OpenCms 8.x

Luc Feys lfeys at reference.be
Wed May 9 22:30:40 CEST 2012


I am using OpenCms 8.0.3 and I am trying to define a search index to find resources in the workplace based on their filename. I have defined the following indexes, sources, field definitions:

            <param name="org.opencms.search.CmsSearchIndex.checkTimeRange">false</param>

            <indexer class="org.opencms.search.CmsVfsIndexer"/>

                        <field name="res_name" display="Name" store="true" index="untokenized" excerpt="true">
                                   <mapping type="attribute">name</mapping>
                        <field name="content" display="Content" store="true" index="true" excerpt="true">
                                   <mapping type="content"/>

Based on a look I had in the code/javadoc of the following classes, I would expect this to work.
*) org.opencms.search.fields.CmsSearchFieldMapping.java indicates the CmsResourceAttribute enum is used to match the mapping param
*) org.opencms.file.I_CmsResource.CmsResourceAttribute contains a 'name' attribute that corresponds to the filename (without parent path)

When I have a look at my lucene index using Luke, I see that the 'res_name' field has been indexed. If I execute a search in Luke, I get the expected results.

But searching on it in the OpenCms workplace does not result in any hits. I do select the correct index, and check the 'Name' checkbox to make sure the name field is used in the search.

Any ideas on what I might be doing wrong?

Kind regards,

Luc Feys

[Description: REFlogo]<http://www.reference.be/>

Team Leader Java

The Reference NV
Stapelplein 70 bus 201
9000 Gent, Belgium


+32 9 269 12 84


+32 9 234 05 37


+32 495 90 54 33



[Description: http://customers.reference.be/reference/mailImages/training_20120524.jpg]<http://www.reference.be/nl/over-ons/evenementen/professionele-strategieen-link-building/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20120509/465739a4/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 1056 bytes
Desc: image001.gif
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20120509/465739a4/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.jpg
Type: image/jpeg
Size: 997 bytes
Desc: image003.jpg
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20120509/465739a4/attachment.jpg>

More information about the opencms-dev mailing list