my_index = client.init_index('contacts')
my_index.save_object({
firstname: "Jimmie",
lastname: "Barninger",
company: "California Paint"
})
<div id="searchbox"></div>
<div id="refinement"></div>
<div id="hits"></div>
<script>
const {
searchBox,
hits
} = instantsearch.widgets;
search.addWidgets([
searchBox({
container: "#searchbox"
}),
hits({
container: "#hits"
}),
refinementList({
container: "#refinement",
attribute: "company"
}),
]);
search.start();
</script>
$insights = AlgoliaAlgoliaSearchInsightsClient::create(
'ALGOLIA_APP_ID',
'ALGOLIA_API_KEY'
);
$insights->user("user-123456")->clickedObjectIDsAfterSearch(
'Product Clicked',
'products',
['9780545139700'],
[7],
'cba8245617aeace44'
);