Field name is not indexed and cannot be used in functions

I was following the 5-Step tutorial here: running dgraph in a docker container.

And in step 3 I encountered error: “Field name is not indexed and cannot be used in functions”
After running the following query:

curl localhost:8080/query -XPOST -d $'{
  me(allof("name", "Star Wars")) @filter(geq("release_date", "1980")) {
    director {
    starring {
}' | python -m json.tool | less

Turns out the docker command: docker run -it -p 9090:8080 -v $(pwd)/dgraph:/dgraph dgraph/dgraph dgraph --bindall true --schema starwars.schema

Should be instead docker run -it -p 9090:8080 -v $(pwd)/dgraph:/dgraph dgraph/dgraph dgraph --bindall --schema starwars.schema with no arguments to --bindall

Curious to why dgraph’s logs didn’t tell me that the arguments were invalid or that no schema has been loaded.

Many thanks.

Hey @hinshun,

This is indeed strange. @pawan Can you have a look and see why the original command didn’t work.

Thanks for bringing this to our notice @hinshun

I will add a fix so that we log if the schema was successfully loaded. I found out that docker run command doesn’t play well when you have more than one arguments. The correct way to do this would be

docker run -it -p 9090:8080 -v $(pwd)/dgraph:/dgraph dgraph/dgraph dgraph --bindall=true --schema=starwars.schema

Modified the command on the Wiki.

1 Like

I am facing similar issue. I am using this 21million.schema schema file which contains uid @reverse
genre: uid @reverse
initial_release_date: date @index
rating: uid @reverse
country: uid @reverse
loc: geo @index
name: string @index

But executing below query

me(func:anyofterms(name, “jones indiana”)) {
genre {

Gives me an error saying “Field name is not indexed and cannot be used in functions”.


  1. Is this an issue about invalid schema file or incompatible schema file for latest code on master as of 13 March 2017 ?
  2. Does this need an instant documentation fix ?

Is there an Endpoint or some health check which tells user about following things

  1. Currently loaded schema ?
  2. Indexed fields
  3. Number of RDFS present ?
  4. Or may be some kind of more relevant metadata info ?

@davcdhanesh1 Can you delete p and w directory and try again.

We don’t have any endpoint as of now which tells current loaded schema or indexed fields, but we are going to include it by this weekend.

1 Like

Yeah, this should work, @davcdhanesh1. Retry as Janardhan points, and check if you still have this problem.

Sorry to reply late. It did work after following steps as mentioned by

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