Service - Sort Result: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 6: | Line 6: | ||
https://bitbucket.org/stb_vit/sortresult_main/src/master/ | https://bitbucket.org/stb_vit/sortresult_main/src/master/ | ||
= DynamoDB tables = | |||
== SortResultMain == | |||
* no sort_key | |||
=== Fields === | |||
; sortResultId | |||
: (partition key) | |||
: comes from searchDataId + "_" + sortFieldsHash | |||
: searchDataId: {searchType}_{filterId}_{keyPropertiesHash}_{requiredDataHash} | |||
: sortFieldsHash: can have multiple sort fields, so we hash them to create the sortFieldsHash unique key | |||
; sortFields | |||
: array (DynamoDB list) of fields being sorted on and the order (ascending/descending) | |||
; status | |||
: whether sort processing complete for all data yet | |||
: processing | complete | |||
; expiry | |||
: timestamp when this data expires and needs to be regenerated | |||
== SortResultData == | |||
=== Fields === | |||
; sortResultId | |||
: (partition key) | |||
; sortValue | |||
: (sort key) | |||
: value of the field/s being sorted on | |||
: for multiple sort fields concatenate the values with "_" | |||
: concatenate the records unique id onto the end with "_", otherwise would have duplicates | |||
; data | |||
: copy of all required data from Search Result Main service | |||
= Notes = | = Notes = |
Revision as of 11:34, 4 November 2020
Overview
Service that handles sorted results that come from the Service - Search Result Main service. Sorted results are stored/cached so subsequent requests do not need to generate the sorted results again.
Repository
https://bitbucket.org/stb_vit/sortresult_main/src/master/
DynamoDB tables
SortResultMain
- no sort_key
Fields
- sortResultId
- (partition key)
- comes from searchDataId + "_" + sortFieldsHash
- searchDataId: {searchType}_{filterId}_{keyPropertiesHash}_{requiredDataHash}
- sortFieldsHash: can have multiple sort fields, so we hash them to create the sortFieldsHash unique key
- sortFields
- array (DynamoDB list) of fields being sorted on and the order (ascending/descending)
- status
- whether sort processing complete for all data yet
- processing | complete
- expiry
- timestamp when this data expires and needs to be regenerated
SortResultData
Fields
- sortResultId
- (partition key)
- sortValue
- (sort key)
- value of the field/s being sorted on
- for multiple sort fields concatenate the values with "_"
- concatenate the records unique id onto the end with "_", otherwise would have duplicates
- data
- copy of all required data from Search Result Main service
Notes
- The data stored here should include everything the client request might need to render results to the user, so no additional calls are needed (eg all possible media that might be shown as a thumbnail, and how likely that thumbnail would be shown)(eg pricing info min price/max price/most common sold price/etc)
- Client uses sortResultId to pull results
- ComplexFilter stores unique ids only for a filter, Service - Search Result Main takes results from ComplexFilter and adds all data client might need. Sort Result Main service copies the data from Search Result Main and structures it for sorted results