search (Database - Java)

Given selection criteria for a document, returns all documents in a database that meet the criteria.

Defined in

Database

Syntax

public DocumentCollection search(String formula)
    throws NotesException
public DocumentCollection search(String formula, DateTime dt)
    throws NotesException
public DocumentCollection search(String formula, DateTime dt, int max)
    throws NotesException

Parameters

String formula

A Notes® @function formula that specifies the selection criteria.


DateTime dt

A start date. The method searches only documents created or modified since the start date. Can be null to indicate no start date.

int max

The maximum number of documents you want returned. Specify 0 to receive all matching documents (up to 5,000. See Usage section.).

Return value


DocumentCollection

An unsorted collection of documents that match the selection criteria.

Usage

This method returns a maximum of 5,000 documents by default. The Notes®.ini variable FT_MAX_SEARCH_RESULTS overrides this limit for indexed databases or databases that are not indexed but that are running an agent on the client. For a database that is not indexed and is running in an agent on the server, you must set the TEMP_INDEX_MAX_DOC Notes®.ini variable as well. The absolute maximum is 2,147,483,647.

Example