Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Created June 14, 2019 13:13
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/314c845edb2685e5c90118f5472e2437 to your computer and use it in GitHub Desktop.
Save GroupDocsGists/314c845edb2685e5c90118f5472e2437 to your computer and use it in GitHub Desktop.
//For complete examples and data files, please go to https://github.com/groupdocs-search/GroupDocs.Search-for-Java
String indexFolder = "c:\\MyIndex";
String documentFolder = "c:\\MyDocuments";
//Creating index
Index index = new Index(indexFolder);
//Setting the log file name. The log file name can be relative or absolute.
index.getLogSettings().setFileName("Log\\Log.txt");
//Setting the maximum size of the log file in megabytes. This value must be in the range from 0.1 to 1000.
index.getLogSettings().setMaxSize(2.0);
//Adding documents to index
index.addToIndex(documentFolder);
//Searching
SearchResults results = index.search("big");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment