1
votes

I am using node.js to connect to the neo4j database. Whenever I have to set an index for a node, I do it manually by going to the neo4j browser (localhost:7474).

CREATE INDEX ON :user(username)

First of all to be clear, this is an automatic index? Any changes or additions to :user are automatically maintained? Let me know if I am wrong.

If so, how does full text index work on neo4j? Is it the same process and neo manages automatically? For example does the following create full text index? Or we need to do something else?

CREATE INDEX ON :user(aboutme)

I built my own nodejs adapter to connect to neo4j, and so I only have access to cypher queries at the moment. To create an index I only have access to cypher or the browser (7474). So what is the proper way to create automatic fulltext index, preferably from the browser itself? And how do I access it using the cypher (or do I have to access it? does neo automatically figure out what index to use?). Online documentation and tutorials are a bit complicated for beginners :/ .

(I want to be able to do text search on the :user(aboutme) property)

1
I've written up a blog post on fulltext indexing with Neo4j, see blog.armbruster-it.de/2014/10/…Stefan Armbruster
Yes, those indexes are automatic. They will index existing data in the background after running the statement and the index will be updated on every relevant write op.albertoperdomo

1 Answers

0
votes

If you want a full text index (where you can use the index to match on parts of the string and not the full, exact string), that isn't currently supported by the new cypher automatic indexes (like CREATE INDEX ON :user(username)). To do that you need to use what are called the legacy indexes. These use lucene under the covers and are much more powerful, but I believe they will eventually go away once that same functionality is supported with the new indexes.

Personally for full-text search I prefer using something like elasticsearch as it is easier to set up and use.