Hi all,
I need to do a numeric range (on a propertie store as long) query on my
relationships lucene index, using batch inserter. I am using Neo4j 1.9.5 on
windows machine embedded in ja ava project.
Here is the example code:
BatchInserterIndexProvider indexProvider = new
LuceneBatchInserterIndexProvider(graphBatch);
BatchInserterIndex indexBatch = indexProvider.relationshipIndex(
"index", MapUtil.stringMap("type", "exact"));
IndexHits<Long> relHits = indexBatch.query(QueryContext.numericRange
("tm", (long) 0, d, true, false));
I get this error :
java.lang.NullPointerException
at org.apache.lucene.util.SimpleStringInterner.intern(
SimpleStringInterner.java:54)
at org.apache.lucene.util.StringHelper.intern(StringHelper.java:39)
at org.apache.lucene.index.Term.<init>(Term.java:38)
at org.apache.lucene.queryParser.QueryParser.getFieldQuery(
QueryParser.java:643)
at org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:
1436)
at org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java
:1319)
at org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:
1245)
at org.apache.lucene.queryParser.QueryParser.TopLevelQuery(
QueryParser.java:1234)
at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:
206)
at org.neo4j.index.impl.lucene.IndexType.query(IndexType.java:300)
at org.neo4j.index.impl.lucene.LuceneBatchInserterIndex.query(
LuceneBatchInserterIndex.java:372)
How can I solve?
Usually I do the same query without problem on lucene index on db opened in
normal embedded mode:
GraphDatabaseService graph = new GraphDatabaseFactory().
newEmbeddedDatabaseBuilder(DBgraph.path + "graph").setConfig(conf).
newGraphDatabase();
index = graph.index();
transazioni = index.forRelationships("transazioni");
carte = index.forNodes("carte");
rhits = transazioni.query(QueryContext.numericRange("tm", (long)
0,datapartenza
, true, false));
Do I have to write the query in other way for
LuceneBatchInserterIndexProvider? Can does anyone explain me please?
Thanks in advance.
Rita
--
You received this message because you are subscribed to the Google Groups
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.