Search: Akumina Framework Strategy - akumina/AkuminaTraining GitHub Wiki
Akumina Foundation 3.3 and later
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
As the SharePoint search indexer does not index rendered content rendered via Javascript on the page, we use an indexer that will add the rendered page content to a list, which we then search.
The indexer step is located at CoreSteps.IndexPageData and runs as one of the last steps in the page life cycle. This ensures the component runs after all widgets have been rendered on the page, allowing it to get the page content. This then calls into Akumina.AddIn.JsPageData to write the page content into the list PageData_AK at the site collection root, along with the site id and the language id, if multi lingual is turned on (in 3.4 and above).
The page data is stored in the custom list PageData_AK in the root site of the site collection. The list has the following structure:
FieldName | Type | Properties | Description |
---|---|---|---|
Title | Single line of text | Stores the absolute page url. | |
HTML | Multiple lines of text | Plain Text | Stores the rendered page content. |
PageDataSiteId | Single line of text | Stores the web id for the site the page is in. | |
PageDataTitle | Single line of text | Stores the rendered page title, as reported in the title tag. | |
AkId | Number | Default: 1 |
NOTE: Only if multilingual enabled This is the column that links the items together from a multilingual standpoint. All language versions will have the same AkId. |
AkLanguageCode | Single line of text | Max: Default value |
NOTE: Only if multilingual enabled The ll-cc code for the language of the item, example en-us or fr-fr. |
AkLanguageId | Number | Default: 1 |
NOTE: Only if multilingual enabled The language id code for the language of the item, example 1033 for English (US) or 1034 for Spanish (ES) |
With the search data in this list, we use managed properties on the PageDataSiteId and PageDataTitle columns (and AkLanguageId if present) to search for content.
To find documents and pages, it is necessary to use both the traditional SharePoint search for documents, as well as searching the PageData_AK list for page content. Then we can apply a scope to the same. The relation ship is shown in the diagram below.
The result of these three clauses yields us the search results to be shown.
Our search uses 2 scopes, denoting the breadth of what structures the search should look in. These attach specific conditions to the typeahead.
Scope | Description | Condition |
---|---|---|
Current Site | Information in the current web is searched. | ((ContentType=Item PageDataSiteId:[web id]) OR (ContentType<>Item WebId:[web id])) |
Entire System | Information in the entire site collection is searched. | SPSiteURL:{SiteCollectionURL} |