alkacon / opencms-core

The Java open source content management system by Alkacon Software
http://www.opencms.org
GNU Lesser General Public License v2.1
520 stars 575 forks source link

[OpenCms14] Content changes on container page don't index contents for containerpage in Solr #795

Closed tobias-karrer closed 3 months ago

tobias-karrer commented 3 months ago

We are currently running OpenCms14 using our own template set.

Whenever content gets edited, solr fields content_de and content_en get deleted and not index again.

The container page stores formatter with prefix "schema_formatter": image

I debugged into and ended in CmsSolrDocumentContainerPage#extractContent (https://github.com/alkacon/opencms-core/blob/master/src/org/opencms/search/solr/CmsSolrDocumentContainerPage.java#L162)

The if here image fails, as element.getFormatterId() is null and else if can't find the formatter, as null is returned for findFormatter in CmsADEConfigData when given name starts with schema_formatter: image

So shouldExtractElement here https://github.com/alkacon/opencms-core/blob/master/src/org/opencms/search/solr/CmsSolrDocumentContainerPage.java#L162 always is false and content is not indexed.

The only way so far is to re-index the whole Solr Core (which takes quite a lot of time for Solr Offline)

Is this a bug that is fixed in OpenCms 15 or 16? Or what could be the problem?

gWestenberger commented 3 months ago

Don't use formatters configured in schemas, they are outdated. Use formatter configurations instead : https://documentation.opencms.org/opencms-documentation/template-development/formatters-and-their-configuration/introduction/index.html