cloudwan / gohan

Gohan is an API Gateway Server written by Go that makes it easy for developers to create and maintain REST-style API
http://www.slideshare.net/natiueno/gohan-61170476
Other
109 stars 44 forks source link

[BL-339] Substr search #731

Closed giyyanan closed 5 years ago

p-kozlowski commented 5 years ago

@giyyanan, do we try to implement Fuzzy Search here? if so, I'd suggest

  1. going for a ready-made library like https://github.com/lithammer/fuzzysearch
  2. get all resources of a given type from db (matching tenant isolation criteria)
  3. serialize the resources to strings (this way we'll also match nested properties!)
  4. apply the fuzzy search to serialized resources
  5. return results (or maybe just the resources exceeding a certain threshold?)

for ~thousands of resources it should be fine performance-wise, but obviously we must benchmark it

morrisson commented 5 years ago

@p-kozlowski We can think about additional usability and efficiency in another epic. There should be a lot of choices. However, this kind of low-hanging fruits should be okay to be added for basic improvement unless there is serious side effect.

p-kozlowski commented 5 years ago

@morrisson to be honest, I do not think implementing a real fuzzy search will (that much) more effort than what was done here. on the other hand if a simple substring match is fine to fulfill the business requirements, I'm OK with staying with it.

There's a great number of issues with this PR (sorted roughly in the order of importance), that block merging it in the current form:

  1. backward compatibility (and possibly also operations) broken at UI level
  2. error-prone Transaction API
  3. no low-level tests for the changes in Transaction
  4. the code is not refactored
morrisson commented 5 years ago

@p-kozlowski Thank you for your understanding. @giyyanan Please address to resolve comments.