WLJS LogoWLJS Notebook

SemanticSearch

SemanticSearch[index, query] finds the items similar to query inside index.

  • SemanticSearch[index, query -> f] filters the results using the function f.
  • SemanticSearch[index, query, prop] returns the specified property prop.

Examples

Search a semantic index:

index = SemanticSearchIndex[{"apple", "banana", "car", "truck"}];
SemanticSearch[index, "fruit"]

Filter results:

SemanticSearch[index, "vehicle" -> (StringLength[#] > 3 &)]

Get distances:

SemanticSearch[index, "food", "Distances"]

Please visit the official Wolfram Language Reference for more details.

On this page