fergiemcdowall / norch

A search server that can be installed with npm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

/docCount yes, but what about /hitCount ?

eklem opened this issue · comments

I think we're missing the ability to get back how many hits can be returned for a given query (with filters and buckets)? Maybe the docCount could be a little object containing both totalDocCount and hitDocCount?

What do you think? The cost of having to query norch & search-index many times goes down when the browser is the server, but good to keep a balance?

And this goes for search-index too, I think.

Sorry, that wasn't true I think. The API docs has a sub-title called totalHits, but the actual documentation is missing.

(Just fixed the documentation link to totalHits)

Yes, this is a design decision. I know it seems a bit clumsy, and its definitely up for discussion, but it sort of kind of makes sense:

  • Calculating total hits requires extra computation. It makes sense to only calculate it if you actually want it, rather that forcing the user to always have it even if it is not needed
  • Since search-index now streams results, there isn't an obvious place to put metadata for the resultset.

Nice. If it is like that already, just keep it =) But does norch have and endpoint for it?

Ahhh- no. Good point- must be fixed.

Also, I think the design decision is a really good one. And good that the switch came now and not later. I'm amazed at the increased speed and reduced memory and CPU usage. It fixes a lot, and has a few downsides.

totalHits should now be available in 0.8.5 on npm