We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[code]
class TestListIndex extends BaseIndex { public $NAME = ''; public function __construct(Client $client = null) { parent::__construct($client); $this->NAME = $this->getName(); } public function getName($index = 'test_list_index') { return $this->getIndexName($index); } protected $mapping = [ '_source' => [ 'enabled' => true ], 'properties' => [ 'id' => [ 'type' => self::TYPE_INTEGER, ], 'user_id' => [ 'type' => self::TYPE_INTEGER, ], 'type' => [ 'type' => self::TYPE_INTEGER, ], 'num' => [ 'type' => self::TYPE_DOUBLE, ], 'before' => [ 'type' => self::TYPE_DOUBLE, ], 'after' => [ 'type' => self::TYPE_DOUBLE, ], 'created_at' => [ 'type' => 'date', "format" => self::FORMAT_DATETIME ], 'updated_at' => [ 'type' => 'date', "format" => self::FORMAT_DATETIME ] ] ]; }
#[GetMapping] public function list2() { $size = (int)$this->request->input('size', 2); $page = (int)$this->request->input('page', 0); $builder = jtarApp()->get(ClientBuilderFactory::class)->create(); $client = $builder->setHosts([env('ES_HOST')])->build(); $params = [ 'index' => 'shiyan_test_list_index', 'body' => [ 'sort' => [ 'id' => [ 'order' => 'desc' ] ], 'from' => $page, 'size' => $size, 'query' => [ 'bool' => [ 'filter' => [ 'term' => [ 'type' => 0 ] ] ] ], // 'query' => [ // 'bool' => [ // 'must' => [ // 'match' => [ // 'type' => 0 // ] // ] // ] // ], // 'track_scores' => true, // 'preference' => '_local', ], ]; $result = $client->search($params); return $this->success('list', $result); }
page = 10, size = 0 or page = 1,size = 100 The sorting is correct
page = 1, size = 10 The sorting is not right
The text was updated successfully, but these errors were encountered:
No branches or pull requests
[code]
course
page = 10, size = 0 or page = 1,size = 100 The sorting is correct
page = 1, size = 10 The sorting is not right
expect
The text was updated successfully, but these errors were encountered: