Sergii Vorushylo
Nov 13, 2015
  6617
(6 votes)

Find optimizations export-import

Recently I got a question if there is a way to transfer EPiServer Find optimizations from one index to another. By optimizations here I mean synonyms, related queries, autocomplete entries and best bets. There was no utility for this, so my suggestion was to use the same REST API that we use in EPiServer Find UI. Using this REST API without documentation and ability to look under the hood might be quite challenging, so I decided to write a tool for this myself.

The tool is an EPiServer Admin mode plugin that allows exporting and importing EPiServer Find optimizations entities between indexes or sites. It is packed as a NuGet package and uses JSON format for export. It is available at nuget.episerver.com, so you can install it by running Install-Package Vro.FindExportImport in Visual Studio package manager console. Once installed the plugin can be found in Admin mode under the Tools section.

Exporting and importing Find optimizations has two synchronization problems: how to match sites (each optimization belong to an individual site or "All sites") and how to match the content selected in Best bets.

When it comes to sites, it is relatively easy: optimizations can be exported only within a single site.
Image ExportView.png

When importing, users select a target site and all optimizations just get new site value during import. 

Image ImportView.png
Please note, the value “All sites” in EPiServer Find does not mean all available sites, but rather a unique value indicating that an optimization has an effect on all sites. Therefore, when exporting with “All sites” selected, it just means only optimizations with “All sites” value are exported and not optimizations from all sites. The same is for import: all imported entities assigned to the selected site or the special “All sites” value. The plugin also can be used to copy optimizations from one site to another within the same index.

For the content references in best bets, I have not found a better solution than just trying to find a matching content by name on the target site. For best bets with pages, importer searches within pages, and for best bets with commerce products, importer searches only within commerce catalog items. If there is no content with a matching name, the best bet is skipped from importing.

When importing optimizations, the same validation rules apply as if optimization is created manually in EPiServer Find UI. If there is already an optimization with the same properties like the one being imported, no new optimization is created, and no existing optimizations get updated.

Plugins source code is available at GitHub

Nov 13, 2015

Comments

Henrik Fransas
Henrik Fransas Nov 14, 2015 05:26 AM

Great addOn, thanks!

K Khan
K Khan Nov 14, 2015 10:35 PM

Cool!

Mari Jørgensen
Mari Jørgensen Nov 16, 2015 09:34 AM

Nice!

Per Magne Skuseth
Per Magne Skuseth Nov 16, 2015 11:38 AM

Great work!

Praful Jangid
Praful Jangid Jun 17, 2019 07:49 AM

Hi Sergii Vorushylo,

First of all, great work and thanks for this add-on.

I am curious to know that, does this creates a log for the content that is not found a match while importing? Or any kind of related information is logged?

Thanks & Regards,

Praful Jangid

Sanjay Kumar
Sanjay Kumar Jul 30, 2020 06:20 AM

Hey Guys, 

I logged an error regarding installing this package:

https://world.episerver.com/forum/developer-forum/-Episerver-75-CMS/Thread-Container/2020/7/after-installing-vro-findexportimport--package-getting-assembly-reference-error/ can

Can anyone help to resolve it?

Thanks

Please login to comment.
Latest blogs
Integrating Optimizely DAM with Your Website

This article is the second in a series about integrating Optimizely DAM with websites. It discusses how to install the necessary package and code t...

Andrew Markham | Sep 28, 2024 | Syndicated blog

Opticon 2024 - highlights

I went to Opticon in Stockholm and here are my brief highlights based on the demos, presentations and roadmaps  Optimizely CMS SaaS will start to...

Daniel Ovaska | Sep 27, 2024

Required fields support in Optimizely Graph

It's been possible to have "required" properties (value must be entered) in the CMS for a long time. The required metadata haven't been reflected i...

Jonas Bergqvist | Sep 25, 2024

How to write a bespoke notification management system

Websites can be the perfect vehicle for notifying customers of important information quickly, whether it’s the latest offer, an operational message...

Nicole Drath | Sep 25, 2024