fergiemcdowall / norch

A search server that can be installed with npm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Only able to display categories for one field per query/GET ? Flag to exclude '*'

eklem opened this issue · comments

Is it possible to display categories for more than one field at a time, or only for one field, given the nature of streams?

http://oppskrift.klemespen.com:3030/categorize?q=%7B%22query%22:%5B%7B%22AND%22:%7B%22*%22:%5B%22*%22%5D%7D%7D%5D,%22category%22:%7B%22field%22:%22Land%22%7D%7D

And is it smart to have the "all" as a category first?

The advantage of having the "all" category first is that you can do stuff like percentages. But yes, there maybe should be a flag to exclude "*".

Categories can only be shown for one field at a time (although you can of course query any combination of fields). This allows for a cleaner "separation of concerns", and a leaner response.

A flag would be nice! But I'll see how it goes first =)

Actually, I think you could remove it completely. You have the totalHits, or will that not work in some cases?

It's easy to use array.splice(0,1) to remove first result, so think we could close this for now?

Yes, I think so.

You can also now do offset: 1 to exclude "*"

Nice!