Click or drag to resize

IFulltextQueryTDocumentSelectTResult Method

Project the results of this query into a new form.

Namespace:  SphinxConnector.FluentApi
Assembly:  SphinxConnector (in SphinxConnector.dll) Version: 5.3.0
Syntax
IFulltextQuery<TResult> Select<TResult>(
	Expression<Func<TDocument, TResult>> selector
)

Parameters

selector
Type: System.Linq.ExpressionsExpressionFuncTDocument, TResult
A transform function to apply to each element.

Type Parameters

TResult
The projected type.

Return Value

Type: IFulltextQueryTResult
The current instance.
Examples
Suppose you have the following class representing a document in your index:
And you want to select only the name and price of a product:
using (IFulltextSession fulltextSession = fulltextStore.StartSession())
{
    var results = fulltextSession.Query<Product>().
                                  Match("a product").
                                  Select(p => new
                                  {
                                      p.Name,
                                      p.Price
                                  }).ToList();
 }
See Also