Faceted search support

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:

  1. General description: Faceted search - Wikipedia
  2. Example of faceted search: Find people faster with LinkedIn’s new faceted search | Official LinkedIn Blog
  3. 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.

Hi, I wasn’t really clear on what would be added. It looked like Dgraph can already do the kinds of queries that faceted search requires, but we might add some syntax to simplify the queries, is that right? In which case do we know what would be a helpful general mechanism.

I would have thought faceted searches would be something that a user would build on top of Dgraph as part of their application. Unless we are thinking of it as part of schema exploration tool in the UI.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.