mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Enterprise Search][Behavioral Analytics] Update trackSearch and trackSearchClick params (#156735)
Update the filters, results.items, page example for: - ✔️ trackSearch - ✔️ trackSearchClick <img width="853" alt="image" src="https://user-images.githubusercontent.com/17390745/236317257-0eb0c272-c013-4287-8cf2-c77adf425422.png"> <img width="853" alt="image" src="https://user-images.githubusercontent.com/17390745/236316701-ffa06772-e69a-4273-98bf-13c18e1a378e.png">
This commit is contained in:
parent
9b6cbfa0bb
commit
0e259c8598
2 changed files with 19 additions and 8 deletions
|
@ -173,15 +173,26 @@ const SearchResult = ({ hit }) => {
|
|||
const clickHandler = () => {
|
||||
trackSearchClick({
|
||||
document: { id: hit.id, index: "products" },
|
||||
page: {
|
||||
url: "http://my-website.com/products/123"
|
||||
},
|
||||
search: {
|
||||
query: "search term",
|
||||
filters: [],
|
||||
filters: {},
|
||||
page: { current: 1, size: 10 },
|
||||
results: {
|
||||
results: {
|
||||
items: [
|
||||
{ id: "123", index: "products" }
|
||||
{
|
||||
document: {
|
||||
id: "123",
|
||||
index: "products",
|
||||
},
|
||||
page: {
|
||||
url: "http://my-website.com/products/123",
|
||||
},
|
||||
},
|
||||
],
|
||||
total_results: 10
|
||||
total_results: 10
|
||||
},
|
||||
sort: {
|
||||
name: "relevance",
|
||||
|
|
|
@ -115,10 +115,10 @@ window.elasticAnalytics.createTracker({
|
|||
{`window.elasticAnalytics.trackSearch({
|
||||
search: {
|
||||
query: "laptop",
|
||||
filters: [
|
||||
{ field: "brand", value: ["apple"] },
|
||||
{ field: "price", value: ["1000-2000"] },
|
||||
],
|
||||
filters: {
|
||||
brand: ["apple"],
|
||||
price: ["1000-2000"],
|
||||
},
|
||||
page: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue