Neo4j v4.2.0
EDIT:
Issue link: Full-Text indexes not working when an analyzer is specified. · Issue #12662 · neo4j/neo4j · GitHub
After double-checking the issue it seems that passing the config parameter { analyzer: "standard-analyzer"} to the createNodeIndex function breaks the Full-Text.
This works:
CALL db.index.fulltext.createNodeIndex("PortfolioCodeFT",["Portfolio"],["code"])
This doesn't work:
CALL db.index.fulltext.createNodeIndex("PortfolioCodeFT",["Portfolio"],["code"], {analyzer:"standard-folding"})
I have a cypher script where I load data, create nodes and relationships, and also create Full-Text indexes.
It's done like this:
:begin
CREATE INDEX ClientName FOR (c:Client) ON (c.name);
:commit
:begin
CALL db.index.fulltext.createNodeIndex("ClientCodeFT",["Client"],["code"], { analyzer: "standard-folding" });
:commit
When I query :schema on Neo4j Desktop I can see the list of CONSTRAINTS and Indexes created and I can see that "ClientCodeFT" is ONLINE.
If I query using the Full-Text index like this:
CALL db.index.fulltext.queryNodes('ClientCodeFT', '*SOMECODE*') YIELD node
RETURN node LIMIT 25;
All I get is (no changes, no records)
If I manually drop the Index:
CALL db.index.fulltext.drop("ClientCodeFT");
Then re-create it again (note I don't specify the analyzer) :
CALL db.index.fulltext.createNodeIndex("ClientCodeFT",["Client"],["code"]);
And run the same query again:
CALL db.index.fulltext.queryNodes('ClientCodeFT', '*SOMECODE*') YIELD node
RETURN node LIMIT 25;
Then I get the nodes. Why is that?