GroupDocs.Search for Java

Find text in business documents

GroupDocs.Search for Java lets you search text in documents using flexible and precise queries. Easily integrate search functionality into Java applications.

How to search in TXT documents

GroupDocs.Search allows fast and efficient text searches in TXT documents, perfect for Java applications.

  1. Specify a folder to store the search index.
  2. Select the folder containing your documents.
  3. Configure search options to limit results to TXT documents.
  4. Run the search and get results.
// Directory to store the reusable search index
Index index = new Index("c:/MyIndex");

// Folder containing the documents
index.add("c:/MyDocuments");

// Filter searches by document format
SearchOptions options = new SearchOptions();
options.SearchDocumentFilter = 
    SearchDocumentFilter.createFileExtension(".txt");

// Retrieve search results
SearchResult result = index.search("Lorem");
Maven XML
click to copy
copied
More examples Documentation

Enhanced search capabilities

GroupDocs.Search for Java provides advanced text search across more than 70 file formats. Indexing speeds up searches and improves document management efficiency.

Key features of GroupDocs.Search

Powerful text search

Find text in popular document formats such as PDFs, Word files, presentations, and spreadsheets. Supports multiple search methods, including fuzzy search, homophones, and wildcards.

Optimized indexing for better performance

Create and reuse search indexes to enhance search speed and efficiency, especially in large document collections.

Multilingual search support

Search within documents written in over 80 languages. Detects different keyboard layouts and word variations for improved accuracy.

Customizable search options

Narrow down search results with filters, regular expressions, and other advanced search settings.

Filter documents before searching

Learn how to refine searches using filters

Java

// Set up an index that excludes certain file formats
IndexSettings settings = new IndexSettings();
DocumentFilter fileExtensionFilter = 
  DocumentFilter.createFileExtension(".odp", ".png", ".rtf");

DocumentFilter invertedFilter = DocumentFilter.createNot(fileExtensionFilter);
settings.setDocumentFilter(invertedFilter);

Index index = new Index("c:/MyIndex", settings);
    
// Specify the document storage path
index.add("c:/MyDocuments");

// Retrieve search results
SearchResult result = index.search("Lorem", options);

// Process and use search results
System.out.println("Documents: " + result.getDocumentCount());
System.out.println("Occurrences: " + result.getDocumentCount());
Maven XML
click to copy
copied
More examples Documentation

What is GroupDocs.Search?

GroupDocs.Search for Java is a robust library for fast text search and document indexing. It supports over 70 file formats, including industry standards like PDF, Word, Excel, and PowerPoint. Enhance your applications with high-speed, accurate search capabilities.
Learn more
About illustration

Ready to get started?

Download GroupDocs.Search for free or get a trial license for full access!

Useful resources

Explore documentation, code samples, and community support to enhance your experience.

Key features

Perform precise and efficient text searches.

Search in business documents

GroupDocs.Search supports over 70 file formats, making it easy to search through widely used office documents.

Temporary license tips

1
Sign up with your work email.
Free mail services are not allowed.
2
Use Get a temporary license button on the second step.
 English