Try our conversational search powered by Generative AI!

Exclude property from searchText

Vote:
 

Hi!

I've tried [JsonIgnore] on the property and 

SearchClient.Instance.Conventions.ForInstancesOf<PageDataBase>().ExcludeField(x => x.Ikon);

in Global.asax.cs, but reindexing and rebuilding still hits the pages with a string matching Ikon (string, css class icon)

 

When I inspect the index I find:

"SearchText$$string": "icon-user-md",

Why isn't Ikons value excluded from searchText, just from the document?

How can I solve this? Override searchText (!?)

 

Thanks in advance!

#73839
Aug 12, 2013 16:56
Vote:
 

Hi,

In admin mode you need to "unclick" that the property is searchable. Admin -> Page Types -> Select Page Type -> CLick property-> "unclick"

/Marcus

#73981
Aug 16, 2013 8:42
Vote:
 

Is there a way to do this by code in EPiServer 7 CMS MVC?

#73983
Aug 16, 2013 8:44
Vote:
 

Adding [Searchable(false)] worked nicely, thanks for pointing me in the right direction :)

#73984
Aug 16, 2013 8:56
Vote:
 

Your welcome. For others reading this post with the same concerns. Remember that you have to reindex after changing this for the changes to be propagted to the index.

#73989
Aug 16, 2013 10:03
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.