1
+ using System . Collections . Generic ;
2
+ using Lucene . Net . Analysis ;
3
+ using Lucene . Net . Index ;
4
+ using Lucene . Net . Search ;
5
+ using Lucene . Net . Store ;
6
+ using Lucene . Net . Util ;
7
+
8
+ namespace DotJEM . Json . Index2 . IO ;
9
+
10
+ public class IndexWriterSafeProxy : IIndexWriter
11
+ {
12
+ private readonly IndexWriter inner ;
13
+
14
+ public IndexWriterSafeProxy ( IndexWriter writer )
15
+ {
16
+ inner = writer ;
17
+ }
18
+
19
+ public IndexWriter UnsafeValue => inner ;
20
+
21
+ public DirectoryReader GetReader ( bool applyAllDeletes )
22
+ {
23
+ return inner . GetReader ( applyAllDeletes ) ;
24
+ }
25
+
26
+ public int NumDeletedDocs ( SegmentCommitInfo info )
27
+ {
28
+ return inner . NumDeletedDocs ( info ) ;
29
+ }
30
+
31
+ public void Dispose ( )
32
+ {
33
+ inner . Dispose ( ) ;
34
+ }
35
+
36
+ public void Dispose ( bool waitForMerges )
37
+ {
38
+ inner . Dispose ( waitForMerges ) ;
39
+ }
40
+
41
+ public bool HasDeletions ( )
42
+ {
43
+ return inner . HasDeletions ( ) ;
44
+ }
45
+
46
+ public void AddDocument ( IEnumerable < IIndexableField > doc )
47
+ {
48
+ inner . AddDocument ( doc ) ;
49
+ }
50
+
51
+ public void AddDocument ( IEnumerable < IIndexableField > doc , Analyzer analyzer )
52
+ {
53
+ inner . AddDocument ( doc , analyzer ) ;
54
+ }
55
+
56
+ public void AddDocuments ( IEnumerable < IEnumerable < IIndexableField > > docs )
57
+ {
58
+ inner . AddDocuments ( docs ) ;
59
+ }
60
+
61
+ public void AddDocuments ( IEnumerable < IEnumerable < IIndexableField > > docs , Analyzer analyzer )
62
+ {
63
+ inner . AddDocuments ( docs , analyzer ) ;
64
+ }
65
+
66
+ public void UpdateDocuments ( Term delTerm , IEnumerable < IEnumerable < IIndexableField > > docs )
67
+ {
68
+ inner . UpdateDocuments ( delTerm , docs ) ;
69
+ }
70
+
71
+ public void UpdateDocuments ( Term delTerm , IEnumerable < IEnumerable < IIndexableField > > docs , Analyzer analyzer )
72
+ {
73
+ inner . UpdateDocuments ( delTerm , docs , analyzer ) ;
74
+ }
75
+
76
+ public void DeleteDocuments ( Term term )
77
+ {
78
+ inner . DeleteDocuments ( term ) ;
79
+ }
80
+
81
+ public bool TryDeleteDocument ( IndexReader readerIn , int docID )
82
+ {
83
+ return inner . TryDeleteDocument ( readerIn , docID ) ;
84
+ }
85
+
86
+ public void DeleteDocuments ( params Term [ ] terms )
87
+ {
88
+ inner . DeleteDocuments ( terms ) ;
89
+ }
90
+
91
+ public void DeleteDocuments ( Query query )
92
+ {
93
+ inner . DeleteDocuments ( query ) ;
94
+ }
95
+
96
+ public void DeleteDocuments ( params Query [ ] queries )
97
+ {
98
+ inner . DeleteDocuments ( queries ) ;
99
+ }
100
+
101
+ public void UpdateDocument ( Term term , IEnumerable < IIndexableField > doc )
102
+ {
103
+ inner . UpdateDocument ( term , doc ) ;
104
+ }
105
+
106
+ public void UpdateDocument ( Term term , IEnumerable < IIndexableField > doc , Analyzer analyzer )
107
+ {
108
+ inner . UpdateDocument ( term , doc , analyzer ) ;
109
+ }
110
+
111
+ public void UpdateNumericDocValue ( Term term , string field , long ? value )
112
+ {
113
+ inner . UpdateNumericDocValue ( term , field , value ) ;
114
+ }
115
+
116
+ public void UpdateBinaryDocValue ( Term term , string field , BytesRef value )
117
+ {
118
+ inner . UpdateBinaryDocValue ( term , field , value ) ;
119
+ }
120
+
121
+ public void ForceMerge ( int maxNumSegments )
122
+ {
123
+ inner . ForceMerge ( maxNumSegments ) ;
124
+ }
125
+
126
+ public void ForceMerge ( int maxNumSegments , bool doWait )
127
+ {
128
+ inner . ForceMerge ( maxNumSegments , doWait ) ;
129
+ }
130
+
131
+ public void ForceMergeDeletes ( bool doWait )
132
+ {
133
+ inner . ForceMergeDeletes ( doWait ) ;
134
+ }
135
+
136
+ public void ForceMergeDeletes ( )
137
+ {
138
+ inner . ForceMergeDeletes ( ) ;
139
+ }
140
+
141
+ public void MaybeMerge ( )
142
+ {
143
+ inner . MaybeMerge ( ) ;
144
+ }
145
+
146
+ public MergePolicy . OneMerge GetNextMerge ( )
147
+ {
148
+ return inner . GetNextMerge ( ) ;
149
+ }
150
+
151
+ public bool HasPendingMerges ( )
152
+ {
153
+ return inner . HasPendingMerges ( ) ;
154
+ }
155
+
156
+ public void Rollback ( )
157
+ {
158
+ inner . Rollback ( ) ;
159
+ }
160
+
161
+ public void DeleteAll ( )
162
+ {
163
+ inner . DeleteAll ( ) ;
164
+ }
165
+
166
+ public void WaitForMerges ( )
167
+ {
168
+ inner . WaitForMerges ( ) ;
169
+ }
170
+
171
+ public void AddIndexes ( params Directory [ ] dirs )
172
+ {
173
+ inner . AddIndexes ( dirs ) ;
174
+ }
175
+
176
+ public void AddIndexes ( params IndexReader [ ] readers )
177
+ {
178
+ inner . AddIndexes ( readers ) ;
179
+ }
180
+
181
+ public void PrepareCommit ( )
182
+ {
183
+ inner . PrepareCommit ( ) ;
184
+ }
185
+
186
+ public void SetCommitData ( IDictionary < string , string > commitUserData )
187
+ {
188
+ inner . SetCommitData ( commitUserData ) ;
189
+ }
190
+
191
+ public void Commit ( )
192
+ {
193
+ inner . Commit ( ) ;
194
+ }
195
+
196
+ public bool HasUncommittedChanges ( )
197
+ {
198
+ return inner . HasUncommittedChanges ( ) ;
199
+ }
200
+
201
+ public void Flush ( bool triggerMerge , bool applyAllDeletes )
202
+ {
203
+ inner . Flush ( triggerMerge , applyAllDeletes ) ;
204
+ }
205
+
206
+ public long RamSizeInBytes ( )
207
+ {
208
+ return inner . RamSizeInBytes ( ) ;
209
+ }
210
+
211
+ public int NumRamDocs ( )
212
+ {
213
+ return inner . NumRamDocs ( ) ;
214
+ }
215
+
216
+ public void Merge ( MergePolicy . OneMerge merge )
217
+ {
218
+ inner . Merge ( merge ) ;
219
+ }
220
+
221
+ public void MergeFinish ( MergePolicy . OneMerge merge )
222
+ {
223
+ inner . MergeFinish ( merge ) ;
224
+ }
225
+
226
+ public string SegString ( )
227
+ {
228
+ return inner . SegString ( ) ;
229
+ }
230
+
231
+ public string SegString ( IEnumerable < SegmentCommitInfo > infos )
232
+ {
233
+ return inner . SegString ( infos ) ;
234
+ }
235
+
236
+ public string SegString ( SegmentCommitInfo info )
237
+ {
238
+ return inner . SegString ( info ) ;
239
+ }
240
+
241
+ public void DeleteUnusedFiles ( )
242
+ {
243
+ inner . DeleteUnusedFiles ( ) ;
244
+ }
245
+
246
+ public LiveIndexWriterConfig Config => inner . Config ;
247
+
248
+ public Directory Directory => inner . Directory ;
249
+
250
+ public Analyzer Analyzer => inner . Analyzer ;
251
+
252
+ public int MaxDoc => inner . MaxDoc ;
253
+
254
+ public int NumDocs => inner . NumDocs ;
255
+
256
+ public ICollection < SegmentCommitInfo > MergingSegments => inner . MergingSegments ;
257
+
258
+ public IDictionary < string , string > CommitData => inner . CommitData ;
259
+
260
+ public bool KeepFullyDeletedSegments
261
+ {
262
+ get => inner . KeepFullyDeletedSegments ;
263
+ set => inner . KeepFullyDeletedSegments = value ;
264
+ }
265
+
266
+ public bool IsClosed => inner . IsClosed ;
267
+ }
0 commit comments