2016-11-30 4 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 ("접두어 구")는 무엇을 의미합니까? – suraj

+0

그건 match_phrase_prefix 쿼리의 입력입니다 : https://www.elastic.co/guide/en/elasticsearch/ reference/5.0/query-dsl-match-query-phrase-prefix.html –

+0

고맙습니다. – suraj