Skip to content

Instantly share code, notes, and snippets.

@horacioibrahim
Last active November 1, 2024 19:33
Show Gist options
  • Select an option

  • Save horacioibrahim/51bd32c19391dce6269dce586b579d05 to your computer and use it in GitHub Desktop.

Select an option

Save horacioibrahim/51bd32c19391dce6269dce586b579d05 to your computer and use it in GitHub Desktop.
Get user_id from Click from Elastic "Cancelar protesta"
// POST /events_new-dedicated-01_click/_search
{
"sort": [
{
"inserted_date": {
"order": "desc",
"format": "strict_date_optional_time",
"unmapped_type": "boolean"
}
}
],
"track_total_hits": false,
"fields": [
{
"field": "inserted_date",
"format": "strict_date_optional_time"
}
],
"size": 500,
"version": true,
"script_fields": {},
"stored_fields": [
"*"
],
"_source": ["user_id"],
"query": {
"bool": {
"must": [],
"filter": [
{
"exists": {
"field": "user_id"
}
},
{
"bool": {
"filter": [
{
"bool": {
"should": [
{
"term": {
"app_package_name.keyword": {
"value": "www.pesquisaprotesto.com.br"
}
}
}
],
"minimum_should_match": 1
}
},
{
"bool": {
"should": [
{
"term": {
"event_name.keyword": {
"value": "click"
}
}
}
],
"minimum_should_match": 1
}
},
{
"bool": {
"should": [
{
"term": {
"event_data.element_label.keyword": {
"value": "Cancelar protesto"
}
}
}
],
"minimum_should_match": 1
}
},
{
"bool": {
"should": [
{
"term": {
"relative_view.keyword": {
"value": "/consulta"
}
}
}
],
"minimum_should_match": 1
}
}
]
}
},
{
"range": {
"inserted_date": {
"format": "strict_date_optional_time",
"gte": "2024-10-31T19:00:00.000Z",
"lte": "2024-11-01T19:01:28.959Z"
}
}
}
],
"should": [],
"must_not": []
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment