lib/Elastica/IndexTemplate.php 1 location
|
@@ 78-84 (lines=7) @@
|
| 75 |
|
* |
| 76 |
|
* @return bool True if index exists |
| 77 |
|
*/ |
| 78 |
|
public function exists() |
| 79 |
|
{ |
| 80 |
|
$response = $this->request(Request::HEAD); |
| 81 |
|
$info = $response->getTransferInfo(); |
| 82 |
|
|
| 83 |
|
return (bool) ($info['http_code'] == 200); |
| 84 |
|
} |
| 85 |
|
|
| 86 |
|
/** |
| 87 |
|
* Returns the index template name. |
lib/Elastica/Index.php 1 location
|
@@ 283-289 (lines=7) @@
|
| 280 |
|
* |
| 281 |
|
* @return bool True if index exists |
| 282 |
|
*/ |
| 283 |
|
public function exists() |
| 284 |
|
{ |
| 285 |
|
$response = $this->getClient()->request($this->getName(), Request::HEAD); |
| 286 |
|
$info = $response->getTransferInfo(); |
| 287 |
|
|
| 288 |
|
return (bool) ($info['http_code'] == 200); |
| 289 |
|
} |
| 290 |
|
|
| 291 |
|
/** |
| 292 |
|
* @param string|array|\Elastica\Query $query |