Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Created December 10, 2023 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GroupDocsGists/a3c8b78d8df5fea31964bf5dd2174d32 to your computer and use it in GitHub Desktop.
Save GroupDocsGists/a3c8b78d8df5fea31964bf5dd2174d32 to your computer and use it in GitHub Desktop.
Fuzzy Search in Files across Folders using Java
// Fuzzy Search multiple files across multiple folders using Java
// Creating an index folder and add document's folder to it
Index index = new Index("path/indexing-folder-path");
index.add("path/parent-folder");
SearchOptions options = new SearchOptions();
options.getFuzzySearch().setEnabled(true); // Enabling the fuzzy search
options.getFuzzySearch().setFuzzyAlgorithm(new SimilarityLevel(0.75));
String query = "nulla"; // search approximate matches of the provided query
SearchResult result = index.search(query, options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment