IndexerElement
IndexerElement is a plain object which has a following properties:
idString - An identifier (should be unique), used as argument ofexecutefunction (optional, default isundefined)payloadAny - Extra payload, used as a argument ofexecutefunction (optional, default isundefined)primaryTextString - Primary text (required)secondaryTextString - Secondary text (optional)iconString - Icon URL, See Icon URL Format (optional, default isiconof package.json)redirectString - Redirection query (optional, default isundefined)groupString - Result group name (optional, default isundefined)
IndexerElement is used for synchronous searching items.
Both primaryText and secondaryText are used for user query matching.
primaryText has high-priority. secondaryText has lower-priority.
Example
...
const indexer = pluginContext.indexer;
function startup() {
const indexerElement = {
id: 'unique_value',
primaryText: 'Hello, World',
secondaryText: 'This is hello world description'
};
indexer.set('any-key', [indexerElement]);
}
...