cancel
Showing results for 
Search instead for 
Did you mean: 

fulltext search for specific field

peaklu
Node

Does neo4j support creating fulltext index for different labels' fields?

Just like this

create fulltext index ft_1 for (a:A|b:B) on each [a.f1, b.f2];

 

5 REPLIES 5

Cobra
Ninja
Ninja

Hello @peaklu 😊

Yes, it's possible:

CREATE FULLTEXT INDEX titlesAndDescriptions FOR (n:Movie|Book) ON EACH [n.title, n.description]

Regards,
Cobra

Maybe you misunderstood me or 

Now, I have label Movie {title, description} and label Book {title, description}, but I just want to add fulltext  index on Movie.title and Book.title&Book.description. The way you mentioned below adds index on 

property with the same name, that means it add index both (Movie.title&Movie.description) and (Book.title&Book.description).
CREATE FULLTEXT INDEX titlesAndDescriptions FOR (n:Movie|Book) ON EACH [n.title, n.description]

 

Sorry, I misunderstood, what you want do is not possible with one index, you will have to define two indexes.

Got it, thank you. By the way, does neo4j have any plan to support this way?

Not to my knowledge.

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.