Use a SearchReportJob to generate a search report from some or all of the items listed in a SearchResults object.
public class SearchReportJob;
SearchReportJob.java
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.
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 |
|
Date |
Modification date of the file when indexed |
|
Hits |
Number of hits in the file |
|
Title |
The first 80 characters of the file |
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. |
|
Method |
Description |
|
Free memory allocated for objects such as SearchResults. | |
|
Select no items from the SearchResults list | |
|
Generate the search report. | |
|
A JobErrorInfo containing information about any errors that occurred during generation of the search report. | |
|
Result of the search report, if OutputToString was set to true | |
|
Select all items in the SearchResults list | |
|
Select a range of items from the SearchResults list | |
|
Text to insert after each hit. | |
|
Text to insert before each hit. | |
|
Text to appear after each block of context. | |
|
Text to appear in front of each block of context. | |
|
Text to appear between each block of context. | |
|
Use setDocBytes to provide a document in a memory buffer rather than as a disk file. | |
|
Text to appear after each file in the search report. | |
|
Text to appear in front of each file in the search report. | |
|
SearchReportFlags specifying how the report should be generated | |
|
Footer of the search report | |
|
Header of the search report | |
|
Number of blocks of context to include in the report. | |
|
Number of words to scan in each document looking for blocks of context to include in the report. | |
|
The name of the file to create. | |
|
The file format of the output. | |
|
When output is directed to an in-memory string, you may wish to limit the maximum amount of memory used. | |
|
If true, output will be stored in an in-memory string variable rather than a disk file. | |
|
Number of paragraphs of context to include around each hit. | |
|
The search results list that this SearchReportJob will use. | |
|
Set to a non-zero value if you want the job to terminate automatically after a specified number of seconds. | |
|
Number of words of context to include around each hit. | |
|
Number of words of context to include around each hit. |
|
Method |
|
Copyright (c) 1998-2012 dtSearch Corp. All rights reserved.
|