[opencms-dev] Search into OpenCmsVfsFile
Steve Bryan
steve at bright-interactive.com
Tue Mar 25 13:06:06 CET 2008
Hi Julien
You can configure the search source to include the structured xml items as
well as HTML pages. The indexer will index the <content> elements of the xml
items.
<indexsource>
<name>SitePages</name>
<indexer class="org.opencms.search.CmsVfsIndexer"/>
<resources>
<resource>/sites/xxx/</resource>
</resources>
<documenttypes-indexed>
<name>xmlpage</name>
<name>xmlcontent</name>
</documenttypes-indexed>
</indexsource>
You can fine-tune this further if necessary using <fieldconfigurations> tags
in opencms-search.xml, so define which elements are included.
You then just need to create a rendering JSP page for the xml type, and set
it in the template-elements property of the xml objects. When the user
clicks on the hyperlink for the xml object, OpenCms will run the JSP, which
can then render the XML. You could redirect to the home page here, or show
the full news article instead.
I actually just point template-elements to my main template, which works out
if it should be rendering an xml object and if so includes a relevant
sub-jsp to do it.
Hope that helps.
Steve
-----Original Message-----
> De : opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] De la part de Julien Lechevanton
> Envoy? : mardi 18 mars 2008 14:55
> ? : The OpenCms mailing list
> Objet : [opencms-dev] Search into OpenCmsVfsFile
>
> Hi,
>
> We are trying to set up the search engine and we are not able to index
> all contents we need. Here is an example :
> - we have got news summary on our homepage (a lit included through an
> OpenCmsVfsFile)
> - we have got news detail on pages (custom xsd)
>
> The search engine will only return the page and not the homepage
> containing the news summary (OpenCmsVfsFile).
>
> Is there a way to make the search engine index whole content including
> the OpenCms** items ?
>
> Thanks
>
> J.
>
More information about the opencms-dev
mailing list