Written by The Jahia Team
 
Developers
   Estimated reading time:

As with any modules, before upgrading to a more recent version please make sure to consult the release notes to identify if any of the features you're using have been modified (or deprecated) or if any changes in behavior should be expected.

Please also make sure to validate the upgrade in a staging or pre-prod environment before applying the change to your production environment.

Impact on existing Augmented Search sites

Upgrading to the latest version of the Augmented Search module does not impact your previously indexed sites. End-user search will still be operational and modifying or publishing content will still trigger the update of the corresponding documents in Elasticsearch.

Since we introduced indexing per sites with this release, you will not be able to manually trigger individual site (or bulk) indexing until you add the corresponding sites in the Augmented Search Manager. So after upgrading Augmented Search, make sure to add all of your sites in the Augmented Search Manager.

Nodes configured for skipping indexation

Newer versions of Augmented Search (from 1.4.3 and from 3.0.2) introduced a modification of the skipIndexation property. After updating Augmented Search, you will need to update each node previously configured to use the skipIndexation property with the newly introduced property (skipIndexationString).

After upgrading Augmented Search, nodes using the old property will still be skipped but editors will not be able to save future modifications of this node until the new property is set for that node.

You can perform one of the following once the upgrade is completed:

  • Modify each node individually by setting the Remove From Augmented Search Results mixin in the UI. This will attach the new property to the node. This approach is relevant for sites with only a limited number of nodes using the skipIndexation property.
  • Apply a Groovy script to perform a bulk modification of all nodes using the old property and setting the new one.

Groovy script for bulk modification

import org.jahia.api.Constants
import org.jahia.services.content.JCRCallback
import org.jahia.services.content.JCRSessionWrapper
import org.jahia.services.content.JCRTemplate
import org.jahia.services.usermanager.JahiaUserManagerService
import javax.jcr.PropertyType
import javax.jcr.RepositoryException
JCRCallback<Object> callback = new JCRCallback<Object>() {
    @Override
    Object doInJCR(JCRSessionWrapper session) throws RepositoryException {
        def results = session.getWorkspace().getQueryManager().createQuery("select * from [jmix:skipESIndexation]", Query.JCR_SQL2).execute();
        results.nodes.forEach({
            if (it.hasProperty("skipIndexation")) {
                if (it.getProperty("skipIndexation").getType() == PropertyType.BOOLEAN) {
                    it.setProperty("skipIndexationString", "current-only");
                } else {
                    it.setProperty("skipIndexationString", it.getProperty("skipIndexation").getString());
                }
                it.getProperty("skipIndexation").remove();
            }
        });
        session.save();
        return null
    }
}
JCRTemplate.instance.doExecuteWithSystemSessionAsUser(JahiaUserManagerService.instance.lookupUser("root").jahiaUser,
        Constants.EDIT_WORKSPACE, Locale.ENGLISH, callback);

If you're upgrading from version 1.4.3 and above (for Jahia 7.x) or 3.0.2 and above (for Jahia 8.x), the new property was already set and there is no need to perform any actions associated with skipIndexation.

Previously installed modules versions

Having multiple versions of Augmented Search and Jahia GraphQL Core Provider installed on the same Jahia might generate conflicts. As part of your upgrade process, please make sure to remove all previous versions of these two modules, keeping only the most recent ones.