Tagged: Indexing

Coveo Computed Field for Retrieving Page Content and Renderings in Sitecore

I needed to index all text from the page content and its associated renderings, including single-line, multi-line, and rich text, into a single Coveo-computed field.

Let’s get started.

Text Extraction:

  • Created a TextExtraction class that inherits BaseComputedField.
  • GetComputedFieldValue: Computes the concatenated text from the item and its renderings.

  • GetRenderingSource: Retrieves the source item for a given rendering reference.

  • GetDatasourceItem: Resolves and retrieves the data source item using the pipeline manager.

  • GetAllReferencedText: Extracts text from fields and adds them to a result list.

  • GetReferenceFieldData: Handles reference fields and extracts text from referenced items.

 

 

Configuration:

Let’s add the TextExtraction computed field into the config file.

 

I published all the files, and it’s time to check.

I selected the page that has many renderings and hit Rebuild Tree (I set the indexing strategy as SyncMasterIf you have intervalAsyncMaster or onPublishEndSyncSingleInstance, publish the item to see the record in Index.)

If any issues, you can put a breakpoint in Visual Studio, and Rebuild Tree will hit the breakpoint to debug.

 

Let’s check the Coveo index – Yay! Its page content and its associated rendering content were extracted successfully.

Hope this helps.

Happy Sitecoring!

0

Algolia Search Provider for Sitecore 10.2.1

Algolia Search Provider for Sitecore 10.2.1

The Algolia Search Provider for Sitecore is a powerful integration combining robust content management capabilities with Algolia’s lightning-fast, full-text search engine.

This provider enables Sitecore-driven websites and applications to deliver instant, relevant, and highly customizable search experiences to end-users, ensuring faster content discovery and improved user engagement.

While exploring, I found that Dmitry Harnitski and Peter Procházka have implemented the Algolia Search Provider for Sitecore 9.1 and previous versions. Thank you so much!

https://github.com/dharnitski/Sitecore.Algolia

https://github.com/chorpo/Sitecore.Algolia/tree/sitecore91

Upgrading to Sitecore 10.2.1

The following are the steps taken for upgrading Sitecore 10.2.1 – 

  •  I forked from Peter Procházka’s Sitecore 9.1 branch

https://github.com/chorpo/Sitecore.Algolia/tree/sitecore91

  • Upgraded the Sitecore NuGet packages to 10.2.1.

Sitecore-Algolia-Search-Provider-10-2-1-Upgrade-1.png

  • Algolia.Search NuGet package upgraded 6.12.1

Sitecore-Algolia-Search-Provider-10-2-1-Upgrade-4.png

Sitecore-Algolia-Search-Provider-10-2-1-Upgrade-2.png

  • Finally, able to build the solution successfully. 

Sitecore-Algolia-Search-Provider-10-2-1-Upgrade-3.png

  • After the build was successful, I shifted the module to the existing solution.
  • I didn’t get a chance to upgrade the unit test project. If you have upgraded, please let me know.

The module is checked into the following repository.

https://github.com/Madhumidha/Sitecore.Algolia/tree/Sitecore1021

The repo has all the instructions on how to set up and configuration details.

Hope this helps.

Happy Sitecoring!

 

1