Highlighting Entities in the SBA Preview
In this chapter, you will highlight entities in the Mint document preview.
Backend Configuration
When indexing data, you have to set up entities for extraction, which are stored in the Sinequa index(es).
In the Sinequa demo server, there are multiple entities extracted for you.
In this exercise, you will highlight two entities: entity13, using the column alias exectitle, and entity14, using the column alias finance.
As a reminder, use of column aliases is a best practice, and they are created in the Mint Query Web Service.
Additionally, a Preview Web Service must be configured to define the highlights to display. This web service is then attached to your app.
Modifying the highlight.config.ts File
-
Go to src > app > highlight.config.ts.
-
Add the following to the PREVIEW_HIGHLIGHTS constant:
{
name: 'exectitle',
color: 'black',
bgColor: '#F5DCD5'
},
{
name: 'finance',
color: 'black',
bgColor: '#59ED78'
}, -
Save your changes.
If you followed the Connecting to Sinequa tutorial, Mint should recompile automatically. If not, run the npm run start
command in the terminal.
-
Go to your Mint application and execute a search for Morgan Stanley.
-
Click on the first result (anywhere other than the title) to display the HTML document preview.
- In the preview panel, toggle entity higlighting on by clicking the lightbulb icon.
You should see finance terms (e.g., investment, revenue) highlighted in green:
You should also see executive titles (e.g., CEO, chief operating officer) highlighted in pink: