Re: Query requires iterating over all vertices

Boxuan Li

The difference between “text” and “string” is explained here:
In short, “text” is for full-text search (tokenized search) capability while “string” is for whole string match. You can also take a look at which explains Elasticsearch’s Text (corresponding to “text” in JanusGraph), and Keyword (corresponding to “string” in JanusGraph). The same applies to Lucene.
Speaking of your use case, has(“country”) is interpreted as a “TraversalFilter” step in Gremlin, different from has(“country”, “value”) which is interpreted as a “GraphStep”. JanusGraph only applied indexes when it saw a “GraphStep”. Starting from 0.6.0 (unreleased yet), indexes are also applied for “has(key)” steps. This is just FYI.

On Jul 24, 2021, at 2:23 AM, Laura Morales <lauretas@...> wrote:
Looks like this is because you are indexing your property as text. See

I believe the query has(“country", P.neq(null)) would work when you build your index as follows:

   addKey(country, Mapping.STRING.asParameter()).buildMixedIndex("search”)

or using Mapping.TEXTSTRING.

Moreover, if you try the unreleased version (on GitHub master branch), even your original query and setup should work.

Thank you so much! I was using the newest release, but compiling the lastest source (from main branch) did indeed fix the problem. Or at least I think it has, since I don't get any more warnings.
On the other hand I'm absolutely confused and I don't know what I'm doing. I'm new with Janus, and the process of creating these indexes seems overly complex. What's the difference between "text" and "string"? And why wasn't it working with the previous release?

Join to automatically receive all group messages.