deleting the node_auto_index or relationship_auto_index (in order to modify its type... or modify it's type without deleting and recreating it...)

71 views
Skip to first unread message

j2d3

unread,
Sep 19, 2012, 7:42:36 PM9/19/12
to ne...@googlegroups.com
I posted my question on the relevant page in docs (http://docs.neo4j.org/chunked/snapshot/rest-api-configurable-auto-indexes.html#comment-656032949) , and wanted to ask here:

I'm experiencing a kind of catch-22 with using a node_auto_index. I've got a database that has the node_auto_index setup with the default "exact", but I need it to be "fulltext". However, I can't delete or modify the node_auto_index because it's read only. How can I get rid of this bad node_auto_index so I can recreate it with the correct settings? Above it says: "To change the auto-index configuration existing indexes would have to be deleted first, so be careful!" - but there is no information about how to delete this "read only" index. I have no problem re-indexing my existing data once I've got the auto-index set up correctly... (a groovy script that resets the properties on every single node in the db - it takes a while to run, but it works.)


j2d3

unread,
Sep 19, 2012, 7:44:21 PM9/19/12
to ne...@googlegroups.com
By the way - some context - am using Neo4j - Graph Database Kernel 1.8.M07

Peter Neubauer

unread,
Sep 19, 2012, 10:14:08 PM9/19/12
to ne...@googlegroups.com
Well,
you can hard-delete the index files under
your_graphdb_dir/index/lucene/node/... and you will see the autoindex.
Delete the directory and you should be fine?

Cheers,

/peter neubauer

Neo4j 1.8.RC1 "Vindeln Vy" -
http://blog.neo4j.org/2012/09/neo4j-18rc1-really-careful-ftw.html

G: neubauer.peter
S: peter.neubauer
P: +46 704 106975
L: http://www.linkedin.com/in/neubauer
T: @peterneubauer

Wanna learn something new? Come to @graphconnect.
> --
>
>

John Durkin

unread,
Sep 19, 2012, 11:21:12 PM9/19/12
to ne...@googlegroups.com
That was actually my initial impulse, actually. I did stop neo4j, delete that directory, and start it back up, only to find that the index remained. I guessed the existence and configuration of the index must be noted in some other file under my graph.db directory, and that the directory I deleted called node_auto_index only contained the data of the index. Now it's just an empty  node_auto_index which remains "read only." It cannot be deleted or have its configuration modified.

--



j2d3

unread,
Sep 20, 2012, 12:23:34 PM9/20/12
to ne...@googlegroups.com, john....@gmail.com
As it turns out, your advice *did* work. I was fooled into giving up when I saw that the index was still listed after deleting that directory and restarting. When you attempt to reset the configuration to fulltext after deleting the directory, you get a warning, but it does work!

JD


On Wednesday, September 19, 2012 8:21:15 PM UTC-7, j2d3 wrote:
That was actually my initial impulse, actually. I did stop neo4j, delete that directory, and start it back up, only to find that the index remained. I guessed the existence and configuration of the index must be noted in some other file under my graph.db directory, and that the directory I deleted called node_auto_index only contained the data of the index. Now it's just an empty  node_auto_index which remains "read only." It cannot be deleted or have its configuration modified.

John Durkin

unread,
Sep 20, 2012, 12:40:52 PM9/20/12
to ne...@googlegroups.com
HOWEVER - (working with a colleague who fixed this situation last night) - you cannot modify an existing index with the REST API at all... you have to use the command line. So, here's what u do:

stop the db
delete the index's directory: graph.db/index/lucene/node/node_auto_index
start the db.

then, at the shell / command line for the db:

  • neo4j-sh (0)$ index --get-config node_auto_index
  • ==> {
  • ==>     "provider": "lucene",
  • ==>     "type": "exact"
  • ==> }
  • neo4j-sh (0)$ index --set-config node_auto_index type fulltext
  • ==> INDEX CONFIGURATION CHANGED, INDEX DATA MAY BE INVALID
  • neo4j-sh (0)$ index --get-config node_auto_index
  • ==> {
  • ==>     "provider": "lucene",
  • ==>     "type": "fulltext"
  • ==> }
  • neo4j-sh (0)$ 


I think the documentation should be updated so that when discussing auto_indexing, the examples use the command line, not the REST API, since the REST API cannot update / change existing indices (as far as I know) - or if you can make changes to indices via the REST API, please list those endpoints and give examples.

Peter Neubauer

unread,
Sep 21, 2012, 7:37:15 PM9/21/12
to ne...@googlegroups.com
John,
this is neat, I didn't even know about this! However, does that new
config "stick after restars"?

Cheers,

/peter neubauer

Neo4j 1.8.RC1 "Vindeln Vy" -
http://blog.neo4j.org/2012/09/neo4j-18rc1-really-careful-ftw.html

G: neubauer.peter
S: peter.neubauer
P: +46 704 106975
L: http://www.linkedin.com/in/neubauer
T: @peterneubauer

Wanna learn something new? Come to @graphconnect.


> --
>
>
Reply all
Reply to author
Forward
0 new messages