PumpkinSeed / bucket

[DEPRECATED] Optimized data structure framework for Couchbase specialized on one bucket usage
GNU General Public License v3.0
6 stars 2 forks source link

Search only checks the base struct nor the embedded ones #58

Open PumpkinSeed opened 4 years ago

PumpkinSeed commented 4 years ago

For example we have the following json.

{ 
   "token":"bmau53eg8ubfah4bg7eg",
   "creation_date":"2019-10-03 11:59:09.271784777 +0000 UTC",
   "modification_date":"",
   "status":"processed",
   "payment_method":"card",
   ...
   "shipping_method":"Free shipping",
   "will_be_paid_later":false,
   "payment_transaction_id":"bmau53eg8ubfah4bg7f0",
   "product":{ 
      "id":"bmau53eg8ubfah4bg7fg",
      ...
      "status":"active"
   },
   "store":{ 
      "id":"bmau53eg8ubfah4bg7h0",
      ...
      "description":"Product shop"
   }
}

Since the main principles of bucket that it shouldn't store embedded fields, so because of the referenced tags it will stored as:

Key: webshop::1234
Value: {"token":"bmau53eg8ubfah4bg7eg","creation_date":"2019-10-03 11:59:09.271784777 +0000 UTC","modification_date":"","status":"processed","payment_method":"card","invoice_number":"inv-0069947","email":"mathiashauck@rosenbaum.info","card_holder_name":"Sheldon Kassulke","credit_card_last_4_digits":"4541" .... "shipping_address_postal_code":"84157","payment_transaction_id":"bmau53eg8ubfah4bg7f0"}
Key: product::1234
Value: {"id":"bmau53eg8ubfah4bg7fg", ... "status":"active"}
Key: store::1234
Value: {"id":"bmau53eg8ubfah4bg7h0", ... "description":"Product shop"}

Issue

Inside the fts.go we have many Search methods. We should make sure if we perform a search on webshop it will do the search in product and store as well and in case of result it will return the webshop's document key in all cases.