Click or drag to resize
SphinxClientUpdateAttributesTUpdateable Method (String, SphinxAttributeUpdateTUpdateable)
Updates attributes for the index with the given name with values from the given sequence of SphinxAttributeUpdateItems.

Namespace: SphinxConnector.NativeApi
Assembly: SphinxConnector (in SphinxConnector.dll) Version: 3.12.6
Syntax
public int UpdateAttributes<TUpdateable>(
	string index,
	params SphinxAttributeUpdate<TUpdateable>[] sphinxAttributeUpdates
)
where TUpdateable : IUpdateableType

Parameters

index
Type: SystemString
The name of the index to update attributes for.
sphinxAttributeUpdates
Type: SphinxConnector.NativeApiSphinxAttributeUpdateTUpdateable
The sphinx attribute update items.

Type Parameters

TUpdateable
The type of the attribute to update.

Return Value

Type: Int32
The number of updated documents. Maybe 0.
Exceptions
ExceptionCondition
ArgumentExceptionindex or sphinxAttributeUpdates is empty.
ArgumentNullExceptionindex or sphinxAttributeUpdates is null.
SphinxClientException An error occured while executing the request. See exception message and inner exception for details.
Remarks
The unlicensed version only updates one document per attribute.
Examples
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);
See Also