The typical search in neo4j is to write query with restrictions and the node type is an important restriction type. For example:
match (n:Product) where n.name='iPhone' return n
However, if the user doesn't know what node type should be given, he may just write query: match (n) where n.name='iPhone' return n
And this 'iPhone' may be names of one or another node types, such as Product, or Brand. To make the query more efficient, I may have a function working behind the scene and convert user's keyword search into this query:
match (n)
where (n:Product or n:Brand) and n._name = 'iPhone'
return n
This takes 150 ms shown in the browser, while this one only takes 1 ms:
match (n:Product) where n._name = 'iPhone'
return n
Is there a more efficient way to support users' such queries? Given a keyword without other restrictions, the query return any nodes that may hit this query.
I know of full-text search. Can I build a single fulltext index from different nodes? I used to create fulltext index on a single property of a single node. In the use case above, how can I create a single index to meet the requirements?
You can Profile this (using Neo4J's PROFILE or EXPLAIN), but I suspect that in the first version, (without specifying the Label) means there are a lot more nodes to go through.
I believe by limiting the Nodes to one type ('Product'), there's less to go through.