Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

schema updates #170

Merged
merged 5 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 24 additions & 93 deletions src/main/resources/events-mapping.json
Original file line number Diff line number Diff line change
@@ -1,114 +1,45 @@
{
"properties": {
"action_name": {
"type": "keyword"
},
"user_id": {
"type": "keyword"
},
"query_id": {
"type": "keyword"
},
"page_id": {
"type": "keyword"
},
"message": {
"type": "keyword"
},
"message_type": {
"type": "keyword"
},
"application": { "type": "keyword", "ignore_above": 256 },
"action_name": { "type": "keyword", "ignore_above": 100 },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we roll these into the spec then as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought they were???

"client_id": { "type": "keyword", "ignore_above": 100 },
"message": { "type": "keyword", "ignore_above": 1024 },
"message_type": { "type": "keyword", "ignore_above": 100 },
"timestamp": {
"type": "date",
"format":"rfc3339_lenient||epoch_millis",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey, that's cool!

"ignore_malformed": true,
"doc_values": true
},
"event_attributes": {
"dynamic": true,
"properties": {
"user_name": {
"type": "keyword"
},
"user_id": {
"type": "keyword"
},
"email": {
"type": "keyword"
},
"price": {
"type": "float"
},
"ip": {
"type": "ip",
"ignore_malformed": true
},
"browser": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"position": {
"properties": {
"ordinal": {
"type": "integer"
},
"x": {
"type": "integer"
},
"y": {
"type": "integer"
},
"page_depth": {
"type": "integer"
},
"scroll_depth": {
"type": "integer"
},
"trail": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
"ordinal": { "type": "integer" },
"x": { "type": "integer" },
"y": { "type": "integer" },
"page_depth": { "type": "integer" },
"scroll_depth": { "type": "integer" },
"trail": { "type": "text",
"fields": { "keyword": { "type": "keyword", "ignore_above": 256 }
}
}
}
},
"object": {
"properties": {
"key_value": {
"type": "keyword"
},
"object_id": {
"type": "keyword"
},
"object_type": {
"type": "keyword"
},
"transaction_id": {
"type": "keyword"
},
"name": {
"type": "keyword"
},
"description": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"to_user_id": {
"type": "keyword"
},
"object_detail": {
"type": "text"
}
"internal_id": { "type": "keyword" },
"object_id": { "type": "keyword", "ignore_above": 256 },
"object_id_field": { "type": "keyword", "ignore_above": 100 },
"name": { "type": "keyword", "ignore_above": 256 },
"description": { "type": "text",
"fields": { "keyword": { "type": "keyword", "ignore_above": 256 } }
},
"object_detail": { "type": "flat_object" }
}
}
}
}
}
}
}
38 changes: 11 additions & 27 deletions src/main/resources/queries-mapping.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,15 @@
{
"dynamic": false,
"properties": {
"timestamp": {
"type": "date"
},
"query_id": {
"type": "keyword"
},
"query": {
"type": "text"
},
"query_response_id": {
"type": "keyword"
},
"query_response_object_ids": {
"type": "keyword"
},
"user_id": {
"type": "keyword"
},
"user_query": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
}
"timestamp": { "type": "date" },
"query_id": { "type": "keyword", "ignore_above": 100 },
"query": { "type": "flat_object" },
"query_response_id": { "type": "keyword", "ignore_above": 100 },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably get on the same page on what query_response_id is, again, we odn't have it in the spec, is this an internal thing?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a difference in the mappings vs the request/response schema. This is for indexing the query_response_id, not returning it in a response.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

query_response_id is a unique id per OS response to the client.
Theoretically, a client could reuse the same query_id several times to query something, but the query_response_id should always be unique.

"query_response_hit_ids": { "type": "keyword" },
"user_query": { "type": "text",
"fields": { "keyword": { "type": "keyword", "ignore_above": 256 } }
},
"query_attributes": { "type": "flat_object" },
"client_id": { "type": "keyword", "ignore_above": 100 }
}
}
}
Loading