Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
01-14-2021 08:12 AM
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?
01-15-2021 01:20 AM
Looks like a bug, can you raise this on
01-15-2021 01:42 AM
Thanks Michael, I will submit an issue
01-15-2021 04:24 AM
01-15-2021 04:36 AM
So you create an index on the Client Label and the property of name
But your FTS index on on the Client label and the code property.
Is that correct? Do your Client nodes have a code property?
I ran this on the Movies db and it worked:
CALL db.index.fulltext.createNodeIndex("testft2",["Movie"],["title"], { analyzer: "standard-folding" });
CALL db.index.fulltext.queryNodes('testft2', '*matrix*')
I had 3 nodes returned.
01-15-2021 12:48 PM
Sorry it was a typo, the constraint is created on the same property the full text index.
01-15-2021 05:09 PM
Are you thus all set and this was down to a typo? mark the issue solved?
01-18-2021 01:59 AM
It's a bug.
Yes, the typo is in the CONSTRAINT name and property. It should be
CREATE INDEX ClientCode FOR (c:Client) ON (c.code);
An UNIQUENESS constraint is created before the FullText search index.
01-20-2021 02:31 AM
Just to keep this post updated.
A member of the developer team has been able to reproduce this bug and is working on a solution.
All the sessions of the conference are now available online