Index the contents of Excel files

To be able to index the contents of .xlsx files you must create a text extractor that gets the data from published .xlsx files and adds it to a search index.

Perform the following:

  1. Open your project in Visual Studio.
  2. In the Solution Explorer, expand References and navigate to Telerik.Windows.Documents assembly.
  3. Copy and save the version of the assembly.
  4. In Visual Studio, add the Telerik NuGet server as described in Available NuGet Packages » Get the NuGet Packages.
  5. In your project, install Telerik Document Processing Spreadsheet NuGet package.
    To do this, open the Package Manager Console and use the following command to install the following NuGet package from the Telerik Document Processing NuGet repository:
    Install-Package Telerik.Windows.Documents.Spreadsheet -Version X
    Where X is the assembly version you got in Step 3.
    EXAMPLE: Install-Package Telerik.Windows.Documents.Spreadsheet -Version 2023.1.123.45
  6. Build the project and open it.
  7. Add the XlsxTextExtractor class to your project.
  8. Use the following steps that guide you through the implementation of the class:
    1. Inherit from ITextExtractor.
    2. Define the private members.
    3. Get the mime type.
    4. Implement the GetText method of XlsxTextExtractor class.
    5. Implement the private method ExecuteDocumentAction.

      EXAMPLE: For more information, see the XlsxTextExtractor.cs class the in Sitefinity's CMS documentation-samples GitHub repository.

  9. In Sitefinity CMS backend, navigate to Administration » Settings » Advanced » DocumentService » ExtractorSettings » Create new.
  10. In MimeType field, enter application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
  11. In ExtractorType field, enter SitefinityWebApp.XlsxTextExtractor, SitefinityWebApp
  12. Save your changes and restart the application.
  13. Create a search index for documents and reindex it.
    For more information, see Create search indexes.

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?