/// <summary>
        /// POST /_all/employee/_search?typed_keys=true
        /// </summary>
        public void AllIndex()
        {
            client.Search<employee>(s => s.AllIndices().Query(q => q.Match(m => m.Field(f => f.last_name).Query("狮"))));
        }

        /// <summary>
        /// POST /employee%2Ctest01/employee/_search?typed_keys=true&pretty=true
        /// </summary>
        public void MultiIndex()
        {
            client.Search<employee>(s => s.Index("employee,test01").Pretty());
        }

        /// <summary>
        /// POST /employee%2Ctest01%2Ctest02/employee%2Cemployee2/_search?typed_keys=true&pretty=true
        /// </summary>
        public void MultiType()
        {
            client.Search<employee>(s => s.Index("employee,test01,test02").Type("employee,employee2").Pretty());
        }

        /// <summary>
        /// page
        /// </summary>
        public void Page()
        {
            var request = new SearchRequest("employee", "employee");

            request.From = 0;
            request.Size = 10;
            request.Query = new QueryContainer();

            client.Search<employee>(request);
            //client.Search<employee>(s=>s.From(0).Size(10));
        }

  

posted on 2019-09-19 12:15  chester·chen  阅读(555)  评论(0编辑  收藏  举报