You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 3, 2021. It is now read-only.
would search the index using the search string pizza and the ~ indicates a fuzzy text search, so slight misspellings will match.
Directives
We could use schema directives to indicate which full text indexes exist, or more usefully, which should be created. Something like:
type Movie {
movieId: ID!
title: String @neo4j_search(name: "movieIndex")
description: String @neo4j_search(name: "movieIndex")
year: Int
}
Filter
The schema augmentation process could pick up the @neo4j_search directives and add a field to the generated _MovieFilter type for the movieIndex. Then a query using this index would look something like this:
query {
Movie(filter: {movieIndex: "matrix"}) {
title
}
}
which would then translate into something like:
CALL db.index.fulltext.queryNodes("movieIndex", "matrix")
YIELD node
RETURN node {.title} AS movie
this might be a bit tricky to support for nested filters, so perhaps a better route would be to expose the index as an argument on the Query fields.
Neo4j supports full text search through the use of procedures. For example:
to create a fulltext index:
this creates a full text index named
businessNameIndex
and adds thename
anddescription
properties on theBusiness
node label to the index.We can then search the index, for example:
would search the index using the search string
pizza
and the~
indicates a fuzzy text search, so slight misspellings will match.Directives
We could use schema directives to indicate which full text indexes exist, or more usefully, which should be created. Something like:
Filter
The schema augmentation process could pick up the
@neo4j_search
directives and add a field to the generated_MovieFilter
type for themovieIndex
. Then a query using this index would look something like this:which would then translate into something like:
this might be a bit tricky to support for nested filters, so perhaps a better route would be to expose the index as an argument on the Query fields.
See this blog post, this knowledge base article, and the docs for other examples of using full text search with Neo4j.
The text was updated successfully, but these errors were encountered: