 | IFulltextQuery<TDocument>.ToList Method (QueryMetadata) |
Execute this query and return the list of results along with query metadata.
Namespace: SphinxConnector.FluentApiAssembly: SphinxConnector (in SphinxConnector.dll) Version: 3.12.6
SyntaxIList<TDocument> ToList(
out QueryMetadata metadata
)
Function ToList (
<OutAttribute> ByRef metadata As QueryMetadata
) As IList(Of TDocument)
Parameters
- metadata
- Type: SphinxConnector.FluentApi.QueryMetadata
The metadata for this query.
Return Value
Type:
IList<TDocument>The results of the query.
ExceptionsException | Condition |
---|
FulltextException | Occurs when there is an error during the execution of the query. |
Examples
Suppose you have the following class representing a document in your index:
public class Product
{
public int Id { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public decimal Price { get; set; }
public int CategoryId { get; set; }
public int VendorId { get; set; }
public int Weight { get; set; }
}
And you want to retrieve the meta data along with the query:
using (IFulltextSession fulltextSession = fulltextStore.StartSession())
{
QueryMetadata metadata;
var results = fulltextSession.Query<Product>().
Match("a product").
ToList(out metadata);
}
See Also