A boolean field query matches documents which have a boolean field which corresponds to the requested boolean value.
Inheritance: FtsQueryBase
コード例 #1
0
        public void Export_Omits_Field_If_Not_Provided()
        {
            var query = new BooleanFieldQuery(true);

            var expected = JsonConvert.SerializeObject(new
            {
                @bool = true
            }, Formatting.None);

            Assert.AreEqual(expected, query.Export().ToString(Formatting.None));
        }
コード例 #2
0
        public void Export_Returns_Valid_Json()
        {
            var query = new BooleanFieldQuery(true)
                .Field("field");

            var expected = JsonConvert.SerializeObject(new
            {
                @bool = true,
                field = "field"
            }, Formatting.None);

            Assert.AreEqual(expected, query.Export().ToString(Formatting.None));
        }