Run 21million example (using docker) error : Attribute name is not indexed with type term
If you suspect this could be a bug, follow the template.
-
What version of Dgraph are you using? 1.0.1, via docker
-
Have you tried reproducing the issue with latest release? yes, using latest version
-
What is the hardware spec (RAM, OS)? AWS, 16G, aws ec2 linux AMI
-
Steps to reproduce the issue (command/config used to run Dgraph).
# download data
cd ~/dgraph
wget "https://github.com/dgraph-io/benchmarks/blob/master/data/21million.rdf.gz?raw=true" -O 21million.rdf.gz -q
wget "https://github.com/dgraph-io/benchmarks/blob/master/data/21million.schema?raw=true" -O 21million.schema -q
# run zero
docker run -it -p 8081:8081 -p 8080:8080 -p 9080:9080 -v ~/dgraph1:/dgraph --name dgraph dgraph/dgraph dgraph zero --port_offset=-2000
# login docker container
docker exec -it dgraph /bin/bash
# in docker, /dgraph, bulk loading report success
dgraph bulk -r 21million.rdf.gz -s 21million.schema -z localhost:5080
# run server
cd /out/0
dgraph server --bindall=true --memory_mb 2048 --zero localhost:5080
Then run query in gui. such as
{
HP(func: allofterms(name, "Harry Potter")) @cascade {
name@en
starring{
performance.character @filter(allofterms(name, "harry")) {
name@en
}
performance.actor {
name@en
}
}
}
}
- Expected behaviour and actual result.
Expect to return something, but throw error
": Attribute name is not indexed with type term"
The current version of https://github.com/dgraph-io/benchmarks/blob/master/data/21million.schema doesn't have the term index set for name. So allofterms won't work.
It does have fulltext though, so you would be able to use alloftext instead of allofterms.
EDIT: I see you got that example from the docs. I'll get those updated.
thanks for prompt reply. A new query like below return nothing. { HP(func: alloftext(name, "Harry Potter")) @cascade { name@en starring{ performance.actor { name@en } } } }
What is the quick way to take a look at some data to ensure the data loading is successful?
The query that you want instead is:
{
HP(func: alloftext(name@en, "Harry Potter")) @cascade {
name@en
starring {
performance.actor {
name@en
}
}
}
}
Note the @en inside alloftext. All of text does text search based on language as well, so you also have to specify that.
thanks. your reply is so fast! it works well.
most querys in https://github.com/dgraph-io/benchmarks/blob/master/queries/queries.txt doesn't work in newer version, for example, sumvar throw exception like Expecting a collon. Got: lex.Item [24] "," in sumvar
Is it possible these query can be fixed?
Also, where can I find all the querys in https://blog.dgraph.io/post/benchmark-neo4j/. i want to demo the performance to my colleagues.
Thanks!
Is it possible these query can be fixed?
Yep, I'll update this as well.
Also, where can I find all the querys in https://blog.dgraph.io/post/benchmark-neo4j/. i want to demo the performance to my colleagues.
@pawanrawal may be able to answer, I think he wrote that blogpost.
The queries are here https://github.com/dgraph-io/benchmarks/blob/master/data/neo4j/query_test.go but they need to updated as well(predicate names have changed in the dataset). I will do that sometime today.
thanks a lot! I will close this issue
For the 21 million dataset, it's better to use https://github.com/dgraph-io/benchmarks/tree/master/data/release instead. It's schema is set to work with the runnable examples on the docs site.