Pages

10 October, 2024

Coveo for Sitecore - Using Advanced Field Queries

In Coveo for Sitecore, there are scenarios where we need to create advanced complex queries to get specific results. Though we can achieve most of the search queries using basic queries, advanced queries helps us to narrow the search results. 


When dealing with Coveo Advanced field queries, 
  • queries are performed against field values directly and not through the index. 
  • can search for special characters in field values. In basic query (which is through index), special characters are not searchable. 
  • can be only searched 'with special characters' against fields that have Facet options or Free text search options enabled. 
  • drawback with advanced query is that response increases if the number of fields increases, field values and complexity of the query expression. 

Advanced Field Query Syntax



Advanced Query Field Operators


Wildcard Match (*=)

  • Handles any wildcard characters (?, *).
  • Can use one or more wildcard characters. 
Example: Intel processor containing I9

@processor *= "*I9"

Fuzzy Match (~=)

  • Expands search results by permitting slight difference between search query and results. 
  • Matches 20% difference from the search query.
Example: "Gigestive Capsules" results in "Digestive Capsules"

@medicine ~= "Gigestive Capsules"

Phonetic Match (%=)

  • Transforms query into Phonetic codes, then results that shares similar phonetic code. 
Example: Flour results in Flour and Flower

@type %= "Flour"

Regular Expression Match

  • Matches with the regular expression to get accurate results.
Example: Field containing URL with a subdomain URL. - https://prod1-cm.examples.com/product

@clickableuri /= "^https:\/\/[a-zA-Z0-9.-]*\.examples\.com\/.*$"

Scenarios


01 October, 2024

Sitecore Commerce - Refresh Commerce Cache - This operation is not available unless admin mode is enabled: FLUSHDB

In one of the eCommerce application, Sitecore Commerce 10.1.1 is being used. After few infrastructure consolidation, testing out Refresh Commerce Cache option in CM resulted in the below error. 

Based on the exception, we found that we can add AllowAdmin option to the Sitecore Commerce Redis Connection string. All Commerce related settings are available in this folder - \App_Config\Include\Y.Commerce.Engine.

In Sitecore.Commerce.Engine.Connect.config, allowAdmin=true configuration is added to the Redis Connection string. Refreshing the commerce cache worked without an error. 



24 September, 2024

Sitecore Scheduled Publishing Module - Published 10.4 packages and Docker images

Sitecore Scheduled Publishing module has been updated to support Sitecore 10.4. Following changes were made as part of the release. 

  1. Updated Source to Sitecore 10.4

    Module source has been updated to 10.4. 

  2. Created Packages for Sitecore 10.4

    Two packages were created. One is with IAR files for content and another one is the regular Sitecore content package. 

  3. Created and published Docker Images

    Created and published new Docker image with tag 10.4. This image is built with IAR files. Along with 10.4 tag, latest tag has been updated to 10.4. You can view it here in Docker Hub. 

  4. Documentation updated for schedular configuration

    In order for the scheduled publishing to publish the content, Sitecore's scheduling frequency and interval needs to be adjusted. This has been clearly documented in Readme markdown.
A new release has been added in GitHub with all the relevant assets. https://github.com/nehemiahj/SCScheduledPublishing/releases/tag/Sitecore_10.4

20 September, 2024

Troubleshooting Issues in Sitecore (IIS) - Razl, SPE Content Migrator

This blog post is simply about some basic troublshooting steps whenever we have integration with 3rd party modules which relies on custom APIs in Sitecore. 


First one in this discussion is Sitecore Razl. Sitecore Razl is a database comparison tool for the Sitecore CMS. It allows a developer to compare two different Sitecore databases and see the differences in each. A developer can then migrate changes from one database to the other. (ref)

Once the connection specific package is installed in a server, when trying to load the connection in the Razl tool, it would say it cannot connect. Same accessGuid is present in configuration and Razl Connection window. 

Second one is related to SPE Content Migrator. Script used to migrate content between Sitecore instances using Sitecore PowerShell Extensions.(ref).

In this case, even after enabling SPE Remoting and allowed role "sitecore\PowerShell Extensions Remoting" for authorization, migrator script always responded with the below error. 

Test Script:

Error:


Troubleshooting Steps: 

Both these errors have similar troubleshooting steps. Both these tools interact with Sitecore CM using custom APIs or Handlers. With the current client, there are many IIS rewrite rules added to support their business requirement or for security reasons in Content Management Server. 
  • LowerCaseRule
  • RemoveTrailingSlashRule
  • Root Hit Force HTTPS Redirection
  • Sitecore Login or Admin Force HTTPS Redirection
  • Forbidden
  • Redirect Error Page for a Business Requirement
First step - We enabled IIS logs for the CM site and also enabled all the available fields to log. Refer here to find the list of available fields in IIS Logs - https://www.finalanalytics.com/help/httplogbrowser/field-list.html. We tried multiple times from the tool (Razl or SPE Content Migrator) and we found the POST requests and it was redirected with 301 and a GET request was sent finally to Sitecore. Sitecore was not able to respond to the GET request as it was expecting a POST request from these tools. We tried to check the IIS rewrites one by one and found one of these rewrite rules are redirecting these requests. 

Razl: It was LowerCaseRule which redirected the Razl request. We added the negate rule to avoid Razl URLs. 


SPE Content Migrator: It was RemoveTrailingSlashRule rule which redirected all SPE migrator requests. We added the exception to prevent it. 


It is best to start with IIS first to understand the source of the problem. Happy Troubleshooting!.








18 September, 2024

Coveo for Sitecore - Endpoint Deprecation Issues? Upgrade the Coveo for Sitecore module

Even though we migrated Coveo endpoint to Organization specific endpoint, we still get email from Coveo that deprecated endpoints are being used. Looking at the traffic in Coveo administration, we were still getting much of the analytics traffic using deprecated endpoint. 

Coveo for Sitecore version: 5.0.1277.4 (Release date: October 23, 2023)




The latest Coveo for Sitecore module version (5.0.1368.1) has fixes for updating the analytics endpoint. In the release notes, we have quite a few Analytics related changes and proper analytics endpoints are being used with this version. 

WEB-6836: Fixed the content structure of the Coveo Page View Analytics request payload.
WEB-6922: Removed no longer required usage reporting.
WEB-6937: Fixed the analytics endpoint being used when you bypass the Coveo for Sitecore proxy.
WEB-6954: Simplified the way the Usage Analytics endpoint is composed, depending on the context.

Example: \Coveo\Hive\js\CoveoForSitecore.js


Once the module is upgraded, the traffic starts to drop in the deprecated endpoint and eventually leading to 100% in the recommended endpoint. 
blockquote { margin: 0; } blockquote p { padding: 15px; background: #eee; border-radius: 5px; } blockquote p::before { content: '\201C'; } blockquote p::after { content: '\201D'; }