1

I am puttin the index on the right place ?

I want to index from a document the product_id.

CREATE INDEX `index_product_id` ON `products` (product_id) USING GSI;

I want to index this field: (product_id)

{
  "**product_id**": "32132",
  "rating": 5,
  "id": "554f500b-912c-43f1-8caa-eea54b8301ff",
  "_type": "products_rating"
}
Matthew Groves
  • 25,181
  • 9
  • 71
  • 121
localdata01
  • 587
  • 7
  • 17
  • It's a little confusing because in your example document, there's a field named `**product_id**`. I assume you meant to bold/highlight that field? If so, then, yes, you are creating an index on the `product_id` field with that `CREATE INDEX` statement. Whether or not that's the "right" index is a whole different question, and depends on your querie(s). – Matthew Groves Jul 06 '21 at 13:32

0 Answers0