fergiemcdowall / norch

A search server that can be installed with npm
655 stars 45 forks source link

/docCount yes, but what about /hitCount ? #131

Closed eklem closed 7 years ago

eklem commented 7 years ago

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?

eklem commented 7 years ago

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

eklem commented 7 years ago

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

fergiemcdowall commented 7 years ago

(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:

eklem commented 7 years ago

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

fergiemcdowall commented 7 years ago

Ahhh- no. Good point- must be fixed.

eklem commented 7 years ago

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.

fergiemcdowall commented 7 years ago

totalHits should now be available in 0.8.5 on npm