1 //------------------------------------------------------------------------------ 2 // <auto-generated /> 3 // 4 // This file was automatically generated by SWIG (http://www.swig.org). 5 // Version 3.0.13 6 // 7 // Do not make changes to this file unless you know what you are doing--modify 8 // the SWIG interface file instead. 9 //------------------------------------------------------------------------------ 10 11 namespace Xapian { 12 13 public class Query : global::System.IDisposable { 14 private global::System.Runtime.InteropServices.HandleRef swigCPtr; 15 protected bool swigCMemOwn; 16 Query(global::System.IntPtr cPtr, bool cMemoryOwn)17 internal Query(global::System.IntPtr cPtr, bool cMemoryOwn) { 18 swigCMemOwn = cMemoryOwn; 19 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); 20 } 21 getCPtr(Query obj)22 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Query obj) { 23 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; 24 } 25 ~Query()26 ~Query() { 27 Dispose(); 28 } 29 Dispose()30 public virtual void Dispose() { 31 lock(this) { 32 if (swigCPtr.Handle != global::System.IntPtr.Zero) { 33 if (swigCMemOwn) { 34 swigCMemOwn = false; 35 XapianPINVOKE.delete_Query(swigCPtr); 36 } 37 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); 38 } 39 global::System.GC.SuppressFinalize(this); 40 } 41 } 42 43 public static readonly Query MatchAll = new Query(""); 44 public static readonly Query MatchNothing = new Query(); 45 Query()46 public Query() : this(XapianPINVOKE.new_Query__SWIG_0(), true) { 47 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 48 } 49 Query(string term, uint wqf, uint pos)50 public Query(string term, uint wqf, uint pos) : this(XapianPINVOKE.new_Query__SWIG_1(term, wqf, pos), true) { 51 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 52 } 53 Query(string term, uint wqf)54 public Query(string term, uint wqf) : this(XapianPINVOKE.new_Query__SWIG_2(term, wqf), true) { 55 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 56 } 57 Query(string term)58 public Query(string term) : this(XapianPINVOKE.new_Query__SWIG_3(term), true) { 59 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 60 } 61 Query(PostingSource source)62 public Query(PostingSource source) : this(XapianPINVOKE.new_Query__SWIG_4(PostingSource.getCPtr(source)), true) { 63 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 64 } 65 Query(double factor, Query subquery)66 public Query(double factor, Query subquery) : this(XapianPINVOKE.new_Query__SWIG_5(factor, Query.getCPtr(subquery)), true) { 67 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 68 } 69 Query(Query.op op_, Query subquery, double factor)70 public Query(Query.op op_, Query subquery, double factor) : this(XapianPINVOKE.new_Query__SWIG_6((int)op_, Query.getCPtr(subquery), factor), true) { 71 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 72 } 73 Query(Query.op op_, Query a, Query b)74 public Query(Query.op op_, Query a, Query b) : this(XapianPINVOKE.new_Query__SWIG_7((int)op_, Query.getCPtr(a), Query.getCPtr(b)), true) { 75 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 76 } 77 Query(Query.op op_, string a, string b)78 public Query(Query.op op_, string a, string b) : this(XapianPINVOKE.new_Query__SWIG_8((int)op_, a, b), true) { 79 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 80 } 81 Query(Query.op op_, uint slot, string range_limit)82 public Query(Query.op op_, uint slot, string range_limit) : this(XapianPINVOKE.new_Query__SWIG_9((int)op_, slot, range_limit), true) { 83 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 84 } 85 Query(Query.op op_, uint slot, string range_lower, string range_upper)86 public Query(Query.op op_, uint slot, string range_lower, string range_upper) : this(XapianPINVOKE.new_Query__SWIG_10((int)op_, slot, range_lower, range_upper), true) { 87 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 88 } 89 Query(Query.op op_, string pattern, uint max_expansion, int max_type, Query.op combiner)90 public Query(Query.op op_, string pattern, uint max_expansion, int max_type, Query.op combiner) : this(XapianPINVOKE.new_Query__SWIG_11((int)op_, pattern, max_expansion, max_type, (int)combiner), true) { 91 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 92 } 93 Query(Query.op op_, string pattern, uint max_expansion, int max_type)94 public Query(Query.op op_, string pattern, uint max_expansion, int max_type) : this(XapianPINVOKE.new_Query__SWIG_12((int)op_, pattern, max_expansion, max_type), true) { 95 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 96 } 97 Query(Query.op op_, string pattern, uint max_expansion)98 public Query(Query.op op_, string pattern, uint max_expansion) : this(XapianPINVOKE.new_Query__SWIG_13((int)op_, pattern, max_expansion), true) { 99 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 100 } 101 Query(Query.op op_, string pattern)102 public Query(Query.op op_, string pattern) : this(XapianPINVOKE.new_Query__SWIG_14((int)op_, pattern), true) { 103 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 104 } 105 GetTermsBegin()106 public TermIterator GetTermsBegin() { 107 TermIterator ret = new TermIterator(XapianPINVOKE.Query_GetTermsBegin(swigCPtr), true); 108 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 109 return ret; 110 } 111 GetTermsEnd()112 public TermIterator GetTermsEnd() { 113 TermIterator ret = new TermIterator(XapianPINVOKE.Query_GetTermsEnd(swigCPtr), true); 114 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 115 return ret; 116 } 117 GetUniqueTermsBegin()118 public TermIterator GetUniqueTermsBegin() { 119 TermIterator ret = new TermIterator(XapianPINVOKE.Query_GetUniqueTermsBegin(swigCPtr), true); 120 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 121 return ret; 122 } 123 GetUniqueTermsEnd()124 public TermIterator GetUniqueTermsEnd() { 125 TermIterator ret = new TermIterator(XapianPINVOKE.Query_GetUniqueTermsEnd(swigCPtr), true); 126 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 127 return ret; 128 } 129 GetLength()130 public uint GetLength() { 131 uint ret = XapianPINVOKE.Query_GetLength(swigCPtr); 132 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 133 return ret; 134 } 135 Empty()136 public bool Empty() { 137 bool ret = XapianPINVOKE.Query_Empty(swigCPtr); 138 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 139 return ret; 140 } 141 Serialise()142 public string Serialise() { 143 string ret = XapianPINVOKE.Query_Serialise(swigCPtr); 144 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 145 return ret; 146 } 147 Unserialise(string serialised, Registry reg)148 public static Query Unserialise(string serialised, Registry reg) { 149 Query ret = new Query(XapianPINVOKE.Query_Unserialise__SWIG_0(serialised, Registry.getCPtr(reg)), true); 150 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 151 return ret; 152 } 153 Unserialise(string serialised)154 public static Query Unserialise(string serialised) { 155 Query ret = new Query(XapianPINVOKE.Query_Unserialise__SWIG_1(serialised), true); 156 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 157 return ret; 158 } 159 GetType()160 public Query.op GetType() { 161 Query.op ret = (Query.op)XapianPINVOKE.Query_GetType(swigCPtr); 162 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 163 return ret; 164 } 165 GetNumSubqueries()166 public uint GetNumSubqueries() { 167 uint ret = XapianPINVOKE.Query_GetNumSubqueries(swigCPtr); 168 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 169 return ret; 170 } 171 GetSubquery(uint n)172 public Query GetSubquery(uint n) { 173 Query ret = new Query(XapianPINVOKE.Query_GetSubquery(swigCPtr, n), true); 174 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 175 return ret; 176 } 177 GetDescription()178 public string GetDescription() { 179 string ret = XapianPINVOKE.Query_GetDescription(swigCPtr); 180 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 181 return ret; 182 } 183 Query(Query.op op_)184 public Query(Query.op op_) : this(XapianPINVOKE.new_Query__SWIG_17((int)op_), true) { 185 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 186 } 187 188 public enum op { 189 OP_AND = 0, 190 OP_OR = 1, 191 OP_AND_NOT = 2, 192 OP_XOR = 3, 193 OP_AND_MAYBE = 4, 194 OP_FILTER = 5, 195 OP_NEAR = 6, 196 OP_PHRASE = 7, 197 OP_VALUE_RANGE = 8, 198 OP_SCALE_WEIGHT = 9, 199 OP_ELITE_SET = 10, 200 OP_VALUE_GE = 11, 201 OP_VALUE_LE = 12, 202 OP_SYNONYM = 13, 203 OP_MAX = 14, 204 OP_WILDCARD = 15, 205 OP_INVALID = 99 206 } 207 208 public static readonly int WILDCARD_LIMIT_ERROR = XapianPINVOKE.Query_WILDCARD_LIMIT_ERROR_get(); 209 public static readonly int WILDCARD_LIMIT_FIRST = XapianPINVOKE.Query_WILDCARD_LIMIT_FIRST_get(); 210 public static readonly int WILDCARD_LIMIT_MOST_FREQUENT = XapianPINVOKE.Query_WILDCARD_LIMIT_MOST_FREQUENT_get(); 211 212 } 213 214 } 215