SoftadminApi.EnterpriseSearchIndex_InsertUpdate

Type: Stored procedure

Adds or updates data for one or more rows in the Enterprise Search index. You can both use this procedure for partial updates of the index when an entry has changed and for the initial batch import when you start using Enterprise Search and all rows in the table need to be imported.

Expects two tables with the data to insert.

CREATE TABLE #SearchEntry
(
	RowId bigint not null,
	SecurityGroupId int null
)

CREATE TABLE #SearchText
(
	RowId bigint not null,
	Text nvarchar(max) null,
	IsHtml bit not null,
	Weight int not null,
	WeightExact int not null
)

RowId

Your own primary key. This RowId will later be passed to the entity's column function when presenting search results.

SecurityGroupId

If you use row-level permissions for search data, the id of a search group that the user must belong to (see SoftadminApi.UserSecurityGroup) to view this entry.

Leave as NULL to have everyone with permission to view the row's entity permission to view the row.

Weight

How important a partial match on this text is relative to the other in the same table. For example, if a table has the columns FirstName and Comment then you could insert FirstName with a weight of 1000 and Comment with a weight of 1 to prioritize search results that match the name.

WeightExact

How important an exact match on this text is relative to the other in the same table. If column is missing or NULL Weight + 1 is used.

Parameters

@SchemaName mandatory sysname
@TableName mandatory sysname