Skip to content

Instantly share code, notes, and snippets.

@olamothe
Last active November 20, 2018 20:08
Show Gist options
  • Save olamothe/51f2b9a307affa64af524c080475afb9 to your computer and use it in GitHub Desktop.
Save olamothe/51f2b9a307affa64af524c080475afb9 to your computer and use it in GitHub Desktop.
REQUEST
[
{
"Field": "mandatory",
"Id": "mandatory (for facet sense)",
"Title": " mandatory (for facet sense). Maybe only Title would do, and we could remove the ID",
"Operator": "default to OR",
"SortCriteria": "All valid sortCriteria",
"NumberOfValues": "default to 5",
"InjectionDepth": "default to 1000, not sure if there is an equivalent in elastic search, if yes we could use a more generic name to describe the performance versus precision tradeoff",
"ComputedField": "default to none, same as above for the elastic search comment",
"ComputedFieldOperation": "default to none",
"AdditionalFilter": "Additional query expression that should be applied to this facet query override, default to none",
"Sticky" : "Boolean that tells the API that it should try to return the currently displayed values, in the same order. Generally speaking, this will be set when the users interacted directly with the facet before executing the query.",
"CustomOrder": [
"If any of those values would be returned by the API, sort them first using that list. Default to none.",
"secondValue",
"..."
],
"Blacklist": [
"List of facet values that should never be returned by the API. Values can use wildcards. Default to none",
"secondValue",
"..."
],
"Whitelist": [
"List of facet values to should be returned by the API if possible. Values can use wildcards. API should complete up to NumberOfValues if needed. Default to none",
"*valuesUsingWildcard*",
"..."
],
"Values": [
{
"Value": " List of values currently shown in the UI + their state. Default to none",
"Selected": "boolean",
"Excluded": "boolean"
}
]
}
]
RESPONSE
[
{
"Field": "string",
"Id": "string",
"Title": "string",
"MoreValuesAvailable": "boolean",
"Values": [
{
"Value": "string",
"Selected": "boolean",
"Excluded": "boolean",
"NumberOfResults": "Will be populated if the facet has no selected or exluded values. Shows the number of results that can be expected if the user select this value.",
"Delta": "Will be populated if the facet has selected or excluded values, and the facet is using OR operator. Shows the difference in number of results that can be expected if the user select this value.",
"ComputedFieldResult" : "number",
"Suggested?": "Not sure if these should instead be included in SuggestedValues field instead. We probably want suggested facet values to be treated “separately” from standard sorted values, because they could bypass the SortCriteria in the request. We could also hide that complexity in the API and simply return a simple list of values to display in an “intelligent” manner using the sort criteria."
}
],
"SuggestedValues?": [
{
"Value": "Not sure if these should instead be returned inside the Value field, but with a Suggested field instead.",
"Selected": "boolean",
"Excluded": "boolean",
}
]
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment