Updates attributes for the index with the given name with values from the given sequence of SphinxAttributeUpdateItems.

Namespace: Gronewold.SphinxConnector
Assembly: Gronewold.SphinxConnector (in Gronewold.SphinxConnector.dll) Version: 2.8.0.26312 (2.8.0.26312)

Syntax

C#
public int UpdateAttributes<TUpdateable>(
	string index,
	params SphinxAttributeUpdate<TUpdateable>[] sphinxAttributeUpdates
)
where TUpdateable : IUpdateableType
Visual Basic
Public Function UpdateAttributes(Of TUpdateable As IUpdateableType) ( _
	index As String, _
	ParamArray sphinxAttributeUpdates As SphinxAttributeUpdate(Of TUpdateable)() _
) As Integer

Parameters

index
Type: System..::..String
The name of the index to update attributes for.
sphinxAttributeUpdates
Type: array<Gronewold.SphinxConnector..::..SphinxAttributeUpdate<(Of <(<'TUpdateable>)>)>>[]()[][]
The sphinx attribute update items.

Type Parameters

TUpdateable
The type of the attribute to update.

Return Value

The number of updated documents. Maybe 0.

Remarks

The unlicensed version only updates one document per attribute.

Examples

CopyC#
SphinxAttributeUpdate<SphinxInteger> realeaseYearAttributeUpdate = new SphinxAttributeUpdate<SphinxInteger>("release_year");
realeaseYearAttributeUpdate.AddUpdateValue(87, 1999);

int updateCount = sphinxClient.UpdateAttributes("sakila", realeaseYearAttributeUpdate);

Console.WriteLine("{0} documents(s) updated", updateCount);

Exceptions

ExceptionCondition
System..::..ArgumentExceptionindex or sphinxAttributeUpdates is empty.
System..::..ArgumentNullExceptionindex or sphinxAttributeUpdates is null.
System..::..InvalidOperationExceptionsphinxAttributeUpdates contains updates for multi value attributes, but Version is not >= 0.9.9.
Gronewold.SphinxConnector..::..SphinxClientException An error occured while executing the request. See exception message and inner exception for details.

See Also