| @@ 111-127 (lines=17) @@ | ||
| 108 | $this->assertEquals('28.57%', $dateHistogramAggResult[2]['normalize_agg']['value_as_string']); |
|
| 109 | } |
|
| 110 | ||
| 111 | protected function _getIndexForTest(): Index |
|
| 112 | { |
|
| 113 | $index = $this->_createIndex(); |
|
| 114 | ||
| 115 | $index->addDocuments([ |
|
| 116 | new Document(1, ['date' => '2018-12-01T01:00:00', 'value' => 1]), |
|
| 117 | new Document(2, ['date' => '2018-12-01T10:00:00', 'value' => 2]), |
|
| 118 | new Document(3, ['date' => '2018-12-02T02:00:00', 'value' => 3]), |
|
| 119 | new Document(4, ['date' => '2018-12-02T15:00:00', 'value' => 4]), |
|
| 120 | new Document(5, ['date' => '2018-12-02T20:00:00', 'value' => 5]), |
|
| 121 | new Document(6, ['date' => '2018-12-03T03:00:00', 'value' => 6]), |
|
| 122 | ]); |
|
| 123 | ||
| 124 | $index->refresh(); |
|
| 125 | ||
| 126 | return $index; |
|
| 127 | } |
|
| 128 | } |
|
| 129 | ||
| @@ 138-152 (lines=15) @@ | ||
| 135 | $this->assertCount(0, $suggests['suggest1'][0]['options']); |
|
| 136 | } |
|
| 137 | ||
| 138 | protected function _getIndexForTest(): Index |
|
| 139 | { |
|
| 140 | $index = $this->_createIndex(); |
|
| 141 | $index->addDocuments([ |
|
| 142 | new Document(1, ['id' => 1, 'text' => 'GitHub']), |
|
| 143 | new Document(2, ['id' => 1, 'text' => 'Elastic']), |
|
| 144 | new Document(3, ['id' => 1, 'text' => 'Search']), |
|
| 145 | new Document(4, ['id' => 1, 'text' => 'Food']), |
|
| 146 | new Document(5, ['id' => 1, 'text' => 'Flood']), |
|
| 147 | new Document(6, ['id' => 1, 'text' => 'Folks']), |
|
| 148 | ]); |
|
| 149 | $index->refresh(); |
|
| 150 | ||
| 151 | return $index; |
|
| 152 | } |
|
| 153 | } |
|
| 154 | ||