[opencms-dev] Code Question

Rüdiger Kurz r.kurz at alkacon.com
Mon Mar 11 12:15:10 CET 2013


Hi John,

since the XPath does not contain the locale info, it is not possible to 
take care about multiple locales. For the Lucene case that doesn't 
matter because you should have a separate index for each language 
configured.

Nevertheless this part of the indexing process should be improved 
somehow, especially for multi language support and nested contents. An 
upcoming version might contain some indexing improvements.

If you can't wait, you can write your own document type by extending 
CmsSolrDocumentXmlContent and then configure it in the opencms-search.xml.

Thank you very much for your input!

regards
Rüdiger


Am 08.03.2013 19:43, schrieb John James Valentine:
> Hi Mailing List,
>
> I have a question about a change in the CmsSolrDocumentXmlContent
> class.  The javadoc for the extract content method states that all XML
> nodes will be in the item map and the XML elements will be accessible
> using xpath.
>
> In 8.5.0 all XML nodes were in the content items map, in 8.5.1, not all
> XML nodes are available in in the content items map.  Looking at the
> code history, the following line was removed from the
> CmsSolrDocumentXmlContent class:
>
>                      items.put(xpath, extracted);
>
> Here is the javadoc for the extract content method:
>
> Returns the raw text content of a given VFS resource of type
> |CmsResourceTypeXmlContent|.
>
> All XML nodes from the content for all locales will be stored separately
> in the item map which you can access using
> |CmsExtractionResult.getContentItems()
> <eclipse-javadoc:%E2%98%82=com.dispatch.framework/C:%5C/Users%5C/jvalentine%5C/.m2%5C/repository%5C/org%5C/opencms%5C/opencms-core%5C/8.5.1%5C/opencms-core-8.5.1.jar%3Corg.opencms.search.documents(CmsDocumentXmlContent.class%E2%98%83CmsDocumentXmlContent~extractContent~Lorg.opencms.file.CmsObject;~Lorg.opencms.file.CmsResource;~Lorg.opencms.search.CmsSearchIndex;%E2%98%82CmsExtractionResult%E2%98%82getContentItems%E2%98%82>|.
> The XML elements will be accessible using their xpath. The xpath will
> have the form like for example |Text[1]|or |Nested[1]/Text[1]|.
>
> Was this change by design?  If so, how may we access all the XML nodes
> in the content items map?
>
> Let me know if anyone has any questions.
>
> Thanks,
>
> ~John
>
>
>
> _______________________________________________
> 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/cgi-bin/mailman/listinfo/opencms-dev
>
>
>

-- 
Kind Regards,
Rüdiger.

-------------------

Rüdiger Kurz

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



More information about the opencms-dev mailing list