Re: Query requires iterating over all vertices


Laura Morales <lauretas@...>
 

Hi, it means your query is not leveraging your indexes. Can you provide the query and also the output of `mgmt.printIndexes()` (or how you created the indices)?
My ".properties" file:
gremlin.graph=org.janusgraph.core.JanusGraphFactory
storage.backend=berkeleyje
storage.directory=/graph/db
index.search.backend=lucene
index.search.directory=/graph/index

Then I open the "gremlin.sh" console and start the graph like this:
graph = JanusGraphFactory.open("/graph/database.properties")
g = graph.traversal()

I've imported the data from https://raw.githubusercontent.com/krlawrence/graph/master/sample-data/air-routes.graphml like this:
graph.io(graphml()).readGraph("airroutes.graphml")
graph.tx().commit()

I've tried to create a Composite Index following the documentation at https://docs.janusgraph.org/index-management/index-performance/#composite-index and this works.

Then I've tried to create a Mixed Index following the documentation below of the above, but it doesn't work. I always get that same warning.
I've tried to create the index on the property "country", just by copy-pasting the example in the documentation and replacing the property name.

The query is (typed into the "gremlin.sh" console):
g.V().has("country").values("country").dedup().order().limit(10)

The output of "mgmt.printIndexes()" is:
------------------------------------------------------------------------------------------------
Vertex Index Name | Type | Unique | Backing | Key: Status |
---------------------------------------------------------------------------------------------------
ctryidx | Mixed | false | search | country: ENABLED |
---------------------------------------------------------------------------------------------------
Edge Index (VCI) Name | Type | Unique | Backing | Key: Status |
---------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------
Relation Index | Type | Direction | Sort Key | Order | Status |
---------------------------------------------------------------------------------------------------

Join janusgraph-users@lists.lfaidata.foundation to automatically receive all group messages.