Hello List,

Anyone can help me on this?

Thanks and regards,

Samuel

在 2011年11月14日 下午1:51,Samuel Feng <okos...@gmail.com>写道:

> Dear List,
>
> I have two questions about indexing
>
> *Question 1*
>
> At the time of creation, we can use extra configuration can be specified
> to control the behavior of the index and which backend to use.
> e.g,
> IndexManager index = graphDb.index();
> Index<Node> movies = index.forNodes( "movies-fulltext",
>         MapUtil.stringMap( IndexManager.PROVIDER, "lucene", "analyzer",
> "org.apache.lucene.analysis.cn.smart.SmartChineseAnalyzer" ) );
> movies.add( theMatrix, "cTitle", "黑客帝国" );
> movies.add( theMatrix, "date", "2000-01-01" );
>
> When adding node "theMatrix" to index, all the values will be
> analyzed/tokenized by SmartChineseAnalyzer.
> However, for some fields I do not want it to be analyzed/tokenized, Any
> interfaces to implement this? Can enhance valueContext so that I can pass
> in something like Field.Index.NOT_ANALYZED when adding a node into index?
>
> *Question 2*
>
> For Query,
>
> IndexHits<Node> nodes = movies .query(new BooleanQuery(...));
> Node currentNode = null;
> List<Movie> result = new ArrayList<Movie>();
>
> while (nodes.hasNext()) {
>    currentNode = nodes.next();
>    Movie m = new Movie(currentNode);
>
>    if(m.getDate().equals("2001-01-01")){
>      result.add(m);
>    }
> }
>
> I found that if the indexHits is large, say size() > 20000, Each
> m.getDate() will spend some time to load the value from underlying
> node(especially the first-time query), So the total elapsed time is very
> long.
> Any interface that I can read the lucene document behind this node
> directly? Maybe u can use nodes.currentDoc() to expose it?
>
> Thanks and Regards,
>
> Samuel
>
>
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to