[Neo4j] Why node's index entry can not be removed from lucene index after the node is deleted from the graph

Luanne Misquitta LMisquitta at saba.com
Tue Dec 14 08:41:32 CET 2010


That's strange. I indexed a single property on two nodes, and then used remove method on the index to remove that property- then checked in Luke, and the documents appear to be there, but marked deleted. I could undelete them also via Luke. When I did a Luke->Optimize index, then the documents were well and truly deleted. Not sure what the intended behavior of the index remove is now that you bring this up.

Regards

Luanne M.
Tech Lead

twitter / @luannem   
linkedin / http://in.linkedin.com/in/luannemisquitta 
skype / luanne.misquitta
blog / http://thought-bytes.blogspot.com/
Saba. Power Up Your People.


-----Original Message-----
From: user-bounces at lists.neo4j.org [mailto:user-bounces at lists.neo4j.org] On Behalf Of Samuel Feng
Sent: Tuesday, December 14, 2010 12:31 PM
To: Neo4j user discussions
Subject: Re: [Neo4j] Why node's index entry can not be removed from lucene index after the node is deleted from the graph

I checked the index.remove(), it can only delete the key filed from the node
entry in index. (The node entry is a document in lucene index)

The node entry is still there....

2010/12/14 Luanne Misquitta <LMisquitta at saba.com>

> You could perhaps also delete the data from the index using:
> Index.remove(T entity, String key, Object value)
>
> However, I assume that if you've added x properties of the node to the
> index, you'd have to remove all those X properties?
>
> Regards
> Luanne M.
> Tech Lead
>
> twitter / @luannem
> linkedin / http://in.linkedin.com/in/luannemisquitta
> skype / luanne.misquitta
> blog / http://thought-bytes.blogspot.com/
> Saba. Power Up Your People.
>
>
> -----Original Message-----
> From: user-bounces at lists.neo4j.org [mailto:user-bounces at lists.neo4j.org]
> On Behalf Of Samuel Feng
> Sent: Tuesday, December 14, 2010 12:11 PM
> To: Neo4j user discussions
> Subject: [Neo4j] Why node's index entry can not be removed from lucene
> index after the node is deleted from the graph
>
> Dears,
>
> Index<Node> persons = graphDb.index().forNodes( "persons" );
> Node firstPerson = graphDb.createNode();
> Node secondPerson = graphDb.createNode();
> persons.add( firstPerson, "name", "Mattias Persson" );
>
> Now I have to delete the firstPerson node from the graph.
> i.e firstPerson.delete()
>
> After the transaction committed, the node is deleted from the graph.
> However, I then further check the lucene index using "LUKE", still can find
> the node's entry in it.
>
> I understand that this node entry will not affect the query result of
> neo4j.
> But If my graph has many deletions, there will produce a lot
> of obsoleted node entry in lucene index.
>
> Do u have any ideas that how I can delete this obsoleted index entries or
> neo4j has some other mechanism to do this?
> _______________________________________________
> Neo4j mailing list
> User at lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
> _______________________________________________
> Neo4j mailing list
> User at lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
_______________________________________________
Neo4j mailing list
User at lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


More information about the User mailing list