search speed, full text case insensitive indexing

393 views
Skip to first unread message

Krishna Shetty

unread,
Apr 26, 2014, 5:27:59 AM4/26/14
to ne...@googlegroups.com
I am working search feature. I need to return all nodes with matching string in 'name' property. 

I am using the query as suggested here:
match <mypattern> where n.name =~ '.*SUBSTRING.*' return n.Name;

I have also added index on name property.
CREATE INDEX ON :MyLabel1(name);

But the query is not fast.

I have read about full text case insensitive indexing, please suggest how to do this through cypher query.
Or is there any other way to improve search speed.

Thanks

Michael Hunger

unread,
Apr 26, 2014, 6:29:02 AM4/26/14
to ne...@googlegroups.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/d/optout.

Krishna Shetty

unread,
Apr 26, 2014, 12:28:09 PM4/26/14
to ne...@googlegroups.com
Thank you.

Did the following:
>sudo vim conf/neo4j-server.properties
Added below two lines at the bottom(these lines were not there already)
node_auto_indexing=true
node_keys_indexable=name

Restarted neo4j.

And ran below cypher:
>MATCH (n) WHERE has(n.name) SET n.name=n.name;
+-------------------+
| No data returned. |
+-------------------+
Properties set: 94701
19652 ms

It used to take around 4sec, I think same search query now takes around 2 seconds
I am using neo4j-community-2.0.1 on AWS EC2 medium instance.

I think it still takes long time return search result.
Is neo4j suitable for these kind of searches?

Thanks

Michael Hunger

unread,
Apr 26, 2014, 12:31:29 PM4/26/14
to ne...@googlegroups.com
Wrong config file

It's neo4j.properties
Also misses the prop-keys

Sent from mobile device

Krishna Shetty

unread,
Apr 26, 2014, 1:42:07 PM4/26/14
to ne...@googlegroups.com
Updated in conf/neo4j.properties. i.e.,
# 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

I have not done the step 'Setup Node Auto-Index as Fulltext-Index'. This has REST POST calls. Is this setting mandatory? I haven't tried REST calls, is it possible to make this setting from 'neo4j-shell'?

Also, I am not using ':node_auto_index' in my query. I need to find-out how to use ':node_auto_index' in 'match' as I don't use 'start' in my query.

Query still takes 1.6 seconds. 

Thanks,
Krishna


--
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/mPBSwxhEfA4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to neo4j+un...@googlegroups.com.

Michael Hunger

unread,
Apr 26, 2014, 3:32:40 PM4/26/14
to ne...@googlegroups.com


Sent from mobile device

Am 26.04.2014 um 19:42 schrieb Krishna Shetty <ksh...@livingtree.com>:

Updated in conf/neo4j.properties. i.e.,
# 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

I have not done the step 'Setup Node Auto-Index as Fulltext-Index'. This has REST POST calls. Is this setting mandatory? I haven't tried REST calls, is it possible to make this setting from 'neo4j-shell'?

You have to configure the index correctly _upfront_


Also, I am not using ':node_auto_index' in my query. I need to find-out how to use ':node_auto_index' in 'match' as I don't use 'start' in my query

You _have_ to use start for fts

Krishna Shetty

unread,
Apr 27, 2014, 2:30:33 AM4/27/14
to ne...@googlegroups.com
Thank you.
It takes around 300ms now.

I used to curl to make Auto-Index as Fulltext-Index REST call as below.
curl -H Accept:application/json -H charset=UTF-8 -H Content-Type:application/json -X POST -d '{"name":"node_auto_index", "config":{"type":"fulltext","provider":"lucene"}}' http://localhost:7474/db/data/index/node


Thanks,
Krishna

Michael Hunger

unread,
Apr 27, 2014, 7:53:05 AM4/27/14
to ne...@googlegroups.com
Make sure to do that as first thing on a blank db

Sent from mobile device
Reply all
Reply to author
Forward
0 new messages