Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facetting endpoint #2

Open
cutoffthetop opened this issue Nov 27, 2012 · 4 comments
Open

Facetting endpoint #2

cutoffthetop opened this issue Nov 27, 2012 · 4 comments
Assignees
Labels

Comments

@cutoffthetop
Copy link

When enabling facet_field on the content endpoint, the resulting output is quite obscure.
A new /facet endpoint, that only returns facets could provide more user value:

  • pagination options
  • proper dictionary instead of alternating array
  • meta information, like uri or display value

Proposed structure:

/facet
/facet/author
/facet/department
/facet/keyword
/facet/product
/facet/release_date
/facet/series

Available parameters and their default values would be:

q = *:*
limit = 10
offset = 0
fields = id, uri, value, […]
sort = id asc

Additional parameters for /facet/release_date:

gap = 1day
start = [NOW-100YEAR]
end = [NOW]
@ghost ghost assigned cutoffthetop Dec 4, 2012
@cutoffthetop
Copy link
Author

A separate facetting endpoint would require one additional request, if articles and facets are needed.
(Simply using the same query string.)
However, the number of requests needed to get a displayable text value (or other data) for each facet would drop to zero.

@ctriroli
Copy link

I am very much in support of a this feature ...
in my app I would be happy to do something like ...
http://api.zeit.de/facet/keyword?id=angela-merkel&start=2000-01-01T00:00:00Z000&gap=1YEAR
... to get the yearly keywordcount for angela-merkel ... I could also live with ...
http://api.zeit.de/facet/keyword?start=2000-01-01T00:00:00Z000&q:keyword:angela-merkel&gap=1YEAR
BTW how can we contribute to the code - or where can we find it - the repository is empty (besides of a MD5 hashfile). Do you have a sandbox environment for people like me that would be happy to code with you to speed up availability of this feature?

@cutoffthetop
Copy link
Author

Since you are looking for facets of the release_date field, I would suggest a query syntax like this:
http://api.zeit.de/facet/release_date?q=keyword:angela-merkel&gap=1year&start=2000-01-01T00:00:00Z000
You could then use the exact same query string (q=keyword:angela-merkel) for the content endpoint and get matching articles.
At /facet/keyword I, personally, would expect keyword facets.

Regarding your second point: Yes, we are planning on open-sourcing the entire code base soon.

@ctriroli
Copy link

I agree - your query makes more sense.
Looking forward to your open-sourcing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants