Skip to content

Commit 55d2ebb

Browse files
authored
Merge pull request #18 from findologic/add_best_variant_property
Add best variant property (FINDO-9545)
2 parents a7ee839 + 884d87d commit 55d2ebb

File tree

2 files changed

+187
-0
lines changed

2 files changed

+187
-0
lines changed
Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
{
2+
"request": {
3+
"query": "Blubergurken",
4+
"first": 0,
5+
"count": 24,
6+
"serviceId": "F53ABAB42D7931BE13532AFCA1A95CCE",
7+
"usergroup": "foo",
8+
"userId": "cd7984ec-e0c5-4bfb-a925-d607668153cd",
9+
"order": {
10+
"field": "salesfrequency",
11+
"relevanceBased": true,
12+
"direction": "DESC"
13+
}
14+
},
15+
"result": {
16+
"metadata": {
17+
"effectiveQuery": "Blubbergurken",
18+
"totalResults": 1337,
19+
"requestId": "9cd42225-90d0-4858-bcb6-b05f33d8ec5e",
20+
"searchConcept": "Seeds",
21+
"currencySymbol": "",
22+
"landingpage": {
23+
"name": "New arrivals",
24+
"url": "https://example.org/new_stuff.html"
25+
},
26+
"promotion": {
27+
"name": "Blubbergurken Brand",
28+
"url": "https://example.org/top_brands/Blubbergurken_International_Inc.html",
29+
"imageUrl": "https://example.org/top_brands/blubbergurken_international.png"
30+
}
31+
},
32+
"variant": {
33+
"name": "sdym",
34+
"correctedQuery": "Blubbergurken"
35+
},
36+
"items": [
37+
{
38+
"id": "123ab",
39+
"url": "https://example.org/product.html",
40+
"imageUrl": "https://example.org/product.png",
41+
"name": "Blubbergurken Seeds",
42+
"highlightedName": "<span class=\"flEmphasis\">Blubbergurken</span> Seeds",
43+
"price": 13.37,
44+
"ordernumbers": ["0012BLUB-42"],
45+
"matchingOrdernumber": "34567",
46+
"score": 4.667,
47+
"summary": "These are some very nice seeds.",
48+
"properties": {
49+
"overriddenPrice": "15.00",
50+
"taxRate": "20"
51+
},
52+
"productPlacement": "Seeds spring 2020",
53+
"pushRules": [
54+
"Seeds",
55+
"Cucumbers"
56+
],
57+
"attributes": {
58+
"cat": [
59+
"Gardening"
60+
],
61+
"vendor": [
62+
"Blubbergurken International Inc."
63+
]
64+
},
65+
"bestVariant": "123ab-A",
66+
"variants": [
67+
{
68+
"id": "123ab-A",
69+
"url": "https://example.org/product-a.html",
70+
"imageUrl": "https://example.org/product-a.png",
71+
"name": "Blubbergurken Seeds - Class A",
72+
"price": 15.00,
73+
"ordernumbers": ["0012BLUB-42-A"],
74+
"matchingOrdernumber": "",
75+
"score": 4.667,
76+
"summary": "These are some very nice seeds.",
77+
"properties": {
78+
"overriddenPrice": "15.00",
79+
"taxRate": "20"
80+
},
81+
"attributes": {
82+
"cat": [
83+
"Gardening"
84+
],
85+
"vendor": [
86+
"Blubbergurken International Inc."
87+
]
88+
}
89+
},
90+
{
91+
"id": "123ab-B",
92+
"url": null,
93+
"imageUrl": null,
94+
"name": null,
95+
"price": 0.0,
96+
"ordernumbers": ["0012BLUB-42-A"],
97+
"matchingOrdernumber": "",
98+
"score": 0,
99+
"summary": null,
100+
"properties": {},
101+
"attributes": {}
102+
}
103+
]
104+
}
105+
],
106+
"filters": {
107+
"main": [
108+
{
109+
"name": "cat",
110+
"displayName": "Category",
111+
"type": "select",
112+
"selectMode": "single",
113+
"values": [
114+
{
115+
"displayName": "Spring",
116+
"value": "Gardening_Spring",
117+
"weight": 1.2,
118+
"frequency": 13
119+
}
120+
],
121+
"pinnedFilterValueCount": 6
122+
},
123+
{
124+
"type": "range-slider",
125+
"totalRange": {
126+
"min": 2.37,
127+
"max": 10106.09
128+
},
129+
"selectedRange": {
130+
"min": 2.37,
131+
"max": 10106.09
132+
},
133+
"stepSize": 0.1,
134+
"unit": "",
135+
"name": "price",
136+
"displayName": "Preis",
137+
"selectMode": "single",
138+
"values": [
139+
{
140+
"value": {
141+
"min": 2.37,
142+
"max": 30.75
143+
},
144+
"weight": 0.3948,
145+
"frequency": null
146+
}
147+
]
148+
},
149+
{
150+
"name": "vendor",
151+
"displayName": "Brand",
152+
"type": "select",
153+
"selectMode": "multiple",
154+
"noAvailableFiltersText": "Sorry, no more filters for you!",
155+
"values": [
156+
{
157+
"value": "Blubbergurken International Inc.",
158+
"weight": 0.8,
159+
"frequency": 5,
160+
"selected": true,
161+
"frequencyType" : "additive"
162+
}
163+
]
164+
}
165+
],
166+
"other": [
167+
{
168+
"name": "color",
169+
"displayName": "Color",
170+
"type": "color",
171+
"selectMode": "multiple",
172+
"cssClass": "my-colors",
173+
"values": [
174+
{
175+
"value": "Green",
176+
"color": "#00FF00"
177+
}
178+
]
179+
}
180+
]
181+
}
182+
}
183+
}

resources/schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,10 @@
290290
},
291291
"description": "In one or more Push Rules match a product, these are the names."
292292
},
293+
"bestVariant": {
294+
"description": "ID of the variant that best matches the user query. null if there is no clear best match.",
295+
"type": ["string", "null"]
296+
},
293297
"variants": {
294298
"type": "array",
295299
"items": {"$ref": "#/definitions/variantItem"}

0 commit comments

Comments
 (0)