EpiServer Find indexing Nav bar and full HTML markup of page

Vote:
 

Hi,

It appears that our FIND is Indexing the full HTML content of the page, for example:

ul class=\"main-nav-l2 main-nav-l2--dropdown-menu\">\r\n<li class=\"main-nav-l2__item main-nav-l2__item--dropdown\"><a class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" href=\"https://XXXXX/inspire/information-for-employers/\">

So, if I search for Dropdown then it returns all the pages on the site.

In my code I can filter by PageType but this has no effect.

In the CMS if I go to the FIND > Overiew section and filter by PageType and search for "DropDown" it brings back the same number of results as does my code so I know my code is working ok.

How can I stop FIND from indexing the full page mark up - or do I still need to add more filters to my code?

Im currently using ITypeSearch - I need to seach by different query filters.

Jon

#205460
Jul 11, 2019 12:11
Vote:
 

Hi Jon,

So when you search for drop-down using the Find Overview UI and expand an item from the list of search, how does the serialised data look? Where does the value of drop-down originate from in that indexed item? 

Typically an object's type is serialised and indexed in Find - is the markup stored as a property on the object type? Or is it rendered via views in the solution? 

Maybe check the conventions you have setup for your indexing - you should have an initialization module configured that specifies conventions. From there you can exclude specific fields on the object type from being indexed.

https://world.episerver.com/documentation/developer-guides/find/NET-Client-API/Indexing/

Interested to find out what your configuration currently is.

Thanks,

Paul

#205470
Jul 11, 2019 23:57
Vote:
 

The drop-down is indexed and stored in a "MegaMenu$string" element of the Json.

#205547
Jul 16, 2019 10:14
Vote:
 

I'll try and add a JsonIgnore on that field and see if that works

#205548
Jul 16, 2019 10:19
Vote:
 

So there is a property on your product type where you add this markup yeah?

If you take a look at this section of the documentation, it details how you can override default conventions:

https://world.episerver.com/documentation/developer-guides/commerce/search/find-integration/overriding-default-conventions/

By creating an initialization module you can exclude certain properties for individual types - this should help you remove that content from the index. 

Thanks,

Paul 

#205549
Jul 16, 2019 10:44