and you should use index.query(key,querystring) not get for fulltext queries
Sent from my iBrick4 Am 09.06.2011 um 17:04 schrieb Pablo Pareja <[email protected]>: > Hi again, > I just found out that I had the wrong name for querying the actors index, > still when I change it for "name" > like this: > > System.out.println(index.get("name", "Keanu").size()); > System.out.println(index.get("name", "keanu").size()); > System.out.println(index.get("name", "Keanu Reeves").size()); > > I still get unexpected results for a fulltext index: > > 0 > 0 > 1 > > so it seems that it is actually an exact index what was created, even though > I specified the string 'fulltext' ... > > Pablo > > On Thu, Jun 9, 2011 at 4:49 PM, Pablo Pareja <[email protected]> wrote: > >> Hi all! >> >> Recently I noticed that some fulltext indexes I created and populated in my >> project in the Batch insertion >> phase are not working as expected. >> I've carried out some tests and cannot come up with what can be going >> wrong. >> That's why I thought, ok let's try with a really basic example (mostly >> taken from the official wiki ) and >> see if it works right first. >> This is the code: >> >> BatchInserter inserter = new >> BatchInserterImpl("target/neo4jdb-batchinsert"); >> BatchInserterIndexProvider indexProvider = new >> LuceneBatchInserterIndexProvider(inserter); >> BatchInserterIndex actors = >> indexProvider.nodeIndex("actors", MapUtil.stringMap("type", "fulltext", >> "provider", "lucene")); >> >> >> Map<String, Object> properties = MapUtil.map("name", "Keanu >> Reeves"); >> long node = inserter.createNode(properties); >> actors.add(node, properties); >> >> >> indexProvider.shutdown(); >> inserter.shutdown(); >> >> GraphDatabaseService graphDbService = new >> EmbeddedGraphDatabase(CommonData.DATABASE_FOLDER); >> >> Map<String, String> indexFullTextProps = new >> HashMap<String, String>(); >> indexFullTextProps.put("provider", "lucene"); >> indexFullTextProps.put("type", "fulltext"); >> >> //----------node indexes----------- >> Index<Node> index = >> graphDbService.index().forNodes("actors", indexFullTextProps); >> System.out.println(index.get("actors", "Keanu").size()); >> System.out.println(index.get("actors", "keanu").size()); >> System.out.println(index.get("actors", "Keanu >> Reeves").size()); >> >> graphDbService.shutdown(); >> >> >> I'm probably doing something wrong but I'm getting 0 size in the three >> queries I perform... >> Otherwise, is there any kind of known issue for this scenario (I mean, >> fulltext indexing with Batch insertion) ? >> >> I'd really appreciate any help with this. >> Cheers, >> >> Pablo Pareja >> >> >> -- >> Pablo Pareja Tobes >> LinkedIn http://www.linkedin.com/in/pabloparejatobes >> Twitter http://www.twitter.com/pablopareja >> >> http://about.me/pablopareja >> http://www.ohnosequences.com >> >> > > > -- > Pablo Pareja Tobes > LinkedIn http://www.linkedin.com/in/pabloparejatobes > Twitter http://www.twitter.com/pablopareja > > http://about.me/pablopareja > http://www.ohnosequences.com > _______________________________________________ > Neo4j mailing list > [email protected] > https://lists.neo4j.org/mailman/listinfo/user _______________________________________________ Neo4j mailing list [email protected] https://lists.neo4j.org/mailman/listinfo/user

