auto indexing NEVER works

95 views
Skip to first unread message

Antonio Mignolli

unread,
Feb 22, 2013, 11:44:48 AM2/22/13
to ne...@googlegroups.com
Hi folks, I'm playing with cineasts for better understanding neo4j.
I'm under Debian 7, neo4j 1.8.1, openjdk 1.6.0_24.

No luck with auto indexing.

I did everything needed:
in neo4j.properties:

# Enable auto-indexing for nodes, default is false
node_auto_indexing=true

# The node property keys to be auto-indexed, if enabled
#node_keys_indexable=name,age
node_keys_indexable=name

neo4j-sh (0)$ index --create node_auto_index -t Node

Is the name node_auto_index mandatory?

After that I tried 
start f=node:node_auto_index('name:Tom') return f;

in many flavours, with wildcards, with exact names,
but always 0 rows.

What am I missing?
Thanks.

Mattias Persson

unread,
Feb 23, 2013, 6:31:06 PM2/23/13
to Neo4j Development
The current auto indexes doesn't index existing data when created/enabled. Property automatic indexing will started to be addressed in neo4j 2.0.


2013/2/22 Antonio Mignolli <antonio...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Mattias Persson, [mat...@neotechnology.com]
Hacker, Neo Technology
www.neotechnology.com

Peter Neubauer

unread,
Feb 25, 2013, 3:25:10 AM2/25/13
to Neo4j User
Antonio,
for the current autoindexing to pick up existing data, you need to run an update on the properties, e.g. name by updating all nodes with name-properties, something like


start n =node(*) 
where n.name! <> null 
with n as named 
return named;

/peter


Cheers,

/peter neubauer

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

Neo4j 1.8 GA - http://www.dzone.com/links/neo4j_18_release_fluent_graph_literacy.html


Antonio Mignolli

unread,
Feb 25, 2013, 9:12:53 AM2/25/13
to ne...@googlegroups.com
Hi Peter, thanks, but it's not working yet.
I ran your script, but still I could'n find new nodes,
created by myself. All I can see is the original database.
Seems like I have to recreate indexes every time I insert a node?
:) Please tell me it's not true.
Even restarting neo4j server produced no effects.

(I inserted a new Actor and a new movie, so I updated both the property "title"
and "name" as you suggested).

A question: why did you use
"with n as named" instead of setting n.name directly?


On 25 February 2013 09:25, Peter Neubauer
--
Antonio Mignolli
Ing. Informatico
Via Saline 9 37020 Negrar (VR)
=======================
phone +393498453787
skype tonjo74

Michael Hunger

unread,
Feb 25, 2013, 9:17:45 AM2/25/13
to ne...@googlegroups.com
Try

If you use neo4j-shell on the commandline make sure to pass in -config conf/neo4j.properties

start f=node:node_auto_index('name:*') return f;

Sent from mobile device

Antonio Mignolli

unread,
Feb 25, 2013, 9:40:04 AM2/25/13
to ne...@googlegroups.com
I'm running the server on my pc, with the packaged debian version
I have startup script /etc/neo4j-service,
I'm using both web interface and command-line.
The latter is launched with no arguments,
which I assume it's connecting to the running server
(indeed it fails when the server is not running).

I checked neo4j.properties is in fact read upon starting,
I was starting to doubt it.

I repeat my environment:
OpenJDK 6, neo4j 1.8.1, Debian wheezy.



On 25 February 2013 15:17, Michael Hunger

Peter Neubauer

unread,
Feb 25, 2013, 9:50:32 AM2/25/13
to Neo4j User
Do you have the messages.log from the startup?

Also, did you check that you can execute Michaels cypher script as a check?


-peter

Antonio Mignolli

unread,
Feb 25, 2013, 10:02:26 AM2/25/13
to ne...@googlegroups.com
Sure. My log is located in
/var/lib/neo4j/data/log/neo4j.0.0.log,
I attached it.
Notice WARNING on JDK.

Michael's script run perfectly.
Though I think it's better to remove the return statement ;)


On 25 February 2013 15:50, Peter Neubauer
neo4j.0.0.log

