2016-11-30 9 views
-4
// Summary: 
//  The text_phrase_prefix is the same as text_phrase, expect it allows for prefix 
//  matches on the last term in the text 

public QueryContainer MatchPhrasePrefix<T>(Func<MatchPhrasePrefixQueryDescriptor<T>, IMatchQuery> selector); 

誰かが何を説明してもらえますかFunc<MatchPhrasePrefixQueryDescriptor<T>, IMatchQuery>NEST APIの引数定義を説明してください

+0

使用するには、方法が一般的であり、NEST, the high level .NET Elasticsearch client.The client supports both fluent API and an object initializer syntax.の流暢APIの一部ですか?それは 'MatchPhrasePrefixでなければならないのですか?(.....' ???これはコンパイルできません。 – user3185569

+0

いいえ、クエリコンテナに指定されたメソッドの定義です。 MtachPhrasePrefix (Func 、IMatchQuery> selector) – suraj

答えて

0

これは、引数として代理人/メソッド/ラムダ式を引数として受け取り、MatchPhrasePrefixQueryDescriptor<T>を引数として受け取り、IMatchQueryインスタンスを返します。

他の人が指摘したようにそれはMatchPhrasePrefix<T>

これが本当の方法です

public class Document 
{ 
    public string Property1 { get; set; } 
} 

var searchResponse = client.Search<Document>(s => s 
    .Query(q => q 
     .MatchPhrasePrefix(p => p 
      .Field(f => f.Property1) 
      .Query("Prefix phrase") 
     ) 
    ) 
); 
+0

.Query( "Prefix phrase")とは何ですか? – suraj

+0

これは 'match_phrase_prefix'クエリの入力です:https://www.elastic.co/guide/en/elasticsearch/ reference/5.0/query-dsl-match-query-phrase-prefix.html –

+0

ありがとうございます。 – suraj

関連する問題