Hi Michael, Thank you for the response and idea, but I need to get relationships from index to update them on index and graph (I don't need transactional way). Relationships are many millions, so I can't put them into an array. I have to think to other solutions.
Rita Il giorno lunedì 12 maggio 2014 10:35:02 UTC+2, Michael Hunger ha scritto: > > Hi Rita, I don't think this is implemented yet. > > The batch inserter only supports exact queries as far as I know. > > What you can do is to pull the data that you want to update out of the > graph and put it into a sorted numeric array tm[id]=value > Then you can use Arrays.binarySearch() to find the starting point for your > min-and-max values (you might have to look further up and down the array to > find all values). > > Note Arrays.binarySearch() returns -pos-1 for values it doesn't find with > the potential insert position. > > Michael > > Am 12.05.2014 um 10:24 schrieb Rita <[email protected] <javascript:>>: > > Anyone has got an idea about this problem, please? > > > Il giorno giovedì 8 maggio 2014 12:05:25 UTC+2, Rita ha scritto: >> >> 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 java 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(); >> indexRel = index.forRelationships("index"); >> IndexHits<Relationship> rhits = indexRel.query(QueryContext. >> numericRange("tm", (long) 0, d, 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] <javascript:>. > For more options, visit https://groups.google.com/d/optout. > > > -- 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.
