Skip to content

Commit

Permalink
Remove add/set/get class methods to move to core
Browse files Browse the repository at this point in the history
  • Loading branch information
Firesphere committed Oct 22, 2023
1 parent b2144ce commit 8623605
Showing 1 changed file with 4 additions and 45 deletions.
49 changes: 4 additions & 45 deletions src/Indexes/ElasticIndex.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,9 @@ abstract class ElasticIndex extends CoreIndex
protected $clientQuery;

/**
* @var array Classes to index
* Set-up of core and fields through init
* @throws NotFoundExceptionInterface
*/
protected $class = [];

public function __construct()
{
$this->client = Injector::inst()->get(ElasticCoreService::class)->getClient();
Expand All @@ -66,7 +65,7 @@ public function __construct()
}

/**
* @param HTTPRequest|null $request
* @param HTTPRequest $request
* @return bool
* @throws ClientResponseException
* @throws MissingParameterException
Expand Down Expand Up @@ -115,29 +114,6 @@ public function indexExists(): bool

abstract public function getIndexName(): string;

/**
* Get classes
*
* @return array
*/
public function getClasses(): array
{
return $this->class;
}

/**
* Set the classes
*
* @param array $class
* @return $this
*/
public function setClasses($class): self
{
$this->class = $class;

return $this;
}

/**
* @param ElasticQuery $query
* @return SearchResult
Expand All @@ -150,24 +126,7 @@ public function doSearch(ElasticQuery $query)

$result = $this->client->search($this->clientQuery);

$result = new SearchResult($result, $query, $this);

return $result;
}

/**
* Add a class to index or query
* $options is not used anymore, added for backward compatibility
*
* @param $class
* @param array $options unused
* @return $this
*/
public function addClass($class, $options = []): self
{
$this->class[] = $class;

return $this;
return new SearchResult($result, $query, $this);
}

public function getClientQuery(): array
Expand Down

0 comments on commit 8623605

Please sign in to comment.