lightblue-platform / lightblue-rest

Data access layer as service REST API
GNU General Public License v3.0
9 stars 16 forks source link

Saved searches #278

Closed bserdar closed 7 years ago

bserdar commented 7 years ago

Saved searches are specific to an entity. There can be a getById for user, and getById for product, different searches.

On Tue, Jan 24, 2017 at 9:22 AM, Brandon Vulaj notifications@github.com wrote:

@bvulaj commented on this pull request.

In crud/src/main/java/com/redhat/lightblue/rest/crud/ AbstractCrudResource.java https://github.com/lightblue-platform/lightblue-rest/pull/278#pullrequestreview-18200781 :

@@ -78,6 +90,108 @@ java.security.Security.setProperty("networkaddress.cache.ttl", "30"); }

  • @GET
  • @Path("/search/{searchName}/{entity}")
  • public Response runSavedSearch(@PathParam("searchName") String searchName,

Are searches specific to an entity? Or could getById apply to multiple entities?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lightblue-platform/lightblue-rest/pull/278#pullrequestreview-18200781, or mute the thread https://github.com/notifications/unsubscribe-auth/ADgDDcgx4r8YJvg4YdLQOEu7ncyeRlUeks5rViU9gaJpZM4LsXls .

bserdar commented 7 years ago

Saved searches are first-class entities. Search the savedSearch entity.

On Tue, Jan 24, 2017 at 9:21 AM, Brandon Vulaj notifications@github.com wrote:

@bvulaj commented on this pull request.

In crud/src/main/java/com/redhat/lightblue/rest/crud/ AbstractCrudResource.java https://github.com/lightblue-platform/lightblue-rest/pull/278#pullrequestreview-18200683 :

@@ -78,6 +90,108 @@ java.security.Security.setProperty("networkaddress.cache.ttl", "30"); }

  • @GET
  • @Path("/search/{searchName}/{entity}")
  • public Response runSavedSearch(@PathParam("searchName") String searchName,

Is there someway to get a list of available searches?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lightblue-platform/lightblue-rest/pull/278#pullrequestreview-18200683, or mute the thread https://github.com/notifications/unsubscribe-auth/ADgDDQn3ihWykvzrqavKjWnImURLSv-Iks5rViUkgaJpZM4LsXls .

bvulaj commented 7 years ago

@bserdar so how would that work, then?

/search/getById/user? /search/getById/product?

What if I wanted to see available searches for user? Do I have to write an lb query to filter?

I guess what I am getting at is that it might make more sense to users to expose the searches underneath their respective entity.

/search/user/getById

bserdar commented 7 years ago

I agree, /search/user/getById is better. Pushed a change for that.

Should I add APIs to get list of searches, etc? Currently you can do that with:

/find/savedSearch?Q=entity:user

On Tue, Jan 24, 2017 at 9:33 AM, Brandon Vulaj notifications@github.com wrote:

@bserdar https://github.com/bserdar so how would that work, then?

/search/getById/user? /search/getById/product?

What if I wanted to see available searches for user? Do I have to write an lb query to filter?

I guess what I am getting at is that it might make more sense to users to expose the searches underneath their respective entity.

/search/user/getById

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lightblue-platform/lightblue-rest/pull/278#issuecomment-274857244, or mute the thread https://github.com/notifications/unsubscribe-auth/ADgDDQKgkGRYn06ZjUQlPLOuSPgBC8Gyks5rVifQgaJpZM4LsXls .

bvulaj commented 7 years ago

I think it would be nice if /search/user returned a list of searches. It's a convenience method, but I think it makes sense.

bserdar commented 7 years ago

This doesn't, but /searches/entity/version does. That's why I changed that to searches. Or, I can remove the API with the version, and keep this as /search/{entity}

On Tue, Jan 24, 2017 at 11:14 AM, Brandon Vulaj notifications@github.com wrote:

@bvulaj commented on this pull request.

In crud/src/main/java/com/redhat/lightblue/rest/crud/ AbstractCrudResource.java https://github.com/lightblue-platform/lightblue-rest/pull/278#pullrequestreview-18228216 :

@@ -78,6 +93,156 @@ java.security.Security.setProperty("networkaddress.cache.ttl", "30"); }

  • @GET
  • @LZF
  • @Path("/searches/{entity}")

I think I would just keep this as search rather than change verbiage. I think that makes sense. It shouldn't clash with any of the actual search methods.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lightblue-platform/lightblue-rest/pull/278#pullrequestreview-18228216, or mute the thread https://github.com/notifications/unsubscribe-auth/ADgDDfCPMEbtMgDCYyxaztnm8IEuNKNqks5rVj9sgaJpZM4LsXls .

bvulaj commented 7 years ago

I think that makes more sense in the long run. Let's go with that, if you're okay with it, and then merge this in.

bserdar commented 7 years ago

Pushed.

On Tue, Jan 24, 2017 at 11:36 AM, Brandon Vulaj notifications@github.com wrote:

I think that makes more sense in the long run. Let's go with that, if you're okay with it, and then merge this in.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lightblue-platform/lightblue-rest/pull/278#issuecomment-274894499, or mute the thread https://github.com/notifications/unsubscribe-auth/ADgDDbFzsRKg9PDZXvzbJ6NbHuXsydSPks5rVkS_gaJpZM4LsXls .