Try our conversational search powered by Generative AI!

Url property is not indexed

Vote:
 

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
Vote:
 

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

#139857
Oct 07, 2015 21:27
Vote:
 

Hi Johan,

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

#139873
Oct 08, 2015 10:44
Vote:
 

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
Vote:
 

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
Vote:
 

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

#175762
Mar 01, 2017 12:18
Vote:
 

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.