File: QueryParser.cs

package info (click to toggle)
xapian-bindings 1.4.29-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 21,436 kB
  • sloc: cpp: 379,853; python: 10,780; cs: 9,529; java: 6,949; sh: 4,629; perl: 4,435; makefile: 1,274; ruby: 1,028; php: 586; tcl: 246
file content (258 lines) | stat: -rw-r--r-- 11,014 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
//------------------------------------------------------------------------------
// <auto-generated />
//
// This file was automatically generated by SWIG (https://www.swig.org).
// Version 4.3.0
//
// Do not make changes to this file unless you know what you are doing - modify
// the SWIG interface file instead.
//------------------------------------------------------------------------------

namespace Xapian {

public class QueryParser : global::System.IDisposable {
  private global::System.Runtime.InteropServices.HandleRef swigCPtr;
  protected bool swigCMemOwn;

  internal QueryParser(global::System.IntPtr cPtr, bool cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
  }

  internal static global::System.Runtime.InteropServices.HandleRef getCPtr(QueryParser obj) {
    return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
  }

  internal static global::System.Runtime.InteropServices.HandleRef swigRelease(QueryParser obj) {
    if (obj != null) {
      if (!obj.swigCMemOwn)
        throw new global::System.ApplicationException("Cannot release ownership as memory is not owned");
      global::System.Runtime.InteropServices.HandleRef ptr = obj.swigCPtr;
      obj.swigCMemOwn = false;
      obj.Dispose();
      return ptr;
    } else {
      return new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
    }
  }

  ~QueryParser() {
    Dispose(false);
  }

  public void Dispose() {
    Dispose(true);
    global::System.GC.SuppressFinalize(this);
  }

  protected virtual void Dispose(bool disposing) {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          XapianPINVOKE.delete_QueryParser(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
    }
  }

