corpus-db icon indicating copy to clipboard operation
corpus-db copied to clipboard

Max results query parametr

Open smythp opened this issue 6 years ago • 3 comments

Would be nice to have a query parameter that can return x number of results to speed up examples in the notebook.

smythp avatar Mar 22 '18 20:03 smythp

Good idea. Yeah /api/subjects takes forever, and I don't know how to do profiling in Haskell, yet. I was thinking of caching stuff like that, since it's always going to be the same (for the moment, at least).

JonathanReeve avatar Mar 23 '18 00:03 JonathanReeve

Caching sounds like a good idea. Can you support query parameters yet? You'll need them to do stuff likein the fancy SQL queries you showed off in your presentation.

smythp avatar Mar 23 '18 00:03 smythp

Scotty has a parameter parser built-in, I'm pretty sure. The tutorial here says to do something like this:

get "/hello" $ do
  name <- param "name"
  text name

Which I imagine handles a URL like /hello?name="Jonathan", although I haven't tested it.

JonathanReeve avatar Mar 23 '18 00:03 JonathanReeve