volume_up

A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

volume_up

A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

Url property is not indexed

Hi,

I've created a Url property like this:

[BackingType(typeof(PropertyUrl))]
public virtual Url MyUrl { get; set; }

When I get search hits (projections) using EPiServer Find 10, MyUrl is empty.

I've also checked the search index in EPiServer CMS by navigating to Find / Overview; MyUrl field is not indexed.

The property is properly stored into a database. I can fetch it using ContentLoader / ContentRepository.

Has anyone run into the same problem?

#139853
Oct 07, 2015 16:32

Have you tried marking it as searchable? [Searchable(true)]

#139857
Oct 07, 2015 21:27

Hi Johan,

[Searchable(true)] didn't solve the problem.

#139873
Oct 08, 2015 10:44

I think the Url type is excluded by default.

Perhaps you could add the field as a string. Add the following to an initializable module:

 SearchClient.Instance.Conventions.ForInstancesOf<StartPage>().IncludeField(x => x.CrazyUrl.ToString())

Remember to reindex! :-)

Tip: In situatiions like this you might want to check out EPiCode.InspectInIndex

#139878
Oct 08, 2015 11:06

I don't see IncludeField in that namespace anymore. Is there an alternative in the newer APIs? (EPiServer.Find.Cms version is 12.2.4.0)

#175761
Mar 01, 2017 12:05

It's still the same.
It's in EPiServer.Find.ClientConventions in EPiserver.Find.dll

#175762
Mar 01, 2017 12:18

Ah, thanks that make sense - I was missing the ClientConventions bit i.e.

ContentIndexer.Instance.Conventions.ForInstancesOf<Fixture>().IncludeField(x => x.Tickets); //fail

Whereas this looks like it will work:

SearchClient.Instance.Conventions.ForInstancesOf<Fixture>().IncludeField(x => x.Tickets);

#175763
Mar 01, 2017 12:36
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.