1
我有:Elasticsearch.NET NEST對象初始化語法
var result = _client.Search<ElasticFilm>(new SearchRequest("blaindex", "blatype")
{
From = 0,
Size = 100,
Query = titleQuery || pdfQuery,
Source = new SourceFilter
{
Include = new []
{
Property.Path<ElasticFilm>(p => p.Url),
Property.Path<ElasticFilm>(p => p.Title),
Property.Path<ElasticFilm>(p => p.Language),
Property.Path<ElasticFilm>(p => p.Details),
Property.Path<ElasticFilm>(p => p.Id)
}
},
Timeout = "20000"
});
而且我嘗試添加高亮過濾器,但我不認爲熟悉的對象初始化(OIS) C#語法。我檢查了NEST official pages和SO,但似乎無法返回專門針對(OIS)的任何結果。
我可以看到Nest.SearchRequest類中的Highlight屬性,但我沒有足夠的經驗(我猜)只是簡單地從那裏構造我需要的東西 - 一些示例和解釋如何在OIS中使用熒光筆會很熱!