As posted in add range support for bleve based search · Issue #671 · dgraph-io/dgraph · GitHub, there is some interest in implementation of faceted search for Dgraph.
Some resources:
- General description: Faceted search - Wikipedia
- Example of faceted search: Find people faster with LinkedIn’s new faceted search | Official LinkedIn Blog
- Bleve documentation: http://www.blevesearch.com/docs/Result-Faceting/
This kind of search is currently possible in Dgraph. For example, following query shows 3 “search facets” of genre
attribute (of director), for steven spielberg
search.
{
var(func:allofterms(name, "steven spielberg")) {
director.film @groupby(genre) {
a as count(_uid_)
}
}
byGenre(id: var(a), orderdesc: var(a), first: 3) {
name
total_movies : var(a)
}
}
Probably some syntactic sugar for such aggregation can be added to simplify queries. All comments and suggestions welcome.