Configuring Search for Akumina Widget Content - Akumina Community

Configuring Search for Akumina Widget Content

You are here:

This document will provide the details for configuring search for version 5.5 and above.  For prior versions, please reference here.

With Akumina 5.5 Search, we query source lists for news, events, and other taxonomy route pages, we continue to use the indexer PageData_AK for virtual pages.

As the SharePoint search indexer does not index content rendered via Javascript on the page, Akumina uses an indexer that will add the rendered page content into the PageData_AK list, which can then be searched. In addition, the contents of the Akumina widgets must be properly indexed by search so that when a content term is found, the result will provide the site user a link to the page(s) on which the content resides, rather than a link to the SharePoint list which holds the content.

NOTE: If you are setting this up for your own custom designed site (versus the Akumina Foundation Site) that uses the Akumina Widgets, the indexing functionality must have been enabled by your developer as one of the “Page Lifecycle” steps (Index Page Data).  If you are not seeing the correct data, please verify that the function has been enabled.

Create New Manage Properties in the Search Schema

The managed properties can be configured at either site-collection level or tenant level: 

  1. If you have multiple delivery sites or envision having multiple delivery sites, we recommend configuring the managed properties at the tenant level. 
  2. If you have a stand-alone site or just one delivery site and will always have just this one site to search in – the managed properties can be configured at the site collection level.
  3.  Depending on which level you plan to configure the managed properties at, you will need the following permissions: 
  • Site collection level – Site collection administrator account (go to Site Settings >Site Collection Administration>Search Schema)
  • Tenant level – Tenant administrator account (go to Admin>SharePoint>More Features>Search>Open Search>Manage Search Schema)

As shown in the table below, edit an existing property or add a new one as mentioned below: 

Action Manage Property Type State Searchable Queryable Retrievable Safe Token Normalization Alias Mapping to Crawled properties Crawl properties
Edit RefinableStringXX no change no change no change no change no change no change no change SPModifiedBy no change Office:8
Edit RefinableStringXX no change no change no change no change no change no change no change SPCreatedBy no change Office:4
Edit RefinableStringXX no change no change no change no change no change no change no change SPSubsiteURL no change ows_SiteName
Edit RefinableDateSingleXX no change no change no change no change no change no change no change SPArchiveDate no change ows_q_DATE_Expires
ows_ArchiveDate
Edit RefinableDateSingleXX no change no change no change no change no change no change no change SPPublishDate no change ows_Start_x0020_date
ows_PublishDate
New SPAKLanguageCode Text Yes Yes Yes Yes Yes Yes Include content from the first crawled property that is not empty, based on the specified order ows_q_TEXT_AKLanguageCode
ows_AKLanguageCode
New SPDescription Text Yes Yes Yes Yes Yes Yes Include content from the first crawled property that is not empty, based on the specified order ows_r_MTXT_Seo-Description
ows_r_MTXT_Body
ows_r_MTXT_Summary
ows_r_MTXT_Description
New EventRecurrence Text Yes Yes Yes Yes Yes Yes Include content from the first crawled property that is not empty, based on the specified order ows_frecurrence

 

Note – Crawl Properties – ows_PublishDate and ows_ArchiveDate are new properties, so they will need to be added by following these steps  

  • Add a virtual page > Set Archive Date and Publish date >  Schedule publish. 
  • Check the entry in PageData_AK  
  • Reindex the list. 
  • The crawl property will be available and can be added. 

If an existing property needs to be mapped – Edit any RefinableString example RefinableString02 

Give alias as SPModifiedBy

Map crawl property Office:8, click on Add a Mapping to add crawl property 

Managed Property

The Managed property “ServerRedirectedURL” is the value that determines the URL for a given item – we can alter the URL presented to the user in the search results by adjusting this property.

We thus edit the mappings to crawled properties for the “ServerRedirectedURL” managed property.  We add in the crawled property for the FriendlyUrlSearch column, ows_FriendlyUrlSearch, and place it at the top of the mappings. If this value is present it is used in place of the SharePoint URL for the item (DispForm.aspx).

Verify PageData_AK List has items

On the root of the site collection, navigate to the list “PageData_AK”, and verify that there is content in this list.  Content gets added to this list by visiting site pages, so if there is no content try navigating around the site and then checking the list again.

ReIndex List PageData_AK

On the root of the site collection, navigate to the settings for the list “PageData_AK.

  • On the settings page click on “Advanced settings”.

 

  • Scroll down the page and select “Reindex List”

 

NOTE – It can take up to 24 hours before the Crawl will take effect on this site and return site search results.

 

Configuring the Search Management App

Refer the guidelines here to configure the new Search Management App

Excluding Certain Content from Search

The Akumina Foundation Site uses SharePoint for site search. There are 2 places where site search is used:

  • The Typeahead in the upper right of the site
  • The Search results page located at [site collection url]/Pages/Search.aspx

It is possible to exclude portions (widget instances) on any page from this index process, as this allows for use cases such as the following:

  • Do not index the main menu or footer
  • Do not index user specific content, such as a list of tasks.

Content exclusion can be done in 2 ways:

  • Attach the class aksearchexclude to an element; that element and its children will be excluded. Example:
    • <div class=”aksearchexclude”>

For Modern sites, only the css class method can be used to exclude content
  • Adding a formatted comment; content between will be excluded.

For the formatted comment, the widget instance code that is entered into the Content Editor web part must be surrounded with the following tags. When the indexer is run, the content between the tags will be left out.
<!-- aksearchexclude:start -->
[Widget instance code here]
<!-- aksearchexclude:end -->

The format must be exactly <!-- aksearchexclude:start -->, ensure the spaces and dashes are correct.

Example:

 

The comment method can also be used directly in the view instead of the web part.

Example:

Adding additional fields in the indexer

It is possible via a callback to modify or add in additional fields to the search indexer. For example, you have another field, PageCategory, in the PageData_AK list, where you want to capture additional data for the search. Using the function AkSearchExclusionCallback you can modify the data that gets entered into the list.

window.AkSearchExclusionCallback = function(model, currentPage){

// find a value in the page
var pageCategory = $(‘.someclass’).val();

// add a new field; this property name should match the list field name exactly
model.PageCategory = pageCategory;

// modify the html to be indexed.

model.Html = model.Html + ” some additional text”;

// Single Taxonomy Example
// In actual usage, you would draw this from somewhere.
var termValue = new SP.Taxonomy.TaxonomyFieldValue();
termValue.set_label(“CORPORATE”);
termValue.set_termGuid(“1f164abf-d4cc-4d51-8f06-32b7f72177f1”);
termValue.set_wssId(-1);
model.PageKeywords = termValue;

return model;
}

Views: 3405
//]]>