NEST 多IndexType與分頁

       /// <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));
        }

  

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章