source: trunk/tools/assistant/lib/fulltextsearch/qindexwriter_p.h@ 966

Last change on this file since 966 was 846, checked in by Dmitry A. Kuminov, 14 years ago

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

File size: 3.3 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team.
4** All rights reserved.
5**
6** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
7** All rights reserved.
8**
9** This file may be used under the terms of the GNU Lesser General Public
10** License version 2.1 as published by the Free Software Foundation and
11** appearing in the file LICENSE.LGPL included in the packaging of this file.
12** Please review the following information to ensure the GNU Lesser General
13** Public License version 2.1 requirements will be met:
14** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15**
16****************************************************************************/
17
18#ifndef QINDEXWRITER_P_H
19#define QINDEXWRITER_P_H
20
21//
22// W A R N I N G
23// -------------
24//
25// This file is not part of the Qt API. It exists for the convenience
26// of the help generator tools. This header file may change from version
27// to version without notice, or even be removed.
28//
29// We mean it.
30//
31
32#include "qanalyzer_p.h"
33#include "qdocument_p.h"
34#include "qclucene_global_p.h"
35
36#include <QtCore/QString>
37#include <QtCore/QSharedDataPointer>
38#include <QtCore/QSharedData>
39
40CL_NS_DEF(index)
41 class IndexWriter;
42CL_NS_END
43CL_NS_USE(index)
44
45QT_BEGIN_NAMESPACE
46
47class QCLuceneIndexReader;
48
49class QHELP_EXPORT QCLuceneIndexWriterPrivate : public QSharedData
50{
51public:
52 QCLuceneIndexWriterPrivate();
53 QCLuceneIndexWriterPrivate(const QCLuceneIndexWriterPrivate &other);
54
55 ~QCLuceneIndexWriterPrivate();
56
57 IndexWriter *writer;
58 bool deleteCLuceneIndexWriter;
59
60private:
61 QCLuceneIndexWriterPrivate &operator=(const QCLuceneIndexWriterPrivate &other);
62};
63
64class QHELP_EXPORT QCLuceneIndexWriter
65{
66public:
67 enum {
68 DEFAULT_MERGE_FACTOR = 10,
69 COMMIT_LOCK_TIMEOUT = 10000,
70 DEFAULT_MAX_BUFFERED_DOCS = 10,
71 DEFAULT_MAX_FIELD_LENGTH = 10000,
72 DEFAULT_TERM_INDEX_INTERVAL = 128,
73 DEFAULT_MAX_MERGE_DOCS = 0x7FFFFFFFL
74 };
75
76 QCLuceneIndexWriter(const QString &path, QCLuceneAnalyzer &analyzer,
77 bool create, bool closeDir = true);
78 virtual ~QCLuceneIndexWriter();
79
80 void close();
81 void optimize();
82 qint32 docCount();
83 QCLuceneAnalyzer getAnalyzer();
84
85 void addIndexes(const QList<QCLuceneIndexReader*> &readers);
86 void addDocument(QCLuceneDocument &doc, QCLuceneAnalyzer &analyzer);
87
88 qint32 getMaxFieldLength() const;
89 void setMaxFieldLength(qint32 value);
90
91 qint32 getMaxBufferedDocs() const;
92 void setMaxBufferedDocs(qint32 value);
93
94 qint64 getWriteLockTimeout() const;
95 void setWriteLockTimeout(qint64 writeLockTimeout);
96
97 qint64 getCommitLockTimeout() const;
98 void setCommitLockTimeout(qint64 commitLockTimeout);
99
100 qint32 getMergeFactor() const;
101 void setMergeFactor(qint32 value);
102
103 qint32 getTermIndexInterval() const;
104 void setTermIndexInterval(qint32 interval);
105
106 qint32 getMinMergeDocs() const;
107 void setMinMergeDocs(qint32 value);
108
109 qint32 getMaxMergeDocs() const;
110 void setMaxMergeDocs(qint32 value);
111
112 bool getUseCompoundFile() const;
113 void setUseCompoundFile(bool value);
114
115protected:
116 QSharedDataPointer<QCLuceneIndexWriterPrivate> d;
117
118private:
119 QCLuceneAnalyzer analyzer;
120};
121
122QT_END_NAMESPACE
123
124#endif // QINDEXWRITER_P_H
Note: See TracBrowser for help on using the repository browser.