JanusGraph / JanusGraph/janusgraph

Concatenated full-text search queries not working

Open
#1,379 17 comments 0 reactions 0 assignees View on GitHub
kind/bug/possible
Dominant language
Java
Stars
5.8k
Forks
1.2k
Avg merge
13h 53m
Merged PRs (30d)
6

Description

This works as expected:
```groovy
gremlin> g.V().has('Email', 'Address', textContainsRegex('example.com')).
has('Address', textContainsPrefix('root')).
values('Address')
==>root@example.com
```
which uses only predicates for full-text search. If the second predicate is replaced by a string search predicate, then it doesn't work any more:

```groovy
gremlin> g.V().has('Email', 'Address', textContainsRegex('example.com')).
has('Address', textPrefix('root')).
values('Address')
// no result
```

It works for some reason again if a `limit()` is added between the two `has()` steps:

```groovy
gremlin> g.V().has('Email', 'Address', textContainsRegex('example.com')).
limit(5).
has('Address', textPrefix('root')).
values('Address')
==>root@example.com
```

The index was created with `Mapping.TEXT.asParameter()` and a custom analyzer. However the analyzer shouldn't be important here as the second `has()` can't be answered with the index as it would need a mapping of `STRING` instead of `TEXT`.

Versions and backends:
JanusGraph: 0.3.1
ScyllaDB: 2.1
Elasticsearch: 5.6.3

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the three Gremlin traversals against the listed JanusGraph 0.3.1, ScyllaDB 2.1, and Elasticsearch 5.6.3 setup. Compare the consecutive full-text predicates with the version containing limit(5), then trace the index handling for Mapping.TEXT.asParameter() and verify that the corrected behavior returns root@example.com.

Written by the indexing model from the issue text.

Assessment

Tech stack
elasticsearch, java
Domain
databases, search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.