your query key should be "name"
not "actors"

Michael

Sent from my iBrick4


Am 09.06.2011 um 16:49 schrieb Pablo Pareja <ppar...@era7.com>:

> 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
> _______________________________________________
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to