Full-text index is named by developers. A same name cannot be shared between full-text indexes within a graphset.
Returned table name: _nodeFulltext, _edgeFulltext
Returned table header: name | properties | schema | status (Name, properties, schema and status [creating|done] of full-text)
Syntax:
Syntax// To show all full-text indexes in the current graphset (node full-texts and edge full-texts in separate tables) show().fulltext() // To show all full-text node indexes in the current graphset show().node_fulltext() // To show all full-text edge indexes in the current graphset show().edge_fulltext()
Properties of decimal type do not support full-text index.
Syntax:
Syntax// To create full-text index for a certain property of a certain node schema in the current graphset create().node_fulltext(@<schema>.<property>,"<name>") // To create full-text index for a certain property of a certain edge schema in the current graphset create().edge_fulltext(@<schema>.<property>,"<name>")
Example: Create full-text index named "prodDesc" for @product property description
UQLcreate().node_fulltext(@product.description, "prodDesc")
Deleting a property will also delete its full-text index.
Syntax:
Syntax// To delete full-text index for a certain node property from the current graphset drop().node_fulltext("<name>") // To delete full-text index for a certain edge property from the current graphset drop().edge_fulltext("<name>")
Example: Delete the full-text index named 'prodDesc'
UQLdrop.().node_fulltext("prodDesc")
Ultipa's full-text filter achieves high speed full-text search, it is an important implementation scenario of Ultipa filter. It uses conditional operator contains to judge whether a full-text index contains ALL the specified keywords. There are two criteria for judging 'contains':
NOTEFuzzy search is always recommended unless user has a clear request of precise matching.
Syntax: {~<fulltext> contains "<keyword1> <keyword2> ..."}
where space is used to separate multiple <keyword>, and should use backslash \ as the prefix if has English double quotation marks in a <keyword>; <keyword> used for fuzzy matching should end with asterisk *.
Example: Find products that contain keywords 'graph' and 'database' by the full-text index named 'prodDesc'
UQLfind().nodes({~prodDesc contains "graph database"}) return nodes
Example: Find products that contain keywords 'graph' or 'database' by the full-text index named 'prodDesc'
UQLfind().nodes({~prodDesc contains "graph" || ~prodDesc contains "database"}) return nodes
Example: Find products that contain 'graph', and words start with 'ult' by the full-text index named 'prodDesc'
UQLfind().nodes({~prodDesc contains "graph ult*"}) return nodes
Example: Fuzzy search for 10 paths that start from accounts which have segmented word 'capital*', firstly arrive accounts which have segmented word 'investment*', then arrive accounts which have segmented word 'AI*', use full-text index 'companyName'
UQLn({~companyName contains "capital*"}).e().n({~companyName contains "investment*"}) .e().n({~companyName contains "AI*"}) as paths return paths{*} limit 10
Example: Fuzzy search for 10 paths from 'Sequoia*' accounts to 'Hillhouse*' accounts within 5 steps, use full-text index 'companyName'
UQLn({~companyName contains "Sequoia*"}).e()[:5].n({~companyName contains "Hillhouse*"}) as paths return paths{*} limit 10
Note: Given a GP/LP or business knowledge graph network, the query rules above are equivalent to a deep Ad hoc network of 'Sequoia' and 'Hillhouse' companies. The same operation requires massive manual interventions or batch executions in whether a manual or three-check system. Before Ultipa invented the template-based full-text search, a query like this is unthinkable! Now, this can be done with ease, elegance and in real time.