Try our conversational search powered by Generative AI!

Henrik Fransas
Mar 11, 2014
  5494
(1 votes)

Indexing only referenced files with EPiServer Find 7.5

Henrik wrote a very good blog post on this for the previous version of Find that you can find here:

http://www.lindstromhenrik.com/indexing-only-referenced-vpp-files-with-episerver-find/

If you want it to work with iContent all you have to change this:

Remove this:

FileIndexer.Instance.Conventions.ShouldIndexVPPConvention = new ShouldIndexVPPConvention(x => true);
 
Change this:
FileIndexer.Instance.Conventions.ForInstancesOf<UnifiedFile>().ShouldIndex(x =>
To:
ContentIndexer.Instance.Conventions.ForInstancesOf<IContentMedia>().ShouldIndex(x =>
 
Then change this row:
var softLinks = contentSoftLinkRepository.Load(x.VirtualPath);
To:
var softLinks = contentSoftLinkRepository.Load(x.ContentLink, true);
 
And it should be up and running!

Good luck!

Mar 11, 2014

Comments

May 19, 2014 02:32 PM

This doesn't seem to work if the reference is from a property on a page that doesn't have a template (settings page, container pages etc).
Any ideas if that can be solved?

Henrik Fransas
Henrik Fransas May 19, 2014 02:41 PM

Kim, I didn't know that, thanks for the information. It must be that those links does not register as softlinks. It should not be hard to extend the function to also search through all the properties that are contentreference to a mediadata-content. I do not have the time to fix that right now, but will look into it

Chaudhry Mohsin Ali
Chaudhry Mohsin Ali Jun 20, 2018 10:15 AM

Where should we include this file? Should it be in an init module?

Chaudhry Mohsin Ali
Chaudhry Mohsin Ali Jun 20, 2018 11:02 AM

And when we unlink the file what should happen then?

For example when we add a file in the content area it should appear in the search result but after deleting the file from the content how should we update the index, so that the file is not included next time?

Please login to comment.
Latest blogs
Product Listing Page - using Graph

Optimizely Graph makes it possible to query your data in an advanced way, by using GraphQL. Querying data, using facets and search phrases, is very...

Jonas Bergqvist | Jul 5, 2024

Optimizely Search and Navigation - Part 2 - Filter Tips

Introduction Continuing from Part 1 – Search Tips , today I will share the next part – filter tips. The platform versions used for this article are...

Binh Nguyen Thi | Jul 1, 2024

Integrating HubSpot CRM without the MA Connector

Have HubSpot CRM? Want to push user data into it from Optimizely? Don’t have any personalisation requirements with that data? Don’t want to pay $80...

Matt Pallatt | Jun 27, 2024

Keeping the website secure by updating external packages

Did you see the latest warning from Optimizely to update this package with a critical security warning? https://world.optimizely.com/documentation/...

Daniel Ovaska | Jun 27, 2024

Optimizely CMS image anonymization now available for Linux!

The famous image anonymization add-on for Optimizely CMS, with at least 5 downloads, is now finally available for use on Linux. Supports simultaneo...

Tomas Hensrud Gulla | Jun 25, 2024 | Syndicated blog

Remove a segment from the URL in CMS 12

Problem : I have created thousands of pages dynamically using schedule jobs with different templates (e.g. one column, two columns, etc..) and stor...

Sanjay Kumar | Jun 21, 2024