Michael Hunger

unread,
Feb 25, 2013, 11:14:07 AM2/25/13
to ne...@googlegroups.com
Please read correctly
Peter said messages.log

Which is in data/graph.db

Sent from mobile device

Am 25.02.2013 um 16:02 schrieb Antonio Mignolli <antonio...@gmail.com>:

> messages.log

Antonio Mignolli

unread,
Feb 25, 2013, 11:29:42 AM2/25/13
to ne...@googlegroups.com
Sorry, I am really new at neo4j,
I thought it was the same file.
It's attached.


On 25 February 2013 17:14, Michael Hunger
> --
> You received this message because you are subscribed to a topic in the Google Groups "Neo4j" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/neo4j/wlYTMYP91iU/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to neo4j+un...@googlegroups.com.
messages.log

Peter Neubauer

unread,
Feb 25, 2013, 1:01:44 PM2/25/13
to Neo4j User
Antonio, is the the dataset donwloaded from http://www.neo4j.org/develop/example_data?

The log looks good, would like to try it.

/peter


Cheers,

/peter neubauer

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

Neo4j 1.8 GA - http://www.dzone.com/links/neo4j_18_release_fluent_graph_literacy.html


--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.

Antonio Mignolli

unread,
Feb 25, 2013, 1:12:16 PM2/25/13
to ne...@googlegroups.com
Yes, Michael Hunger uploaded a new version
just 3 days ago, after a post of mine.

Indexing works like a charm on present data,
but no results with new nodes, even after
the script.

Do you want to connect to me?
I could open web interface.


On 25 February 2013 19:01, Peter Neubauer

Peter Neubauer

unread,
Feb 25, 2013, 1:16:58 PM2/25/13
to Neo4j User
Yeah,
I could try that.


Cheers,

/peter neubauer

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

Neo4j 1.8 GA - http://www.dzone.com/links/neo4j_18_release_fluent_graph_literacy.html


Antonio Mignolli

unread,
Feb 25, 2013, 1:29:16 PM2/25/13
to ne...@googlegroups.com
Uhm, wait,
maybe I got it.

Actually, node_auto_index *works*.
In my previous questions I asked if that name is mandatory.
My hope was every index will be updated,
maybe that's what I'm doing bad.

So both node_auto_index and relationship_auto_index
are the only automatically updated indexes?


On 25 February 2013 19:16, Peter Neubauer

Peter Neubauer

unread,
Feb 25, 2013, 6:28:02 PM2/25/13
to Neo4j User
Yes,
correct. This will change in the current Neo4j 2.0 work, but for the time being that's right.

/peter


Cheers,

/peter neubauer

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

Neo4j 1.8 GA - http://www.dzone.com/links/neo4j_18_release_fluent_graph_literacy.html


Antonio Mignolli

unread,
Feb 25, 2013, 6:42:01 PM2/25/13
to ne...@googlegroups.com
Thank you very much,
you and the others, you're really kind guys.

Can I ask you why in the script:

start n =node(*)
where n.name! <> null
with n as named
set named.name = named.name
return named;

you use "with n as named" instead of simply n ?


On 26 February 2013 00:28, Peter Neubauer

Michael Hunger

unread,
Feb 25, 2013, 6:55:52 PM2/25/13
to ne...@googlegroups.com
There is no reason perhaps a kind of communication that the node has a name property.

Cheers

Michael

(neo4j.org) <-[:WORKS_ON]- (@mesirii) -[:TAKES_CARE_OF]-> (you) -[:WORKS_WITH]->(@Neo4j)

Peter Neubauer

unread,
Feb 26, 2013, 3:43:41 AM2/26/13
to Neo4j User
Yeah,
this is purely optional, I just wanted to make it obvious that any "named" node will have a property "name", as opposed to n, which in the first part can contain even other nodes.

Sorry for the confusion.

/peter


Cheers,

/peter neubauer

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

Neo4j 1.8 GA - http://www.dzone.com/links/neo4j_18_release_fluent_graph_literacy.html


Reply all
Reply to author
Forward
0 new messages