View Javadoc

1   /*
2    * This file is part of Domingo
3    * an Open Source Java-API to Lotus Notes/Domino
4    * hosted at http://domingo.sourceforge.net
5    *
6    * Copyright (c) 2003-2007 Beck et al. projects GmbH Munich, Germany (http://www.bea.de)
7    *
8    * This library is free software; you can redistribute it and/or
9    * modify it under the terms of the GNU Lesser General Public
10   * License as published by the Free Software Foundation; either
11   * version 2.1 of the License, or (at your option) any later version.
12   *
13   * This library is distributed in the hope that it will be useful,
14   * but WITHOUT ANY WARRANTY; without even the implied warranty of
15   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16   * Lesser General Public License for more details.
17   *
18   * You should have received a copy of the GNU Lesser General Public
19   * License along with this library; if not, write to the Free Software
20   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21   */
22  
23  package de.bea.domingo;
24  
25  import java.util.Iterator;
26  
27  /***
28   * Represents a collection of documents and provides access to documents
29   * within it.
30   *
31   * @author <a href=mailto:kriede@users.sourceforge.net>Kurt Riede</a>
32   */
33  public interface DDocumentCollection extends DBase {
34  
35      /***
36       * Returns an Iterator to loop over all documents in the view.
37       *
38       * @return Iterator
39       */
40      Iterator getAllDocuments();
41  
42      /***
43       * Conducts a full-text search of all the documents in a document
44       * collection, and reduces the collection to a sorted collection of those
45       * documents that match.
46       *
47       * <p>See {@link #fullTextSearch(String, int)} for more details.</p>
48       *
49       * @param query The full-text query
50       */
51      void fullTextSearch(String query);
52  
53      /***
54       * Conducts a full-text search of all the documents in a document
55       * collection, and reduces the collection to a sorted collection of those
56       * documents that match.
57       *
58       * <p><b>Usage</b></p>
59       * <p>This method moves the current pointer to the first document in the
60       * collection. The collection of documents that match the full-text query
61       * are sorted by relevance, with highest relevance first. You can access the
62       * relevance score of each document in the collection using
63       * {@link DDocument#getFTSearchScore()} in DDocument.</p>
64       *
65       * <p>If the database is not full-text indexed, this method works,
66       * but less efficiently. To test for an index, use {@link DDatabase#isFTIndexed()}.</p>
67       * <p>To create an index on a local database, use {@link DDatabase#updateFTIndex(boolean)}.</p>
68       *
69       * <p>This method searches all documents in a document collection. To search all documents in a
70       * database, use FTSearch in Database. To search only documents found in a
71       * particular view, use FTSearch in View or FTSearch in ViewEntryCollection.</p>
72       *
73       * <p><b>Query syntax</b></p>
74       * <p>To search for a word or phrase, enter the word or phrase as is,
75       * except that search keywords must be enclosed in quotes. Remember to
76       * escape quotes if you are inside a literal. Wildcards, operators, and
77       * other syntax are permitted. For the complete syntax rules, see "Finding
78       * documents in a database" in Lotus Notes 6 Help.</p>
79       *
80       * @param query The full-text query
81       * @param maxdocs The maximum number of documents you want returned from the
82       *            query. Set this parameter to 0 to receive all matching
83       *            documents.
84       */
85      void fullTextSearch(String query, int maxdocs);
86  }