Skip to main content

Function: GraphSearchContextProvider()

GraphSearchContextProvider(props): ReactNode | Promise<ReactNode>

Defined in: packages/graph-search/src/context.tsx:45

Search context provider. It exposes the minisearch instance to search in the graph and is also responsible to keep the index up to date with the graph.

You can override the minisearch options by passing them in the minisearchOptions prop.

Documents in the index have the type Document :

  • id is node or edge key in the graph
  • type is "nodes" or "edges"
  • itemId is the unique id in the index (concatenation of type and id)
  • label is the label of the node or edge in the graph
  • every attributes of the node or edge are also in the index, prefixed by prop_

Parameters

props

PropsWithChildren<GraphSearchContextProviderProps>

Returns

ReactNode | Promise<ReactNode>