fixed solr configs after massive update broke it all
This commit is contained in:
@@ -95,8 +95,8 @@ class Base extends ControllerBase {
|
||||
"@count" => $resp['count'],
|
||||
"@keys" => $this->keys
|
||||
));
|
||||
|
||||
|
||||
|
||||
|
||||
$resp['options'] = $this->query->getOptions();
|
||||
|
||||
// $items = [];
|
||||
@@ -140,9 +140,9 @@ class Base extends ControllerBase {
|
||||
$node_view_builder = \Drupal::entityTypeManager()->getViewBuilder('node');
|
||||
|
||||
$items = $this->results->getResultItems();
|
||||
|
||||
$this->items = [];
|
||||
foreach ($items as $item) {
|
||||
// \Drupal::logger('materio_sapi')->notice(print_r($item, true));
|
||||
try {
|
||||
/** @var \Drupal\Core\Entity\EntityInterface $entity */
|
||||
$entity = $item->getOriginalObject()->getValue();
|
||||
|
@@ -38,11 +38,11 @@ class FormAutocomplete extends ControllerBase {
|
||||
|
||||
// Set fulltext search keywords and fields.
|
||||
$query->keys($typed_string);
|
||||
$query->setFulltextFields(['name']);
|
||||
$query->setFulltextFields(['name', 'synonyms']);
|
||||
|
||||
// Set additional conditions.
|
||||
// $query->addCondition('status', 1)
|
||||
// ->addCondition('author', 1, '<>');
|
||||
$query->addCondition('status', 1);
|
||||
// ->addCondition('author', 1, '<>');
|
||||
|
||||
// Restrict the search to specific languages.
|
||||
// $query->setLanguages(['de', 'it']);
|
||||
@@ -60,14 +60,15 @@ class FormAutocomplete extends ControllerBase {
|
||||
|
||||
$results = $query->execute();
|
||||
|
||||
\Drupal::logger('materio_sapi')->notice($results->getResultCount());
|
||||
// $items = $results->getResultItems();
|
||||
// \Drupal::logger('materio_sapi')->notice($results->getResultCount());
|
||||
// \Drupal::logger('materio_sapi')->notice(implode(', ', array_keys($items)));
|
||||
|
||||
$response = [];
|
||||
foreach ($results as $result) {
|
||||
// \Drupal::logger('materio_sapi')->notice(print_r($result->getField('tid')->getValues(),true));
|
||||
// \Drupal::logger('materio_sapi')->notice(print_r($result->getField('name')->getValues(),true));
|
||||
// \Drupal::logger('materio_sapi')->notice(implode(', ', array_keys($result)));
|
||||
$tid = $result->getField('tid')->getValues()[0];
|
||||
$term_name = $result->getField('name')->getValues()[0]->getText();
|
||||
$response[] = [
|
||||
|
Reference in New Issue
Block a user