I have a relationship index named dates, which indexes on 2 fields - "year-numeric" and "type". I intend to use range queries on year-numeric and so have indexed it as numeric
dates.add(role1, "year-numeric", new ValueContext(2000).indexNumeric());
where role1 is a relationship between 2 nodes.
In my graph, I have 2 types of relationship which is captured by the 2nd field "type".
While I am able to query it individually:
IndexHits<Relationship> hits = dates.query(QueryContext.numericRange("year-numeric", 1990, 2004),null,null);
and
hits = dates.query("type:occurs");
I would be obliged, if someone can help me in combining together these two conditions.
I have checked here: queryContext - filtering with numbers neo4j/lucene but I am unable to understand the solution.
Thanks!
dates.query("year-numeric:[1990 to 2004] and type:occurs")
? (have not tried myself - just a shoot from the hip). Don't forget to add the type to the index as welldates.add(role1, "type", role1.getType().name())
– Stefan Armbruster