Dgraph supports composite indexes?


(abbass) #1

Dgraph supports composite indexes?
for example in neo4j:
CREATE INDEX ON: Person(first_name, last_name)


(Michel Conrado) #2

Nops, indexing are predicate based. But you can do it in another way.

index both first_name and last_name, and then query for:

{
  me(func: eq(first_name, "Steven")) @filter(eq(last_name, "Spielberg")) {
    first_name
    last_name
  }
}

(abbass) #3

oh bad, thats good but i want to search in the fast way


(Daniel Mai) #4

There’s an open request to support composite indexes in Dgraph.


#5

I added this comment to the github issue but wanted to bring it up in discussion also.

What do you think of indexing the combination of (edge, facet) as a sort of composite index? It seems like this would fit well with the architecture of dgraph that I have been able to glean so far.