I want to keep track of how often an entity is being hit by an elasticsearch hit.
For example, let's say I had an index like this:
{
"company":"google"
},
{
"company":"amazon"
},
{
"company":"goodyear"
}
and I do a search query like "goo" that returns google
and goodyear
. Is there a way I can keep track over time of how often an entity is getting hit?
Something like
{
"company":"google",
"tracking_num_hits": 1
},
{
"company":"amazon",
"tracking_num_hits": 0
},
{
"company":"goodyear",
"tracking_num_hits": 1
}
and if I then search "amazon" it updates to
{
"company":"google",
"tracking_num_hits": 1
},
{
"company":"amazon",
"tracking_num_hits": 1
},
{
"company":"goodyear",
"tracking_num_hits": 1
}
Is there a way for elasticsearch to do this, and if not what is the best way to track this on the backend?
question from:
https://stackoverflow.com/questions/65836120/is-there-a-way-to-track-how-often-an-entity-is-getting-hit-in-elasticsearch 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…