UpStart Commerce Search
Index
Store Index
26 min
the store index introduces two new indexes, store product and store sku , which replace the older catalog location live index in the old setup, catalog location live stored one document per product per location , resulting in this approach created redundant data and slowed performance the new indexes store all location specific pricing inside a nested pricing field in each document reduce document count to n products (for store product) n skus (for store sku) improve search performance and reduce reindexing time from hours to minutes why use these new indexes? feature catalog location live store product store sku document count n products × n locations n products n skus redundant data high low low performance slower faster faster reindex time hours minutes minutes search scope product+location product level sku level advantages reduced redundancy (1 doc per product/sku) significantly faster indexing and querying flexible choose product level or sku level search consistent api responses, with only pricing, storage/query logic changed quick start – how to use catalog indexes the catalog index introduces two optimized indexes to replace catalog location live store product best for product level queries returns a single document per product with all location specific pricing in a nested pricing array store sku best for sku level queries returns one document per sku, allowing you to target individual product variants (e g , color, size) 1\ choose the correct index use store product when you want to search or display products without showing every sku variation you only need to retrieve the top level product details with pricing for specific locations use store sku when you want searches to return individual skus directly you need to target sku specific attributes like color, size, or material 2\ build your query api routes /store product/search – search for products /store sku/search – search for skus /store product/suggest and /store sku/suggest – get autocomplete suggestions both indexes support image search and neural search queries 3\ filter by location all pricing is location specific use a nested filter to limit results to a specific store or warehouse { "nested" { "path" "pricing", "query" { "term" { "pricing locationids keyword" { "value" "100003" } } } } } this ensures you only return pricing and availability for the relevant locationid 4\ exclude the full pricing array to avoid returning every location’s pricing in your main search hits, exclude the pricing field this keeps responses lightweight 5\ retrieve relevant pricing with inner hits use inner hits to return only the matching location’s pricing "inner hits" { " source" \[ "pricing buyonline", "pricing price", "pricing onsale", "pricing currency", "pricing listprice" ] } this structure is consistent between store product and store sku 6\ collapse skus for cleaner product results (optional) when using store sku , you may want only one sku per product in search results this groups all skus under the main product, with the option to access all variations via inner hits 7\ choose the right query type standard query – basic search and filter suggest query – autocomplete or typeahead suggestions image search – search by visual similarity using an embedding vector neural query – semantic search powered by natural language understanding index store product purpose the store product index stores one document per product , with all location pricing inside a nested pricing array data structure changes the productitem buyonline method has been moved to pricing buyonline pricing contains all location price entries for that product queries must use a nested filter to retrieve location specific prices standard query cu curl location 'https //api upstartcommerce com/v1/search/routes/store product/search' \\ \ header 'content type application/json' \\ \ header 'x upstart tenant tenant' \\ \ header 'x upstart site site' \\ \ header 'x upstart session id session id' \\ \ data '{ "search" { "query" { "bool" { "must" \[ { "query string" { "query" "chair " } } ], "filter" \[ { "term" { "locationids keyword" { "value" "100003" } } }, { "nested" { "path" "pricing", "query" { "term" { "pricing locationids keyword" { "value" "100003" } } }, "inner hits" { " source" \[ "pricing buyonline", "pricing price", "pricing onsale", "pricing currency", "pricing listprice" ] } } } ] } }, " source" { "excludes" "pricing" }, "mostvaluablequery" { "query" "chair" } } }' suggest query curl location 'https //api upstartcommerce com/v1/search/routes/store product/suggest' \\ \ header 'x upstart tenant tenant' \\ \ header 'content type application/json' \\ \ header 'x upstart session id session id' \\ \ header 'x upstart site site' \\ \ data '{ "suggest" { "prefix" "chair", "size" 10, "suggest fields" \["id", "name", "dynamicproperties description"], "filter" { "bool" { "must" \[ { "query string" { "query" "chair " } } ], "filter" \[ { "term" { "locationids keyword" { "value" "100003" } } }, { "nested" { "path" "pricing", "query" { "term" { "pricing locationids keyword" { "value" "100003" } } } } } ] } }, " source" { "includes" \["id", "media"] }, "highlight" { "pre tags" \["\<strong>"], "post tags" \["\</strong>"] } }, "mostvaluablequery" { "query" "chair" } }' image search query curl location 'https //api upstartcommerce com/v1/search/routes/store sku/search' \\ \ header 'content type application/json' \\ \ header 'x upstart tenant tenant' \\ \ header 'x upstart site site' \\ \ header 'x upstart session id session id' \\ \ data '{ "search" { "query" { "bool" { "must" \[ { "nested" { "path" "dynamicproperties media url image model embedding", "query" { "knn" { "dynamicproperties media url image model embedding knn" { "vector" \[vector returned from image search svc], "k" 10 } } } } } ], "filter" \[ { "term" { "locationids keyword" { "value" "100003" } } }, { "nested" { "path" "pricing", "query" { "term" { "pricing locationids keyword" { "value" "100003" } } }, "inner hits" { " source" \[ "pricing buyonline", "pricing price", "pricing onsale", "pricing currency", "pricing listprice" ] } } } ] } }, " source" { "excludes" "pricing" }, "mostvaluablequery" { "query" "chair" } } }' neural query curl location 'https //api upstartcommerce com/v1/search/routes/store product/search' \\ \ header 'content type application/json' \\ \ header 'x upstart tenant tenant' \\ \ header 'x upstart session id session id' \\ \ header 'x upstart site site' \\ \ data '{ "search" { "query" { "bool" { "filter" \[ { "term" { "locationids keyword" { "value" "100062" } } }, { "nested" { "path" "pricing", "query" { "term" { "pricing locationids keyword" { "value" "100062" } } }, "inner hits" { " source" \[ "pricing buyonline", "pricing price", "pricing assetids", "pricing onsale", "pricing currency", "pricing listprice" ] } } } ], "must" \[ { "nested" { "path" "dynamicproperties neural description semantic catalog model embedding", "query" { "neural" { "dynamicproperties neural description semantic catalog model embedding knn" { "query text" "chair", "model id" "semantic catalog model", "k" 10, "filter" { "term" { "locationids keyword" { "value" "100003" } } } } } } } } ] }, " source" { "excludes" "pricing" } }, "mostvaluablequery" { "query" "chair" } } }' index store sku purpose the store sku index stores one document per sku , enabling sku specific search results this is useful when products have multiple skus with distinct attributes (e g , color or size), and you want to allow users to search for those variations directly data structure changes the productitem buyonline method has been moved to pricing buyonline pricing contains all location price entries for that sku queries must use a nested filter to retrieve location specific prices standard query curl location 'https //api upstartcommerce com/v1/search/routes/store sku/search' \\ \ header 'content type application/json' \\ \ header 'x upstart tenant tenant' \\ \ header 'x upstart site site' \\ \ header 'x upstart session id session id' \\ \ data '{ "search" { "query" { "bool" { "must" \[ { "query string" { "query" "chair " } } ], "filter" \[ { "term" { "locationids keyword" { "value" "100062" } } }, { "nested" { "path" "pricing", "query" { "term" { "pricing locationids keyword" { "value" "100062" } } }, "inner hits" { " source" \[ "pricing buyonline", "pricing price", "pricing assetids", "pricing onsale", "pricing currency", "pricing listprice" ] } } } ] }, "collapse" { "field" "itemid keyword" }, " source" { "excludes" "pricing" } }, "mostvaluablequery" { "query" "chair" } } }' suggest query curl location 'https //api upstartcommerce com/v1/search/routes/store sku/suggest' \\ \ header 'x upstart tenant tenant' \\ \ header 'content type application/json' \\ \ header 'x upstart session id session id' \\ \ header 'x upstart site site' \\ \ data '{ "suggest" { "prefix" "chair", "size" 10, "suggest fields" \["id", "name", "dynamicproperties description"], "filter" { "bool" { "must" \[ { "query string" { "query" "chair " } } ], "filter" \[ { "term" { "locationids keyword" { "value" "100003" } } }, { "nested" { "path" "pricing", "query" { "term" { "pricing locationids keyword" { "value" "100003" } } } } } ] } }, "collapse" { "field" "itemid keyword" }, " source" { "includes" \["id", "media"] }, "highlight" { "pre tags" \["\<strong>"], "post tags" \["\</strong>"] } }, "mostvaluablequery" { "query" "chair" } }' image search query curl location 'https //api upstartcommerce com/v1/search/routes/store sku/search' \\ \ header 'x upstart tenant tenant' \\ \ header 'content type application/json' \\ \ header 'x upstart session id session id' \\ \ header 'x upstart site site' \\ \ data '{ "search" { "query" { "bool" { "must" \[ { "nested" { "path" "dynamicproperties media url image model embedding", "query" { "knn" { "dynamicproperties media url image model embedding knn" { "vector" \[vector returned from image search svc], "k" 10 } } } } } ], "filter" \[ { "term" { "locationids keyword" { "value" "100003" } } }, { "nested" { "path" "pricing", "query" { "term" { "pricing locationids keyword" { "value" "100003" } } }, "inner hits" { " source" \[ "pricing buyonline", "pricing price", "pricing onsale", "pricing currency", "pricing listprice" ] } } } ] } }, "collapse" { "field" "itemid keyword" }, " source" { "excludes" "pricing" }, "mostvaluablequery" { "query" "chair" } } }' neural query curl location 'https //api upstartcommerce com/v1/search/routes/store sku/search' \\ \ header 'content type application/json' \\ \ header 'x upstart tenant tenant' \\ \ header 'x upstart site site' \\ \ header 'x upstart session id session id' \\ \ data '{ "search" { "query" { "bool" { "filter" \[ { "term" { "locationids keyword" { "value" "100062" } } }, { "nested" { "path" "pricing", "query" { "term" { "pricing locationids keyword" { "value" "100062" } } }, "inner hits" { " source" \[ "pricing buyonline", "pricing price", "pricing assetids", "pricing onsale", "pricing currency", "pricing listprice" ] } } } ], "must" \[ { "nested" { "path" "dynamicproperties neural description semantic catalog model embedding", "query" { "neural" { "dynamicproperties neural description semantic catalog model embedding knn" { "query text" "chair", "model id" "semantic catalog model", "k" 10, "filter" { "term" { "locationids keyword" { "value" "100003" } } } } } } } } ] }, "collapse" { "field" "itemid keyword" }, " source" { "excludes" "pricing" } }, "mostvaluablequery" { "query" "chair" } } }' pricing in search responses when using either store product or store sku , location specific pricing is not returned in the main source by default; it’s retrieved using inner hits on the pricing nested field example search response snippet "inner hits" { "pricing" { "hits" { "total" { "relation" "eq", "value" 1 }, "hits" \[ { " index" "sp denvermattress default store product 000021", " id" "0d134a35 08a8 4f1c b177 1602b17013f3", " score" 1 0506582, " nested" { "field" "pricing", "offset" 0 }, " source" { "buyonline" true, "price" 659, "onsale" false, "currency" "usd", "listprice" 659 } } ], "max score" 1 0506582 } } } field definitions field description buyonline boolean indicates whether the product/sku can be purchased online for the given location price active selling price for the location this can be a sale price if available; otherwise, it will be the list or msrp price onsale boolean true if the price field is a sale price useful for filtering and faceting currency currency code (e g , usd) listprice list or msrp price for the given location