Fulltext search string with neo4j v 2.3.1

85 views
Skip to first unread message

luca scipioni

unread,
Jan 19, 2016, 6:48:56 PM1/19/16
to Neo4j
Hi there. I read this post of Michael Hunger http://jexp.de/blog/2014/03/full-text-indexing-fts-in-neo4j-2-0/ but is it valid for my version? And if it's yes, on the mac version inside the file neo4j.properties there aren't these properties node_auto_indexing and node_keys_indexable, can i simply add these two properties in the file? Another question about this, is it the better solution, use the fulltext index to find a stopname? My problem is this, how can i improve the find of a name substring? Below an example:
if a user wants to find a name like via XX settembre, and a stop name is Roma, via XX settembre, and the user puts via, i want to get all stops that contain via.

I saw here http://neo4j.com/docs/2.3.2/query-schema-index.html#schema-index-use-index-with-starts-with that with CONTAINS operator cannot currently be solved using indexes.

Any suggestions? I have million nodes.

RickBullotta

unread,
Jan 20, 2016, 4:27:15 PM1/20/16
to Neo4j
You can't efficiently search for letters contained within a word using Neo (or Lucene) but you can definitely search for words in a phrase with very high performance. The default tokenizer will do this for you.

Michael Hunger

unread,
Jan 20, 2016, 8:49:13 PM1/20/16
to ne...@googlegroups.com
Hi,

yes, you can still use the approach, let me know if anything shouldn't work (it should).
Yes you can just add the config settings to neo4j.properties

We will have some better support for this in Neo4j 3.0. But for now that's the way to go.

Cheers, Michael

--
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.

luca scipioni

unread,
Jan 22, 2016, 5:05:38 AM1/22/16
to Neo4j
Hi Rick, thanks for the answer, so i can do this: user puts an input like this "via XX settembre, pescara", then via js or server side code split and clean the phrase in words, (maybe i may take only words longer than 3 characters) then build a cypher query like this "START departure=node:node_auto_index("stopName:*{firstWord}* OR stopName:*{secondWord}*") RETURN departure" perhaps with a sort. Is it right?

luca scipioni

unread,
Jan 22, 2016, 5:07:21 AM1/22/16
to Neo4j
Hi Michael, everithings works fine. Thanks.
Reply all
Reply to author
Forward
0 new messages