Skip to content

Commit

Permalink
Fix formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbachhuber committed Apr 24, 2020
1 parent 34e23d9 commit 9d6b885
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions includes/class-solrpower-wp-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@ function posts_request( $request, $query ) {
$this->facets = $search->getFacetSet()->getFacets();
}

$this->highlighting = $search->getHighlighting();
$search = $search->getData();
$this->highlighting = $search->getHighlighting();

$search = $search->getData();

$search_header = $search['responseHeader'];
$search = $search['response'];
Expand Down Expand Up @@ -268,22 +268,22 @@ private function parse_results( $search ) {
continue;
}

if ( 'solr_id' === $key ) {
if ( $this->highlighting ) {
$highlighted_doc = $this->highlighting->getResult($value);
if ( 'solr_id' === $key ) {
if ( $this->highlighting ) {
$highlighted_doc = $this->highlighting->getResult( $value );

if ( $highlighted_doc ) {
$snippet = '';
if ( $highlighted_doc ) {
$snippet = '';

foreach ( $highlighted_doc as $field => $highlight ) {
$snippet .= implode(' ... ', $highlight);
}
foreach ( $highlighted_doc as $field => $highlight ) {
$snippet .= implode( ' ... ', $highlight );
}

$post->excerpt = $snippet;
continue;
}
}
}
$post->excerpt = $snippet;
continue;
}
}
}

$post->$key = $value;
}
Expand Down

0 comments on commit 9d6b885

Please sign in to comment.