Skip to content

Commit

Permalink
Update the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
babenkoivan committed Nov 25, 2022
1 parent 259d2c9 commit e7eaf95
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ $total = $searchResult->total();
// get the corresponding hits
$hits = $searchResult->hits();

// every hit provides access to the related index name, the score, the document, the highlight and the inner hits
// every hit provides access to the related index name, the score, the document, the highlight and more
// in addition, you can get a raw representation of the hit
foreach ($hits as $hit) {
$indexName = $hit->indexName();
Expand All @@ -484,16 +484,23 @@ foreach ($hits as $hit) {
$innerHits = $hit->innerHits();
$innerHitsTotal = $hit->innerHitsTotal();
$raw = $hit->raw();

// get an explanation
$explanation = $searchResult->explanation();

// every explanation includes a value, a description and details
// it is also possible to get its raw representation
$value = $explanation->value();
$description = $explanation->description();
$details = $explanation->details();
$raw = $explanation->raw();
}

// get suggestions
$suggestions = $searchResult->suggestions();

// get aggregations
$aggregations = $searchResult->aggregations();

// get an explanation
$explanation = $searchResult->explanation();
```

### Connection
Expand Down

0 comments on commit e7eaf95

Please sign in to comment.