forked from magento/storefront-search-ce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmagento.proto
111 lines (78 loc) · 2.14 KB
/
magento.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
syntax = "proto3";
package magento.searchStorefrontApi.proto;
option php_metadata_namespace = "Magento\\SearchStorefrontApi\\Metadata";
service Search {
rpc searchProducts (ProductSearchRequest) returns (ProductsSearchResult) {}
}
message ProductSearchRequest {
// search query to perform full-text search
string phrase = 1;
// store id
string store = 2;
// number of product ids to return in set
int32 page_size = 3;
// current page of result set to return
int32 current_page = 4;
// filters to filter result by specified attribute values
repeated Filter filters = 5;
// sort order of returned product by specified attribute in specified order
repeated Sort sort = 6;
// whether to include aggregations into response
bool include_aggregations = 7;
// customer group id (for price bucket)
int32 customer_group_id = 8;
}
// Filter object. Only one filter type can be used per Filter (in, eq or range)
message Filter {
// attribute code
string attribute = 1;
// an array of attribute values for 'IN' filter
repeated string in = 2;
// an attribute value for 'EQ' filter
string eq = 3;
// 'range' filter
SearchRange range = 4;
}
// Range
message SearchRange {
float from = 1;
float to = 2;
}
message ProductsSearchResult {
int32 total_count = 1;
// response items - at the moment item has only 1 field: product id
repeated string items = 2;
repeated Bucket facets = 3;
SearchResultPageInfo page_info = 4;
}
message SearchResultPageInfo {
int32 current_page = 1;
int32 page_size = 2;
int32 total_pages = 3;
}
message Bucket {
// attribute code
string attribute = 1;
// attribute Frontend label
string label = 2;
// attribute options count
int32 count = 3;
// bucket options for showing in Layered Navigation
repeated BucketOption options = 5;
}
message BucketOption {
// option value
string value = 1;
// option frontend label
string label = 2;
// number of products with such option
int32 count = 3;
}
message Sort {
string attribute = 1;
string direction = 2;
}