  public QueryParser() : this(XapianPINVOKE.new_QueryParser(), true) {
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public void SetStemmer(Stem stemmer) {
    XapianPINVOKE.QueryParser_SetStemmer(swigCPtr, Stem.getCPtr(stemmer));
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public void SetStemmingStrategy(QueryParser.stem_strategy strategy) {
    XapianPINVOKE.QueryParser_SetStemmingStrategy(swigCPtr, (int)strategy);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public void SetStopper(Stopper stop) {
    XapianPINVOKE.QueryParser_SetStopper__SWIG_0(swigCPtr, Stopper.getCPtr(stop));
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public void SetStopper() {
    XapianPINVOKE.QueryParser_SetStopper__SWIG_1(swigCPtr);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public void SetDefaultOp(Query.op default_op) {
    XapianPINVOKE.QueryParser_SetDefaultOp(swigCPtr, (int)default_op);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public Query.op GetDefaultOp() {
    Query.op ret = (Query.op)XapianPINVOKE.QueryParser_GetDefaultOp(swigCPtr);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public void SetDatabase(Database db) {
    XapianPINVOKE.QueryParser_SetDatabase(swigCPtr, Database.getCPtr(db));
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public void SetMaxExpansion(uint max_expansion, int max_type, uint flags) {
    XapianPINVOKE.QueryParser_SetMaxExpansion__SWIG_0(swigCPtr, max_expansion, max_type, flags);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public void SetMaxExpansion(uint max_expansion, int max_type) {
    XapianPINVOKE.QueryParser_SetMaxExpansion__SWIG_1(swigCPtr, max_expansion, max_type);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public void SetMaxExpansion(uint max_expansion) {
    XapianPINVOKE.QueryParser_SetMaxExpansion__SWIG_2(swigCPtr, max_expansion);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public void SetMaxWildcardExpansion(uint arg0) {
    XapianPINVOKE.QueryParser_SetMaxWildcardExpansion(swigCPtr, arg0);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public Query ParseQuery(string query_string, uint flags, string default_prefix) {
    Query ret = new Query(XapianPINVOKE.QueryParser_ParseQuery__SWIG_0(swigCPtr, query_string, flags, default_prefix), true);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public Query ParseQuery(string query_string, uint flags) {
    Query ret = new Query(XapianPINVOKE.QueryParser_ParseQuery__SWIG_1(swigCPtr, query_string, flags), true);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public Query ParseQuery(string query_string) {
    Query ret = new Query(XapianPINVOKE.QueryParser_ParseQuery__SWIG_2(swigCPtr, query_string), true);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public void AddPrefix(string field, string prefix) {
    XapianPINVOKE.QueryParser_AddPrefix__SWIG_0(swigCPtr, field, prefix);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public void AddPrefix(string field, FieldProcessor proc) {
    XapianPINVOKE.QueryParser_AddPrefix__SWIG_1(swigCPtr, field, FieldProcessor.getCPtr(proc));
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public void AddBooleanPrefix(string field, string prefix, string grouping) {
    XapianPINVOKE.QueryParser_AddBooleanPrefix__SWIG_0(swigCPtr, field, prefix, grouping);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public void AddBooleanPrefix(string field, string prefix) {
    XapianPINVOKE.QueryParser_AddBooleanPrefix__SWIG_1(swigCPtr, field, prefix);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public void AddBooleanPrefix(string field, string prefix, bool exclusive) {
    XapianPINVOKE.QueryParser_AddBooleanPrefix__SWIG_2(swigCPtr, field, prefix, exclusive);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public void AddBooleanPrefix(string field, FieldProcessor proc, string grouping) {
    XapianPINVOKE.QueryParser_AddBooleanPrefix__SWIG_3(swigCPtr, field, FieldProcessor.getCPtr(proc), grouping);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public void AddBooleanPrefix(string field, FieldProcessor proc) {
    XapianPINVOKE.QueryParser_AddBooleanPrefix__SWIG_4(swigCPtr, field, FieldProcessor.getCPtr(proc));
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public void AddBooleanPrefix(string field, FieldProcessor proc, bool exclusive) {
    XapianPINVOKE.QueryParser_AddBooleanPrefix__SWIG_5(swigCPtr, field, FieldProcessor.getCPtr(proc), exclusive);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public TermIterator StopListBegin() {
    TermIterator ret = new TermIterator(XapianPINVOKE.QueryParser_StopListBegin(swigCPtr), true);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public TermIterator StopListEnd() {
    TermIterator ret = new TermIterator(XapianPINVOKE.QueryParser_StopListEnd(swigCPtr), true);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public TermIterator UnstemBegin(string term) {
    TermIterator ret = new TermIterator(XapianPINVOKE.QueryParser_UnstemBegin(swigCPtr, term), true);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public TermIterator UnstemEnd(string arg0) {
    TermIterator ret = new TermIterator(XapianPINVOKE.QueryParser_UnstemEnd(swigCPtr, arg0), true);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public void AddRangeprocessor(RangeProcessor range_proc, string grouping) {
    XapianPINVOKE.QueryParser_AddRangeprocessor__SWIG_0(swigCPtr, RangeProcessor.getCPtr(range_proc), grouping);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public void AddRangeprocessor(RangeProcessor range_proc) {
    XapianPINVOKE.QueryParser_AddRangeprocessor__SWIG_1(swigCPtr, RangeProcessor.getCPtr(range_proc));
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public void AddValuerangeprocessor(ValueRangeProcessor vrproc) {
    XapianPINVOKE.QueryParser_AddValuerangeprocessor(swigCPtr, ValueRangeProcessor.getCPtr(vrproc));
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public string GetCorrectedQueryString() {
    string ret = XapianPINVOKE.QueryParser_GetCorrectedQueryString(swigCPtr);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public string GetDescription() {
    string ret = XapianPINVOKE.QueryParser_GetDescription(swigCPtr);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public enum feature_flag {
    FLAG_BOOLEAN = 1,
    FLAG_PHRASE = 2,
    FLAG_LOVEHATE = 4,
    FLAG_BOOLEAN_ANY_CASE = 8,
    FLAG_WILDCARD = 16,
    FLAG_PURE_NOT = 32,
    FLAG_PARTIAL = 64,
    FLAG_SPELLING_CORRECTION = 128,
    FLAG_SYNONYM = 256,
    FLAG_AUTO_SYNONYMS = 512,
    FLAG_AUTO_MULTIWORD_SYNONYMS = 1024,
    FLAG_NGRAMS = 2048,
    FLAG_CJK_NGRAM = FLAG_NGRAMS,
    FLAG_ACCUMULATE = 65536,
    FLAG_NO_POSITIONS = 0x20000,
    FLAG_DEFAULT = FLAG_PHRASE|FLAG_BOOLEAN|FLAG_LOVEHATE
  }

  public enum stem_strategy {
    STEM_NONE,
    STEM_SOME,
    STEM_ALL,
    STEM_ALL_Z,
    STEM_SOME_FULL_POS
  }

}

}