Couchbase.Search.Queries.Simple.MatchPhraseQuery.Export C# (CSharp) 메소드

Export() 공개 메소드

public Export ( ) : Newtonsoft.Json.Linq.JObject
리턴 Newtonsoft.Json.Linq.JObject
        public override JObject Export()
        {
            var json = base.Export();
            json.Add(new JProperty("match_phrase", _matchPhrase));

            if (!string.IsNullOrEmpty(_field))
            {
                json.Add(new JProperty("field", _field));
            }
            if (!string.IsNullOrEmpty(_analyzer))
            {
                json.Add(new JProperty("analyzer", _analyzer));
            }

            return json;
        }
    }

Usage Example

        public void Export_Omits_Field_If_Not_Provided()
        {
            var query = new MatchPhraseQuery("phrase");

            var expected = JsonConvert.SerializeObject(new
            {
                match_phrase = "phrase",
            }, Formatting.None);

            Assert.AreEqual(expected, query.Export().ToString(Formatting.None));
        }
All Usage Examples Of Couchbase.Search.Queries.Simple.MatchPhraseQuery::Export