Universal Search Extensibility and Customization

Introduction

This page explains how to customize the appearance of the Universal Search in applications user interface. Also, it explains how to add custom search results, whose origin is not a GeneXus transaction.

Basic Objects

The universal search implementation can be changed by the GeneXus developer, both to change the appearance of interfaces and to add controls or optimizations and extensions specific to the scenario being solved.
K2BESSearchBasicObjects
Search basic objects

The objects involved in this solution perform the following functions:
  1. K2BGetSearchableEntities: It returns the list of entities included in the search index.
  2. K2BGetSearchableEntitiesCustomImplementation: It allows the GeneXus developer to extend the list of entities included in the search index.
  3. K2BGetSearchDataCustomImplementation: It allows the GeneXus developer to extend the extraction of data for results that don't belong to any transaction generated with K2BTools. This procedure is useful when the developer uses the engine to index documents outside KB transactions.
  4. K2BGetSearchResultFromData: This object should not be modified by the developer, because it is automatically maintained by K2BTools. This procedure is responsible for determining the contents to be displayed from the result returned by the engine.
  5. K2BHeaderModernSearch: It is the header for the K2BModern theme included in the search field. It can be modified to adapt the header to the corporate theme of the KB.
  6. K2BToolsSearchResult: It is the SDT used to keep in memory the results to display.
  7. K2BTabbedViewForLayoutModernSearch: It contains the necessary implementation to separate search results in tabs by entity.
  8. K2BToolsGetSearchResults: It obtains the results to display in the user interface. It can be extended to add security checks or other features.
  9. K2BToolsIndexAdmin: It's a sample Web Panel that allows the system administrator to force the regeneration of the index within the engine.
  10. K2BToolsSearchResult: It's the main interface to show search results. It can be changed by the user to adapt the interface or add more options.
  11. K2BToolsSearchResultEntityWC: It's the interface that displays the results for each entity. It can be changed by the user to adapt the interface or add more options.
  12. SearchableTransactions: It is used by the procedure “K2BGetSearchableEntities” to send the list of searchable entities.

UI Customization

To customize the UI, the developer must modify the web panels included in the previous sections.

Extensibility

Results not included in GeneXus transactions can be added to this search interface. To do so, the mechanism described in the corresponding GeneXus documentation must be used.
In addition to following these steps, the procedures “K2BGetSearchableEntitiesCustomImplementation” and “K2BGetSearchDataCustomImplementation” have to be updated. In these procedures, logic must be added to:
  1. K2BGetSearchableEntitiesCustomImplementation: Include the new entity in the list of entities enabled for the user. This will add it to the global results view, and will add a new tab for the entity. In order to include it, the permissions of the user authenticated in the system must be considered.
  2. K2BGetSearchDataCustomImplementation: Obtain information to display on screen for a certain result. More specifically, output parameters must be completed to indicate a title, description and image.