Click or drag to resize
SphinxClientAddQuery Method
Adds a new query with the current SearchOptions to the search request. If no index name is given, the query will be executed against all indexes. If a comment is provided it will be written to the query log by searchd.

Namespace: SphinxConnector.NativeApi
Assembly: SphinxConnector (in SphinxConnector.dll) Version: 3.12.6
Syntax
public void AddQuery(
	string query,
	string indexName = "*",
	string comment = ""
)

Parameters

query
Type: SystemString
The query to add.
indexName (Optional)
Type: SystemString
The name of the index to search in.
comment (Optional)
Type: SystemString
A comment for this query, which will be written to the sphinx query log.
Exceptions
ExceptionCondition
ArgumentExceptionindexName or query is empty.
ArgumentNullExceptionquery or indexName is null.
InvalidOperationExceptionSortMode has been set to a value other than Relevance, but SortBy is empty. orSortMode has been set to Relevance, but SortBy is not empty.
Remarks
Note that the index name is case-sensitive!
After succesful execution, the query is removed from the (internal) list of scheduled queries. In case of an exception, the query is only removed if the exception was not thrown due to a network problem. In case of a network problem, you can call RunQueries to execute the query again or call ClearQueries to remove all queries from the list scheduled queries.
See Also