Close
dtSearch Engine API for Java
SearchReportJob Class

Use a SearchReportJob to generate a search report from some or all of the items listed in a SearchResults object.

File: SearchReportJob.java 

Package: com.dtsearch.engine 

Syntax
Java
public class SearchReportJob;

To create a SearchReportJob, 

1. Call the SearchResults object's newSearchReportJob method to create a SearchReportJob. 

2. Set up the properties of the SearchReportJob to reflect the format of the report you want to create. 

3. Call selectAll() or selectItems() to select the items to include in the report. 

4. Call execute() to generate the report.

Format

A search report lists the hits found in one or more documents, with each hit surrounded by a specified amount of context. Each block of context starts with a ContextHeader and ends with the ContextFooter. Contiguous or overlapping blocks of context will be combined. The amount of context included in the report can be specified by words or by paragraphs. 

Each block of context is constructed as follows:

[ContextHeader] ...text... [BeforeHit] hit [AfterHit] ...text... [ContextFooter]

 

The report as a whole is constructed as follows:

[Header] [FileHeader] [ContextHeader] ...text... [BeforeHit] hit [AfterHit] ...text... [ContextFooter] [ContextSeparator] [ContextHeader] ...text... [BeforeHit] hit [AfterHit] ...text... [ContextFooter] ... more blocks of context, if present [FileFooter] ... more files ... [Footer]

 

Use the following symbols to insert file information into the FileHeader and FileFooter:

Symbol
Meaning
Filename
The name of the file (without path information). For PDF and HTML files, this will be the Title.
Location
The location of the file
Fullname
The path and filename of the file.
Size
File size in bytes
SizeK
File size in kilobytes
Date
Modification date of the file when indexed
Hits
Number of hits in the file
Title
The first 80 characters of the file
The docId of the file
Type
The file type (Microsoft Word, PDF, HTML, etc.)
Ordinal
The 1-based ordinal of this item in the SearchResults from which it was generated
IndexRetrievedFrom
The index where the file was found

Use %% around each symbol, like this: %%FullName%% 

Use the following symbols to insert context information in the contextHeader, which appears in front of each block of context:

Symbol
Meaning
Page
Page number where the hit occurs
Paragraph
Paragraph number where the hit occurs (relative to the start of the page)
Word
Word offset of the block of context from the beginning of the file.
com.dtsearch.engine.SearchReportJob