NEST 多IndexType与分页

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

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

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

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

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

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

  

你可能感兴趣的:(NEST 多IndexType与分页)