[opencms-dev] Exclude tempfiles from offline indexes?

Mario Jäger m.jaeger at alkacon.com
Wed Oct 20 08:40:05 CEST 2010



Hi Alessio,

With temp files you mean the files, which are there, when an user edits a file and which start with a tilde (~) in the name?

Thereto, you have to implement your own indexer class. This class has to implement the interface org.opencms.search.I_CmsIndexer. But, in your case it is sufficient, that your indexer class extends the class
org.opencms.search.CmsVfsIndexer and overwrites the method updateResource(). You should copy the method org.opencms.search.CmsVfsIndexer.updateResource(). But, you should enhance the check at the beginning of
that method, if a resource shall be updated. Because, the temp files start with a tilde in the name, you should add in your method, that a resource is not updated, if the name of that resource starts with a tilde.

You should add your own indexer class in your own module. And you have to configure your own indexer class for the corresponding index source in the<indexer>  node in the WEB-INF/config/opencms-search.xml:

...
<indexsources>
   <indexsource>
     <name>mysource</name>
     <indexer class="mypackage.myIndexer"/>
     ...

-- 
Kind Regards,
Mario.

-------------------
Mario Jäger

Alkacon Software GmbH  - The OpenCms Experts
http://www.alkacon.com - http://www.opencms.org


Am 14.10.2010 13:30, schrieb Alessio Raggi:
> Hi everybody,
>
> I'm trying to exclude tempfiles from being indexed in "offline mode" 
> indexes. Is there a way to configure this behaviour ?
>
> kind regards,
>
> Alessio
>
>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20101020/69356d76/attachment.htm>


More information about the opencms-dev mailing list