ais-hits
You are reading the documentation for Angular InstantSearch v3, which is in beta. You can find the v2 documentation here.
<ais-hits // Optional parameters [transformItems]="function" ></ais-hits>
About this widget
The ais-hits
is used to display a list of results. To configure the number of hits to show, use either:
- the
ais-hits-per-page
widget, - or the
ais-configure
widget and setting thehitsPerPage
insearchParameters
.
Examples
1
<ais-hits></ais-hits>
Properties
transformItems
|
type: function
default: items => items
Optional
Receives the items, and is called before displaying them. Should return a new array with the same shape as the original array. Useful for mapping over the items to transform, and remove or reorder them. If you’re transforming an attribute using the |
||
Copy
|
Templates
hits
|
type: object[]
The matched hits from the Algolia API. You can leverage the highlighting feature of Algolia with the |
||
results
|
type: object
The complete response from the Algolia API. It contains the |
||
Copy
|
|||
insights
|
type: function
signature: (method: string, payload: object) => void
Sends insights events.
|
||
Copy
|
HTML output
1
2
3
4
5
6
7
8
9
10
11
12
13
<div class="ais-Hits">
<ul class="ais-Hits-list">
<li class="ais-Hits-item">
...
</li>
<li class="ais-Hits-item">
...
</li>
<li class="ais-Hits-item">
...
</li>
</ul>
</div>
Sending Click and Conversion events
Please refer to the guide on Sending Insight Events to learn about sending events from any InstantSearch widget.