/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 2.0.5
 * 
 * This file is not intended to be easily readable and contains a number of 
 * coding conventions designed to improve portability and efficiency. Do not make
 * changes to this file unless you know what you are doing--modify the SWIG 
 * interface file instead. 
 * ----------------------------------------------------------------------------- */

#define SWIGLUA


#ifdef __cplusplus
/* SwigValueWrapper is described in swig.swg */
template<typename T> class SwigValueWrapper {
  struct SwigMovePointer {
    T *ptr;
    SwigMovePointer(T *p) : ptr(p) { }
    ~SwigMovePointer() { delete ptr; }
    SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
  } pointer;
  SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
  SwigValueWrapper(const SwigValueWrapper<T>& rhs);
public:
  SwigValueWrapper() : pointer(0) { }
  SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
  operator T&() const { return *pointer.ptr; }
  T *operator&() { return pointer.ptr; }
};

template <typename T> T SwigValueInit() {
  return T();
}
#endif

/* -----------------------------------------------------------------------------
 *  This section contains generic SWIG labels for method/variable
 *  declarations/attributes, and other compiler dependent labels.
 * ----------------------------------------------------------------------------- */

/* template workaround for compilers that cannot correctly implement the C++ standard */
#ifndef SWIGTEMPLATEDISAMBIGUATOR
# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
#  define SWIGTEMPLATEDISAMBIGUATOR template
# elif defined(__HP_aCC)
/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
#  define SWIGTEMPLATEDISAMBIGUATOR template
# else
#  define SWIGTEMPLATEDISAMBIGUATOR
# endif
#endif

/* inline attribute */
#ifndef SWIGINLINE
# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
#   define SWIGINLINE inline
# else
#   define SWIGINLINE
# endif
#endif

/* attribute recognised by some compilers to avoid 'unused' warnings */
#ifndef SWIGUNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define SWIGUNUSED __attribute__ ((__unused__)) 
#   else
#     define SWIGUNUSED
#   endif
# elif defined(__ICC)
#   define SWIGUNUSED __attribute__ ((__unused__)) 
# else
#   define SWIGUNUSED 
# endif
#endif

#ifndef SWIG_MSC_UNSUPPRESS_4505
# if defined(_MSC_VER)
#   pragma warning(disable : 4505) /* unreferenced local function has been removed */
# endif 
#endif

#ifndef SWIGUNUSEDPARM
# ifdef __cplusplus
#   define SWIGUNUSEDPARM(p)
# else
#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
# endif
#endif

/* internal SWIG method */
#ifndef SWIGINTERN
# define SWIGINTERN static SWIGUNUSED
#endif

/* internal inline SWIG method */
#ifndef SWIGINTERNINLINE
# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
#endif

/* exporting methods */
#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
#  ifndef GCC_HASCLASSVISIBILITY
#    define GCC_HASCLASSVISIBILITY
#  endif
#endif

#ifndef SWIGEXPORT
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
#   if defined(STATIC_LINKED)
#     define SWIGEXPORT
#   else
#     define SWIGEXPORT __declspec(dllexport)
#   endif
# else
#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
#     define SWIGEXPORT __attribute__ ((visibility("default")))
#   else
#     define SWIGEXPORT
#   endif
# endif
#endif

/* calling conventions for Windows */
#ifndef SWIGSTDCALL
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
#   define SWIGSTDCALL __stdcall
# else
#   define SWIGSTDCALL
# endif 
#endif

/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
# define _CRT_SECURE_NO_DEPRECATE
#endif

/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
# define _SCL_SECURE_NO_DEPRECATE
#endif


/* -----------------------------------------------------------------------------
 * swigrun.swg
 *
 * This file contains generic C API SWIG runtime support for pointer
 * type checking.
 * ----------------------------------------------------------------------------- */

/* This should only be incremented when either the layout of swig_type_info changes,
   or for whatever reason, the runtime changes incompatibly */
#define SWIG_RUNTIME_VERSION "4"

/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
#ifdef SWIG_TYPE_TABLE
# define SWIG_QUOTE_STRING(x) #x
# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
#else
# define SWIG_TYPE_TABLE_NAME
#endif

/*
  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
  creating a static or dynamic library from the SWIG runtime code.
  In 99.9% of the cases, SWIG just needs to declare them as 'static'.
  
  But only do this if strictly necessary, ie, if you have problems
  with your compiler or suchlike.
*/

#ifndef SWIGRUNTIME
# define SWIGRUNTIME SWIGINTERN
#endif

#ifndef SWIGRUNTIMEINLINE
# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
#endif

/*  Generic buffer size */
#ifndef SWIG_BUFFER_SIZE
# define SWIG_BUFFER_SIZE 1024
#endif

/* Flags for pointer conversions */
#define SWIG_POINTER_DISOWN        0x1
#define SWIG_CAST_NEW_MEMORY       0x2

/* Flags for new pointer objects */
#define SWIG_POINTER_OWN           0x1


/* 
   Flags/methods for returning states.
   
   The SWIG conversion methods, as ConvertPtr, return an integer 
   that tells if the conversion was successful or not. And if not,
   an error code can be returned (see swigerrors.swg for the codes).
   
   Use the following macros/flags to set or process the returning
   states.
   
   In old versions of SWIG, code such as the following was usually written:

     if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
       // success code
     } else {
       //fail code
     }

   Now you can be more explicit:

    int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
    if (SWIG_IsOK(res)) {
      // success code
    } else {
      // fail code
    }

   which is the same really, but now you can also do

    Type *ptr;
    int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
    if (SWIG_IsOK(res)) {
      // success code
      if (SWIG_IsNewObj(res) {
        ...
	delete *ptr;
      } else {
        ...
      }
    } else {
      // fail code
    }
    
   I.e., now SWIG_ConvertPtr can return new objects and you can
   identify the case and take care of the deallocation. Of course that
   also requires SWIG_ConvertPtr to return new result values, such as

      int SWIG_ConvertPtr(obj, ptr,...) {         
        if (<obj is ok>) {			       
          if (<need new object>) {		       
            *ptr = <ptr to new allocated object>; 
            return SWIG_NEWOBJ;		       
          } else {				       
            *ptr = <ptr to old object>;	       
            return SWIG_OLDOBJ;		       
          } 				       
        } else {				       
          return SWIG_BADOBJ;		       
        }					       
      }

   Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
   more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
   SWIG errors code.

   Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
   allows to return the 'cast rank', for example, if you have this

       int food(double)
       int fooi(int);

   and you call
 
      food(1)   // cast rank '1'  (1 -> 1.0)
      fooi(1)   // cast rank '0'

   just use the SWIG_AddCast()/SWIG_CheckState()
*/

#define SWIG_OK                    (0) 
#define SWIG_ERROR                 (-1)
#define SWIG_IsOK(r)               (r >= 0)
#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)  

/* The CastRankLimit says how many bits are used for the cast rank */
#define SWIG_CASTRANKLIMIT         (1 << 8)
/* The NewMask denotes the object was created (using new/malloc) */
#define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
/* The TmpMask is for in/out typemaps that use temporal objects */
#define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
/* Simple returning values */
#define SWIG_BADOBJ                (SWIG_ERROR)
#define SWIG_OLDOBJ                (SWIG_OK)
#define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
#define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
/* Check, add and del mask methods */
#define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
#define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
#define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
#define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
#define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
#define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))

/* Cast-Rank Mode */
#if defined(SWIG_CASTRANK_MODE)
#  ifndef SWIG_TypeRank
#    define SWIG_TypeRank             unsigned long
#  endif
#  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
#    define SWIG_MAXCASTRANK          (2)
#  endif
#  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
#  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
SWIGINTERNINLINE int SWIG_AddCast(int r) { 
  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
}
SWIGINTERNINLINE int SWIG_CheckState(int r) { 
  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; 
}
#else /* no cast-rank mode */
#  define SWIG_AddCast
#  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
#endif


#include <string.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef void *(*swig_converter_func)(void *, int *);
typedef struct swig_type_info *(*swig_dycast_func)(void **);

/* Structure to store information on one type */
typedef struct swig_type_info {
  const char             *name;			/* mangled name of this type */
  const char             *str;			/* human readable name of this type */
  swig_dycast_func        dcast;		/* dynamic cast function down a hierarchy */
  struct swig_cast_info  *cast;			/* linked list of types that can cast into this type */
  void                   *clientdata;		/* language specific type data */
  int                    owndata;		/* flag if the structure owns the clientdata */
} swig_type_info;

/* Structure to store a type and conversion function used for casting */
typedef struct swig_cast_info {
  swig_type_info         *type;			/* pointer to type that is equivalent to this type */
  swig_converter_func     converter;		/* function to cast the void pointers */
  struct swig_cast_info  *next;			/* pointer to next cast in linked list */
  struct swig_cast_info  *prev;			/* pointer to the previous cast */
} swig_cast_info;

/* Structure used to store module information
 * Each module generates one structure like this, and the runtime collects
 * all of these structures and stores them in a circularly linked list.*/
typedef struct swig_module_info {
  swig_type_info         **types;		/* Array of pointers to swig_type_info structures that are in this module */
  size_t                 size;		        /* Number of types in this module */
  struct swig_module_info *next;		/* Pointer to next element in circularly linked list */
  swig_type_info         **type_initial;	/* Array of initially generated type structures */
  swig_cast_info         **cast_initial;	/* Array of initially generated casting structures */
  void                    *clientdata;		/* Language specific module data */
} swig_module_info;

/* 
  Compare two type names skipping the space characters, therefore
  "char*" == "char *" and "Class<int>" == "Class<int >", etc.

  Return 0 when the two name types are equivalent, as in
  strncmp, but skipping ' '.
*/
SWIGRUNTIME int
SWIG_TypeNameComp(const char *f1, const char *l1,
		  const char *f2, const char *l2) {
  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
    while ((*f1 == ' ') && (f1 != l1)) ++f1;
    while ((*f2 == ' ') && (f2 != l2)) ++f2;
    if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
  }
  return (int)((l1 - f1) - (l2 - f2));
}

/*
  Check type equivalence in a name list like <name1>|<name2>|...
  Return 0 if not equal, 1 if equal
*/
SWIGRUNTIME int
SWIG_TypeEquiv(const char *nb, const char *tb) {
  int equiv = 0;
  const char* te = tb + strlen(tb);
  const char* ne = nb;
  while (!equiv && *ne) {
    for (nb = ne; *ne; ++ne) {
      if (*ne == '|') break;
    }
    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
    if (*ne) ++ne;
  }
  return equiv;
}

/*
  Check type equivalence in a name list like <name1>|<name2>|...
  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
*/
SWIGRUNTIME int
SWIG_TypeCompare(const char *nb, const char *tb) {
  int equiv = 0;
  const char* te = tb + strlen(tb);
  const char* ne = nb;
  while (!equiv && *ne) {
    for (nb = ne; *ne; ++ne) {
      if (*ne == '|') break;
    }
    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
    if (*ne) ++ne;
  }
  return equiv;
}


/*
  Check the typename
*/
SWIGRUNTIME swig_cast_info *
SWIG_TypeCheck(const char *c, swig_type_info *ty) {
  if (ty) {
    swig_cast_info *iter = ty->cast;
    while (iter) {
      if (strcmp(iter->type->name, c) == 0) {
        if (iter == ty->cast)
          return iter;
        /* Move iter to the top of the linked list */
        iter->prev->next = iter->next;
        if (iter->next)
          iter->next->prev = iter->prev;
        iter->next = ty->cast;
        iter->prev = 0;
        if (ty->cast) ty->cast->prev = iter;
        ty->cast = iter;
        return iter;
      }
      iter = iter->next;
    }
  }
  return 0;
}

/* 
  Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
*/
SWIGRUNTIME swig_cast_info *
SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
  if (ty) {
    swig_cast_info *iter = ty->cast;
    while (iter) {
      if (iter->type == from) {
        if (iter == ty->cast)
          return iter;
        /* Move iter to the top of the linked list */
        iter->prev->next = iter->next;
        if (iter->next)
          iter->next->prev = iter->prev;
        iter->next = ty->cast;
        iter->prev = 0;
        if (ty->cast) ty->cast->prev = iter;
        ty->cast = iter;
        return iter;
      }
      iter = iter->next;
    }
  }
  return 0;
}

/*
  Cast a pointer up an inheritance hierarchy
*/
SWIGRUNTIMEINLINE void *
SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
}

/* 
   Dynamic pointer casting. Down an inheritance hierarchy
*/
SWIGRUNTIME swig_type_info *
SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
  swig_type_info *lastty = ty;
  if (!ty || !ty->dcast) return ty;
  while (ty && (ty->dcast)) {
    ty = (*ty->dcast)(ptr);
    if (ty) lastty = ty;
  }
  return lastty;
}

/*
  Return the name associated with this type
*/
SWIGRUNTIMEINLINE const char *
SWIG_TypeName(const swig_type_info *ty) {
  return ty->name;
}

/*
  Return the pretty name associated with this type,
  that is an unmangled type name in a form presentable to the user.
*/
SWIGRUNTIME const char *
SWIG_TypePrettyName(const swig_type_info *type) {
  /* The "str" field contains the equivalent pretty names of the
     type, separated by vertical-bar characters.  We choose
     to print the last name, as it is often (?) the most
     specific. */
  if (!type) return NULL;
  if (type->str != NULL) {
    const char *last_name = type->str;
    const char *s;
    for (s = type->str; *s; s++)
      if (*s == '|') last_name = s+1;
    return last_name;
  }
  else
    return type->name;
}

/* 
   Set the clientdata field for a type
*/
SWIGRUNTIME void
SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
  swig_cast_info *cast = ti->cast;
  /* if (ti->clientdata == clientdata) return; */
  ti->clientdata = clientdata;
  
  while (cast) {
    if (!cast->converter) {
      swig_type_info *tc = cast->type;
      if (!tc->clientdata) {
	SWIG_TypeClientData(tc, clientdata);
      }
    }    
    cast = cast->next;
  }
}
SWIGRUNTIME void
SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
  SWIG_TypeClientData(ti, clientdata);
  ti->owndata = 1;
}
  
/*
  Search for a swig_type_info structure only by mangled name
  Search is a O(log #types)
  
  We start searching at module start, and finish searching when start == end.  
  Note: if start == end at the beginning of the function, we go all the way around
  the circular list.
*/
SWIGRUNTIME swig_type_info *
SWIG_MangledTypeQueryModule(swig_module_info *start, 
                            swig_module_info *end, 
		            const char *name) {
  swig_module_info *iter = start;
  do {
    if (iter->size) {
      register size_t l = 0;
      register size_t r = iter->size - 1;
      do {
	/* since l+r >= 0, we can (>> 1) instead (/ 2) */
	register size_t i = (l + r) >> 1; 
	const char *iname = iter->types[i]->name;
	if (iname) {
	  register int compare = strcmp(name, iname);
	  if (compare == 0) {	    
	    return iter->types[i];
	  } else if (compare < 0) {
	    if (i) {
	      r = i - 1;
	    } else {
	      break;
	    }
	  } else if (compare > 0) {
	    l = i + 1;
	  }
	} else {
	  break; /* should never happen */
	}
      } while (l <= r);
    }
    iter = iter->next;
  } while (iter != end);
  return 0;
}

/*
  Search for a swig_type_info structure for either a mangled name or a human readable name.
  It first searches the mangled names of the types, which is a O(log #types)
  If a type is not found it then searches the human readable names, which is O(#types).
  
  We start searching at module start, and finish searching when start == end.  
  Note: if start == end at the beginning of the function, we go all the way around
  the circular list.
*/
SWIGRUNTIME swig_type_info *
SWIG_TypeQueryModule(swig_module_info *start, 
                     swig_module_info *end, 
		     const char *name) {
  /* STEP 1: Search the name field using binary search */
  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
  if (ret) {
    return ret;
  } else {
    /* STEP 2: If the type hasn't been found, do a complete search
       of the str field (the human readable name) */
    swig_module_info *iter = start;
    do {
      register size_t i = 0;
      for (; i < iter->size; ++i) {
	if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
	  return iter->types[i];
      }
      iter = iter->next;
    } while (iter != end);
  }
  
  /* neither found a match */
  return 0;
}

/* 
   Pack binary data into a string
*/
SWIGRUNTIME char *
SWIG_PackData(char *c, void *ptr, size_t sz) {
  static const char hex[17] = "0123456789abcdef";
  register const unsigned char *u = (unsigned char *) ptr;
  register const unsigned char *eu =  u + sz;
  for (; u != eu; ++u) {
    register unsigned char uu = *u;
    *(c++) = hex[(uu & 0xf0) >> 4];
    *(c++) = hex[uu & 0xf];
  }
  return c;
}

/* 
   Unpack binary data from a string
*/
SWIGRUNTIME const char *
SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
  register unsigned char *u = (unsigned char *) ptr;
  register const unsigned char *eu = u + sz;
  for (; u != eu; ++u) {
    register char d = *(c++);
    register unsigned char uu;
    if ((d >= '0') && (d <= '9'))
      uu = ((d - '0') << 4);
    else if ((d >= 'a') && (d <= 'f'))
      uu = ((d - ('a'-10)) << 4);
    else 
      return (char *) 0;
    d = *(c++);
    if ((d >= '0') && (d <= '9'))
      uu |= (d - '0');
    else if ((d >= 'a') && (d <= 'f'))
      uu |= (d - ('a'-10));
    else 
      return (char *) 0;
    *u = uu;
  }
  return c;
}

/* 
   Pack 'void *' into a string buffer.
*/
SWIGRUNTIME char *
SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
  char *r = buff;
  if ((2*sizeof(void *) + 2) > bsz) return 0;
  *(r++) = '_';
  r = SWIG_PackData(r,&ptr,sizeof(void *));
  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
  strcpy(r,name);
  return buff;
}

SWIGRUNTIME const char *
SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
  if (*c != '_') {
    if (strcmp(c,"NULL") == 0) {
      *ptr = (void *) 0;
      return name;
    } else {
      return 0;
    }
  }
  return SWIG_UnpackData(++c,ptr,sizeof(void *));
}

SWIGRUNTIME char *
SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
  char *r = buff;
  size_t lname = (name ? strlen(name) : 0);
  if ((2*sz + 2 + lname) > bsz) return 0;
  *(r++) = '_';
  r = SWIG_PackData(r,ptr,sz);
  if (lname) {
    strncpy(r,name,lname+1);
  } else {
    *r = 0;
  }
  return buff;
}

SWIGRUNTIME const char *
SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
  if (*c != '_') {
    if (strcmp(c,"NULL") == 0) {
      memset(ptr,0,sz);
      return name;
    } else {
      return 0;
    }
  }
  return SWIG_UnpackData(++c,ptr,sz);
}

#ifdef __cplusplus
}
#endif

/* -----------------------------------------------------------------------------
 * luarun.swg
 *
 * This file contains the runtime support for Lua modules
 * and includes code for managing global variables and pointer
 * type checking.
 * ----------------------------------------------------------------------------- */

#ifdef __cplusplus
extern "C" {
#endif

#include "lua.h"
#include "lauxlib.h"
#include <stdlib.h>  /* for malloc */
#include <assert.h>  /* for a few sanity tests */

/* -----------------------------------------------------------------------------
 * global swig types
 * ----------------------------------------------------------------------------- */
/* Constant table */
#define SWIG_LUA_INT     1
#define SWIG_LUA_FLOAT   2
#define SWIG_LUA_STRING  3
#define SWIG_LUA_POINTER 4
#define SWIG_LUA_BINARY  5
#define SWIG_LUA_CHAR    6

/* Structure for variable linking table */
typedef struct {
  const char *name;
  lua_CFunction get;
  lua_CFunction set;
} swig_lua_var_info;

/* Constant information structure */
typedef struct {
    int type;
    char *name;
    long lvalue;
    double dvalue;
    void   *pvalue;
    swig_type_info **ptype;
} swig_lua_const_info;

typedef struct {
  const char     *name;
  lua_CFunction   method;
} swig_lua_method;

typedef struct {
  const char     *name;
  lua_CFunction   getmethod;
  lua_CFunction   setmethod;
} swig_lua_attribute;

typedef struct swig_lua_class {
  const char    *name;
  swig_type_info   **type;
  lua_CFunction  constructor;
  void    (*destructor)(void *);
  swig_lua_method   *methods;
  swig_lua_attribute     *attributes;
  struct swig_lua_class **bases;
  const char **base_names;
} swig_lua_class;

/* this is the struct for wrappering all pointers in SwigLua
*/
typedef struct {
  swig_type_info   *type;
  int     own;  /* 1 if owned & must be destroyed */
  void        *ptr;
} swig_lua_userdata;

/* this is the struct for wrapping arbitary packed binary data
(currently it is only used for member function pointers)
the data ordering is similar to swig_lua_userdata, but it is currently not possible
to tell the two structures apart within SWIG, other than by looking at the type
*/
typedef struct {
  swig_type_info   *type;
  int     own;  /* 1 if owned & must be destroyed */
  char data[1];       /* arbitary amount of data */    
} swig_lua_rawdata;

/* Common SWIG API */
#define SWIG_NewPointerObj(L, ptr, type, owner)       SWIG_Lua_NewPointerObj(L, (void *)ptr, type, owner)
#define SWIG_ConvertPtr(L,idx, ptr, type, flags)    SWIG_Lua_ConvertPtr(L,idx,ptr,type,flags)
#define SWIG_MustGetPtr(L,idx, type,flags, argnum,fnname)  SWIG_Lua_MustGetPtr(L,idx, type,flags, argnum,fnname)
/* for C++ member pointers, ie, member methods */
#define SWIG_ConvertMember(L, idx, ptr, sz, ty)       SWIG_Lua_ConvertPacked(L, idx, ptr, sz, ty)
#define SWIG_NewMemberObj(L, ptr, sz, type)      SWIG_Lua_NewPackedObj(L, ptr, sz, type)

/* Runtime API */
#define SWIG_GetModule(clientdata) SWIG_Lua_GetModule((lua_State*)(clientdata))
#define SWIG_SetModule(clientdata, pointer) SWIG_Lua_SetModule((lua_State*) (clientdata), pointer)
#define SWIG_MODULE_CLIENTDATA_TYPE lua_State*

/* Contract support */
#define SWIG_contract_assert(expr, msg)  \
  if (!(expr)) { lua_pushstring(L, (char *) msg); goto fail; } else

/* helper #defines */
#define SWIG_fail {goto fail;}
#define SWIG_fail_arg(func_name,argnum,type) \
  {lua_pushfstring(L,"Error in %s (arg %d), expected '%s' got '%s'",\
  func_name,argnum,type,SWIG_Lua_typename(L,argnum));\
  goto fail;}
#define SWIG_fail_ptr(func_name,argnum,type) \
  SWIG_fail_arg(func_name,argnum,(type && type->str)?type->str:"void*")
#define SWIG_check_num_args(func_name,a,b) \
  if (lua_gettop(L)<a || lua_gettop(L)>b) \
  {lua_pushfstring(L,"Error in %s expected %d..%d args, got %d",func_name,a,b,lua_gettop(L));\
  goto fail;}


#define SWIG_Lua_get_table(L,n) \
  (lua_pushstring(L, n), lua_rawget(L,-2))

#define SWIG_Lua_add_function(L,n,f) \
  (lua_pushstring(L, n), \
      lua_pushcfunction(L, f), \
      lua_rawset(L,-3))

/* special helper for allowing 'nil' for usertypes */
#define SWIG_isptrtype(L,I) (lua_isuserdata(L,I) || lua_isnil(L,I))

#ifdef __cplusplus
/* Special helper for member function pointers 
it gets the address, casts it, then dereferences it */
//#define SWIG_mem_fn_as_voidptr(a)  (*((char**)&(a)))
#endif

/* storing/access of swig_module_info */
SWIGRUNTIME swig_module_info *
SWIG_Lua_GetModule(lua_State* L) {
  swig_module_info *ret = 0;
  lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
  lua_rawget(L,LUA_REGISTRYINDEX);
  if (lua_islightuserdata(L,-1))
    ret=(swig_module_info*)lua_touserdata(L,-1);
  lua_pop(L,1);  /* tidy */
  return ret;
}

SWIGRUNTIME void
SWIG_Lua_SetModule(lua_State* L, swig_module_info *module) {
  /* add this all into the Lua registry: */
  lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
  lua_pushlightuserdata(L,(void*)module);
  lua_rawset(L,LUA_REGISTRYINDEX);
}

/* -----------------------------------------------------------------------------
 * global variable support code: modules
 * ----------------------------------------------------------------------------- */

/* this function is called when trying to set an immutable.
default value is to print an error.
This can removed with a compile flag SWIGLUA_IGNORE_SET_IMMUTABLE */
SWIGINTERN int SWIG_Lua_set_immutable(lua_State* L)
{
/*  there should be 1 param passed in: the new value */
#ifndef SWIGLUA_IGNORE_SET_IMMUTABLE
  lua_pop(L,1);  /* remove it */
  lua_pushstring(L,"This variable is immutable");
  lua_error(L);
#endif
    return 0;   /* should not return anything */
}

/* the module.get method used for getting linked data */
SWIGINTERN int SWIG_Lua_module_get(lua_State* L)
{
/*  there should be 2 params passed in
  (1) table (not the meta table)
  (2) string name of the attribute
  printf("SWIG_Lua_module_get %p(%s) '%s'\n",
   lua_topointer(L,1),lua_typename(L,lua_type(L,1)),
   lua_tostring(L,2));
*/
  /* get the metatable */
  assert(lua_istable(L,1));  /* just in case */
  lua_getmetatable(L,1);  /* get the metatable */
  assert(lua_istable(L,-1));  /* just in case */
  SWIG_Lua_get_table(L,".get");  /* get the .get table */
  lua_remove(L,3);  /* remove metatable */
  if (lua_istable(L,-1))
  {
    /* look for the key in the .get table */
    lua_pushvalue(L,2);  /* key */
    lua_rawget(L,-2);
    lua_remove(L,3);  /* remove .get */
    if (lua_iscfunction(L,-1))
    {  /* found it so call the fn & return its value */
      lua_call(L,0,1);
      return 1;
    }
    lua_pop(L,1);  /* remove the top */
  }
  lua_pop(L,1);  /* remove the .get */
  lua_pushnil(L);  /* return a nil */
    return 1;
}

/* the module.set method used for setting linked data */
SWIGINTERN int SWIG_Lua_module_set(lua_State* L)
{
/*  there should be 3 params passed in
  (1) table (not the meta table)
  (2) string name of the attribute
  (3) any for the new value
*/
  /* get the metatable */
  assert(lua_istable(L,1));  /* just in case */
  lua_getmetatable(L,1);  /* get the metatable */
  assert(lua_istable(L,-1));  /* just in case */
  SWIG_Lua_get_table(L,".set");  /* get the .set table */
  lua_remove(L,4);  /* remove metatable */
  if (lua_istable(L,-1))
  {
    /* look for the key in the .set table */
    lua_pushvalue(L,2);  /* key */
    lua_rawget(L,-2);
    lua_remove(L,4);  /* remove .set */
    if (lua_iscfunction(L,-1))
    {  /* found it so call the fn & return its value */
      lua_pushvalue(L,3);  /* value */
      lua_call(L,1,0);
      return 0;
    }
  }
  lua_settop(L,3);  /* reset back to start */
  /* we now have the table, key & new value, so just set directly */
  lua_rawset(L,1);  /* add direct */
  return 0;
}

/* registering a module in lua */
SWIGINTERN void  SWIG_Lua_module_begin(lua_State* L,const char* name)
{
  assert(lua_istable(L,-1));  /* just in case */
  lua_pushstring(L,name);
  lua_newtable(L);   /* the table */
  /* add meta table */
  lua_newtable(L);    /* the meta table */
  SWIG_Lua_add_function(L,"__index",SWIG_Lua_module_get);
  SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_module_set);
  lua_pushstring(L,".get");
  lua_newtable(L);    /* the .get table */
  lua_rawset(L,-3);  /* add .get into metatable */
  lua_pushstring(L,".set");
  lua_newtable(L);    /* the .set table */
  lua_rawset(L,-3);  /* add .set into metatable */
  lua_setmetatable(L,-2);  /* sets meta table in module */
  lua_rawset(L,-3);        /* add module into parent */
  SWIG_Lua_get_table(L,name);   /* get the table back out */
}

/* ending the register */
SWIGINTERN void  SWIG_Lua_module_end(lua_State* L)
{
  lua_pop(L,1);       /* tidy stack (remove module) */
}

/* adding a linked variable to the module */
SWIGINTERN void SWIG_Lua_module_add_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn)
{
  assert(lua_istable(L,-1));  /* just in case */
  lua_getmetatable(L,-1);  /* get the metatable */
  assert(lua_istable(L,-1));  /* just in case */
  SWIG_Lua_get_table(L,".get"); /* find the .get table */
  assert(lua_istable(L,-1));  /* should be a table: */
  SWIG_Lua_add_function(L,name,getFn);
  lua_pop(L,1);       /* tidy stack (remove table) */
  if (setFn)  /* if there is a set fn */
  {
    SWIG_Lua_get_table(L,".set"); /* find the .set table */
    assert(lua_istable(L,-1));  /* should be a table: */
    SWIG_Lua_add_function(L,name,setFn);
    lua_pop(L,1);       /* tidy stack (remove table) */
  }
  lua_pop(L,1);       /* tidy stack (remove meta) */
}

/* adding a function module */
SWIGINTERN void  SWIG_Lua_module_add_function(lua_State* L,const char* name,lua_CFunction fn)
{
  SWIG_Lua_add_function(L,name,fn);
}

/* -----------------------------------------------------------------------------
 * global variable support code: classes
 * ----------------------------------------------------------------------------- */

/* the class.get method, performs the lookup of class attributes */
SWIGINTERN int  SWIG_Lua_class_get(lua_State* L)
{
/*  there should be 2 params passed in
  (1) userdata (not the meta table)
  (2) string name of the attribute
*/
  assert(lua_isuserdata(L,-2));  /* just in case */
  lua_getmetatable(L,-2);    /* get the meta table */
  assert(lua_istable(L,-1));  /* just in case */
  SWIG_Lua_get_table(L,".get"); /* find the .get table */
  assert(lua_istable(L,-1));  /* just in case */
  /* look for the key in the .get table */
  lua_pushvalue(L,2);  /* key */
  lua_rawget(L,-2);
  lua_remove(L,-2); /* stack tidy, remove .get table */
  if (lua_iscfunction(L,-1))
  {  /* found it so call the fn & return its value */
    lua_pushvalue(L,1);  /* the userdata */
    lua_call(L,1,1);  /* 1 value in (userdata),1 out (result) */
    lua_remove(L,-2); /* stack tidy, remove metatable */
    return 1;
  }
  lua_pop(L,1);  /* remove whatever was there */
  /* ok, so try the .fn table */
  SWIG_Lua_get_table(L,".fn"); /* find the .get table */
  assert(lua_istable(L,-1));  /* just in case */
  lua_pushvalue(L,2);  /* key */
  lua_rawget(L,-2);  /* look for the fn */
  lua_remove(L,-2); /* stack tidy, remove .fn table */
  if (lua_isfunction(L,-1)) /* note: if its a C function or lua function */
  {  /* found it so return the fn & let lua call it */
    lua_remove(L,-2); /* stack tidy, remove metatable */
    return 1;
  }
  lua_pop(L,1);  /* remove whatever was there */
  /* NEW: looks for the __getitem() fn
  this is a user provided get fn */
  SWIG_Lua_get_table(L,"__getitem"); /* find the __getitem fn */
  if (lua_iscfunction(L,-1))  /* if its there */
  {  /* found it so call the fn & return its value */
    lua_pushvalue(L,1);  /* the userdata */
    lua_pushvalue(L,2);  /* the parameter */
    lua_call(L,2,1);  /* 2 value in (userdata),1 out (result) */
    lua_remove(L,-2); /* stack tidy, remove metatable */
    return 1;
  }
  return 0;  /* sorry not known */
}

/* the class.set method, performs the lookup of class attributes */
SWIGINTERN int  SWIG_Lua_class_set(lua_State* L)
{
/*  there should be 3 params passed in
  (1) table (not the meta table)
  (2) string name of the attribute
  (3) any for the new value
printf("SWIG_Lua_class_set %p(%s) '%s' %p(%s)\n",
      lua_topointer(L,1),lua_typename(L,lua_type(L,1)),
      lua_tostring(L,2),
      lua_topointer(L,3),lua_typename(L,lua_type(L,3)));*/

  assert(lua_isuserdata(L,1));  /* just in case */
  lua_getmetatable(L,1);    /* get the meta table */
  assert(lua_istable(L,-1));  /* just in case */

  SWIG_Lua_get_table(L,".set"); /* find the .set table */
  if (lua_istable(L,-1))
  {
    /* look for the key in the .set table */
    lua_pushvalue(L,2);  /* key */
    lua_rawget(L,-2);
    if (lua_iscfunction(L,-1))
    {  /* found it so call the fn & return its value */
      lua_pushvalue(L,1);  /* userdata */
      lua_pushvalue(L,3);  /* value */
      lua_call(L,2,0);
      return 0;
    }
    lua_pop(L,1);  /* remove the value */
  }
  lua_pop(L,1);  /* remove the value .set table */
  /* NEW: looks for the __setitem() fn
  this is a user provided set fn */
  SWIG_Lua_get_table(L,"__setitem"); /* find the fn */
  if (lua_iscfunction(L,-1))  /* if its there */
  {  /* found it so call the fn & return its value */
    lua_pushvalue(L,1);  /* the userdata */
    lua_pushvalue(L,2);  /* the parameter */
    lua_pushvalue(L,3);  /* the value */
    lua_call(L,3,0);  /* 3 values in ,0 out */
    lua_remove(L,-2); /* stack tidy, remove metatable */
    return 1;
  }
  return 0;
}

/* the class.destruct method called by the interpreter */
SWIGINTERN int  SWIG_Lua_class_destruct(lua_State* L)
{
/*  there should be 1 params passed in
  (1) userdata (not the meta table) */
  swig_lua_userdata* usr;
  swig_lua_class* clss;
  assert(lua_isuserdata(L,-1));  /* just in case */
  usr=(swig_lua_userdata*)lua_touserdata(L,-1);  /* get it */
  /* if must be destroyed & has a destructor */
  if (usr->own) /* if must be destroyed */
  {
    clss=(swig_lua_class*)usr->type->clientdata;  /* get the class */
    if (clss && clss->destructor)  /* there is a destroy fn */
    {
      clss->destructor(usr->ptr);  /* bye bye */
    }
  }
  return 0;
}

/* gets the swig class registry (or creates it) */
SWIGINTERN void  SWIG_Lua_get_class_registry(lua_State* L)
{
  /* add this all into the swig registry: */
  lua_pushstring(L,"SWIG");
  lua_rawget(L,LUA_REGISTRYINDEX);  /* get the registry */
  if (!lua_istable(L,-1))  /* not there */
  {  /* must be first time, so add it */
    lua_pop(L,1);  /* remove the result */
    lua_pushstring(L,"SWIG");
    lua_newtable(L);
    lua_rawset(L,LUA_REGISTRYINDEX);
    /* then get it */
    lua_pushstring(L,"SWIG");
    lua_rawget(L,LUA_REGISTRYINDEX);
  }
}

/* helper fn to get the classes metatable from the register */
SWIGINTERN void  SWIG_Lua_get_class_metatable(lua_State* L,const char* cname)
{
  SWIG_Lua_get_class_registry(L);  /* get the registry */
  lua_pushstring(L,cname);  /* get the name */
  lua_rawget(L,-2);    /* get it */
  lua_remove(L,-2);    /* tidy up (remove registry) */
}

/* helper add a variable to a registered class */
SWIGINTERN void  SWIG_Lua_add_class_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn)
{
  assert(lua_istable(L,-1));  /* just in case */
  SWIG_Lua_get_table(L,".get"); /* find the .get table */
  assert(lua_istable(L,-1));  /* just in case */
  SWIG_Lua_add_function(L,name,getFn);
  lua_pop(L,1);       /* tidy stack (remove table) */
  if (setFn)
  {
    SWIG_Lua_get_table(L,".set"); /* find the .set table */
    assert(lua_istable(L,-1));  /* just in case */
    SWIG_Lua_add_function(L,name,setFn);
    lua_pop(L,1);       /* tidy stack (remove table) */
  }
}

/* helper to recursively add class details (attributes & operations) */
SWIGINTERN void  SWIG_Lua_add_class_details(lua_State* L,swig_lua_class* clss)
{
  int i;
  /* call all the base classes first: we can then override these later: */
  for(i=0;clss->bases[i];i++)
  {
    SWIG_Lua_add_class_details(L,clss->bases[i]);
  }
  /* add fns */
  for(i=0;clss->attributes[i].name;i++){
    SWIG_Lua_add_class_variable(L,clss->attributes[i].name,clss->attributes[i].getmethod,clss->attributes[i].setmethod);
  }
  /* add methods to the metatable */
  SWIG_Lua_get_table(L,".fn"); /* find the .fn table */
  assert(lua_istable(L,-1));  /* just in case */
  for(i=0;clss->methods[i].name;i++){
    SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method);
  }
  lua_pop(L,1);       /* tidy stack (remove table) */
  /*   add operator overloads
    these look ANY method which start with "__" and assume they
    are operator overloads & add them to the metatable
    (this might mess up is someone defines a method __gc (the destructor)*/
  for(i=0;clss->methods[i].name;i++){
    if (clss->methods[i].name[0]=='_' && clss->methods[i].name[1]=='_'){
      SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method);
    }
  }
}

/* set up the base classes pointers.
Each class structure has a list of pointers to the base class structures.
This function fills them.
It cannot be done at compile time, as this will not work with hireachies
spread over more than one swig file. 
Therefore it must be done at runtime, querying the SWIG type system.
*/
SWIGINTERN void SWIG_Lua_init_base_class(lua_State* L,swig_lua_class* clss)
{
  int i=0;
  swig_module_info* module=SWIG_GetModule(L);
  for(i=0;clss->base_names[i];i++)
  {
    if (clss->bases[i]==0) /* not found yet */
    {
      /* lookup and cache the base class */
      swig_type_info *info = SWIG_TypeQueryModule(module,module,clss->base_names[i]);
      if (info) clss->bases[i] = (swig_lua_class *) info->clientdata;
    }
  }	
}

/* performs the entire class registration process */
SWIGINTERN void  SWIG_Lua_class_register(lua_State* L,swig_lua_class* clss)
{
  /*  add its constructor to module with the name of the class
  so you can do MyClass(...) as well as new_MyClass(...)
  BUT only if a constructor is defined
  (this overcomes the problem of pure virtual classes without constructors)*/
  if (clss->constructor)
    SWIG_Lua_add_function(L,clss->name,clss->constructor);

  SWIG_Lua_get_class_registry(L);  /* get the registry */
  lua_pushstring(L,clss->name);  /* get the name */
  lua_newtable(L);    /* create the metatable */
  /* add string of class name called ".type" */
  lua_pushstring(L,".type");
  lua_pushstring(L,clss->name);
  lua_rawset(L,-3);
  /* add a table called ".get" */
  lua_pushstring(L,".get");
  lua_newtable(L);
  lua_rawset(L,-3);
  /* add a table called ".set" */
  lua_pushstring(L,".set");
  lua_newtable(L);
  lua_rawset(L,-3);
  /* add a table called ".fn" */
  lua_pushstring(L,".fn");
  lua_newtable(L);
  lua_rawset(L,-3);
  /* add accessor fns for using the .get,.set&.fn */
  SWIG_Lua_add_function(L,"__index",SWIG_Lua_class_get);
  SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_class_set);
  SWIG_Lua_add_function(L,"__gc",SWIG_Lua_class_destruct);
  /* add it */
  lua_rawset(L,-3);  /* metatable into registry */
  lua_pop(L,1);      /* tidy stack (remove registry) */

  SWIG_Lua_get_class_metatable(L,clss->name);
  SWIG_Lua_add_class_details(L,clss);  /* recursive adding of details (atts & ops) */
  lua_pop(L,1);      /* tidy stack (remove class metatable) */
}

/* -----------------------------------------------------------------------------
 * Class/structure conversion fns
 * ----------------------------------------------------------------------------- */

/* helper to add metatable to new lua object */
SWIGINTERN void _SWIG_Lua_AddMetatable(lua_State* L,swig_type_info *type)
{
  if (type->clientdata)  /* there is clientdata: so add the metatable */
  {
    SWIG_Lua_get_class_metatable(L,((swig_lua_class*)(type->clientdata))->name);
    if (lua_istable(L,-1))
    {
      lua_setmetatable(L,-2);
    }
    else
    {
      lua_pop(L,1);
    }
  }
}

/* pushes a new object into the lua stack */
SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State* L,void* ptr,swig_type_info *type, int own)
{
  swig_lua_userdata* usr;
  if (!ptr){
    lua_pushnil(L);
    return;
  }
  usr=(swig_lua_userdata*)lua_newuserdata(L,sizeof(swig_lua_userdata));  /* get data */
  usr->ptr=ptr;  /* set the ptr */
  usr->type=type;
  usr->own=own;
  _SWIG_Lua_AddMetatable(L,type); /* add metatable */
}

/* takes a object from the lua stack & converts it into an object of the correct type
 (if possible) */
SWIGRUNTIME int  SWIG_Lua_ConvertPtr(lua_State* L,int index,void** ptr,swig_type_info *type,int flags)
{
  swig_lua_userdata* usr;
  swig_cast_info *cast;
  if (lua_isnil(L,index)){*ptr=0; return SWIG_OK;}    /* special case: lua nil => NULL pointer */
  usr=(swig_lua_userdata*)lua_touserdata(L,index);  /* get data */
  if (usr)
  {
    if (flags & SWIG_POINTER_DISOWN) /* must disown the object */
    {
        usr->own=0;
    }
    if (!type)            /* special cast void*, no casting fn */
    {
      *ptr=usr->ptr;
      return SWIG_OK; /* ok */
    }
    cast=SWIG_TypeCheckStruct(usr->type,type); /* performs normal type checking */
    if (cast)
    {
      int newmemory = 0;
      *ptr=SWIG_TypeCast(cast,usr->ptr,&newmemory);
      assert(!newmemory); /* newmemory handling not yet implemented */
      return SWIG_OK;  /* ok */
    }
  }
  return SWIG_ERROR;  /* error */
}

SWIGRUNTIME void* SWIG_Lua_MustGetPtr(lua_State* L,int index,swig_type_info *type,int flags,
       int argnum,const char* func_name){
  void* result;
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,index,&result,type,flags))){
    lua_pushfstring(L,"Error in %s, expected a %s at argument number %d\n",
      func_name,(type && type->str)?type->str:"void*",argnum);
    lua_error(L);
  }
  return result;
}

/* pushes a packed userdata. user for member fn pointers only */
SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State* L,void* ptr,size_t size,swig_type_info *type)
{
  swig_lua_rawdata* raw;
  assert(ptr); /* not acceptable to pass in a NULL value */
  raw=(swig_lua_rawdata*)lua_newuserdata(L,sizeof(swig_lua_rawdata)-1+size);  /* alloc data */
  raw->type=type;
  raw->own=0;
  memcpy(raw->data,ptr,size); /* copy the data */
  _SWIG_Lua_AddMetatable(L,type); /* add metatable */
}
    
/* converts a packed userdata. user for member fn pointers only */
SWIGRUNTIME int  SWIG_Lua_ConvertPacked(lua_State* L,int index,void* ptr,size_t size,swig_type_info *type)
{
  swig_lua_rawdata* raw;
  raw=(swig_lua_rawdata*)lua_touserdata(L,index);  /* get data */
  if (!raw) return SWIG_ERROR;  /* error */
  if (type==0 || type==raw->type) /* void* or identical type */
  {
    memcpy(ptr,raw->data,size); /* copy it */
    return SWIG_OK; /* ok */
  }
  return SWIG_ERROR;  /* error */
}

/* a function to get the typestring of a piece of data */
SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp)
{
  swig_lua_userdata* usr;
  if (lua_isuserdata(L,tp))
  {
    usr=(swig_lua_userdata*)lua_touserdata(L,tp);  /* get data */
    if (usr && usr->type && usr->type->str)
      return usr->type->str;
    return "userdata (unknown type)";
  }
  return lua_typename(L,lua_type(L,tp));
}

/* lua callable function to get the userdata's type */
SWIGRUNTIME int SWIG_Lua_type(lua_State* L)
{
  lua_pushstring(L,SWIG_Lua_typename(L,1));
  return 1;
}

/* lua callable function to compare userdata's value
the issue is that two userdata may point to the same thing
but to lua, they are different objects */
SWIGRUNTIME int SWIG_Lua_equal(lua_State* L)
{
  int result;
  swig_lua_userdata *usr1,*usr2;
  if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2))  /* just in case */
    return 0;  /* nil reply */
  usr1=(swig_lua_userdata*)lua_touserdata(L,1);  /* get data */
  usr2=(swig_lua_userdata*)lua_touserdata(L,2);  /* get data */
  /*result=(usr1->ptr==usr2->ptr && usr1->type==usr2->type); only works if type is the same*/
  result=(usr1->ptr==usr2->ptr);
   lua_pushboolean(L,result);
  return 1;
}

/* -----------------------------------------------------------------------------
 * global variable support code: class/struct typemap functions
 * ----------------------------------------------------------------------------- */

/* Install Constants */
SWIGINTERN void
SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) {
  int i;
  for (i = 0; constants[i].type; i++) {
    switch(constants[i].type) {
    case SWIG_LUA_INT:
      lua_pushstring(L,constants[i].name);
      lua_pushnumber(L,(lua_Number)constants[i].lvalue);
      lua_rawset(L,-3);
      break;
    case SWIG_LUA_FLOAT:
      lua_pushstring(L,constants[i].name);
      lua_pushnumber(L,(lua_Number)constants[i].dvalue);
      lua_rawset(L,-3);
      break;
    case SWIG_LUA_CHAR:
      lua_pushstring(L,constants[i].name);
      lua_pushfstring(L,"%c",(char)constants[i].lvalue);
      lua_rawset(L,-3);
      break;
    case SWIG_LUA_STRING:
      lua_pushstring(L,constants[i].name);
      lua_pushstring(L,(char *) constants[i].pvalue);
      lua_rawset(L,-3);
      break;
    case SWIG_LUA_POINTER:
      lua_pushstring(L,constants[i].name);
      SWIG_NewPointerObj(L,constants[i].pvalue, *(constants[i]).ptype,0);
      lua_rawset(L,-3);
      break;
    case SWIG_LUA_BINARY:
      lua_pushstring(L,constants[i].name);
      SWIG_NewMemberObj(L,constants[i].pvalue,constants[i].lvalue,*(constants[i]).ptype);
      lua_rawset(L,-3);
      break;
    default:
      break;
    }
  }
}

/* -----------------------------------------------------------------------------
 * executing lua code from within the wrapper
 * ----------------------------------------------------------------------------- */

#ifndef SWIG_DOSTRING_FAIL /* Allows redefining of error function */
#define SWIG_DOSTRING_FAIL(S) fprintf(stderr,"%s\n",S)
#endif
/* Executes a C string in Lua a really simple way of calling lua from C
Unfortunately lua keeps changing its API's, so we need a conditional compile
In lua 5.0.X its lua_dostring()
In lua 5.1.X its luaL_dostring()
*/
SWIGINTERN int 
SWIG_Lua_dostring(lua_State *L, const char* str) {
  int ok,top;
  if (str==0 || str[0]==0) return 0; /* nothing to do */
  top=lua_gettop(L); /* save stack */
#if (defined(LUA_VERSION_NUM) && (LUA_VERSION_NUM>=501))
  ok=luaL_dostring(L,str);	/* looks like this is lua 5.1.X or later, good */
#else
  ok=lua_dostring(L,str);	/* might be lua 5.0.x, using lua_dostring */
#endif
  if (ok!=0) {
    SWIG_DOSTRING_FAIL(lua_tostring(L,-1));
  }
  lua_settop(L,top); /* restore the stack */
  return ok;
}    

#ifdef __cplusplus
}
#endif

/* ------------------------------ end luarun.swg  ------------------------------ */

/*  Errors in SWIG */
#define  SWIG_UnknownError    	   -1 
#define  SWIG_IOError        	   -2 
#define  SWIG_RuntimeError   	   -3 
#define  SWIG_IndexError     	   -4 
#define  SWIG_TypeError      	   -5 
#define  SWIG_DivisionByZero 	   -6 
#define  SWIG_OverflowError  	   -7 
#define  SWIG_SyntaxError    	   -8 
#define  SWIG_ValueError     	   -9 
#define  SWIG_SystemError    	   -10
#define  SWIG_AttributeError 	   -11
#define  SWIG_MemoryError    	   -12 
#define  SWIG_NullReferenceError   -13




/* -------- TYPES TABLE (BEGIN) -------- */

#define SWIGTYPE_p_Xapian__AssertionError swig_types[0]
#define SWIGTYPE_p_Xapian__BM25Weight swig_types[1]
#define SWIGTYPE_p_Xapian__BoolWeight swig_types[2]
#define SWIGTYPE_p_Xapian__Compactor swig_types[3]
#define SWIGTYPE_p_Xapian__Database swig_types[4]
#define SWIGTYPE_p_Xapian__DatabaseCorruptError swig_types[5]
#define SWIGTYPE_p_Xapian__DatabaseCreateError swig_types[6]
#define SWIGTYPE_p_Xapian__DatabaseError swig_types[7]
#define SWIGTYPE_p_Xapian__DatabaseLockError swig_types[8]
#define SWIGTYPE_p_Xapian__DatabaseModifiedError swig_types[9]
#define SWIGTYPE_p_Xapian__DatabaseOpeningError swig_types[10]
#define SWIGTYPE_p_Xapian__DatabaseVersionError swig_types[11]
#define SWIGTYPE_p_Xapian__DateValueRangeProcessor swig_types[12]
#define SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource swig_types[13]
#define SWIGTYPE_p_Xapian__DocNotFoundError swig_types[14]
#define SWIGTYPE_p_Xapian__Document swig_types[15]
#define SWIGTYPE_p_Xapian__ESet swig_types[16]
#define SWIGTYPE_p_Xapian__ESetIterator swig_types[17]
#define SWIGTYPE_p_Xapian__Enquire swig_types[18]
#define SWIGTYPE_p_Xapian__Error swig_types[19]
#define SWIGTYPE_p_Xapian__ExpandDecider swig_types[20]
#define SWIGTYPE_p_Xapian__FeatureUnavailableError swig_types[21]
#define SWIGTYPE_p_Xapian__FixedWeightPostingSource swig_types[22]
#define SWIGTYPE_p_Xapian__InternalError swig_types[23]
#define SWIGTYPE_p_Xapian__InvalidArgumentError swig_types[24]
#define SWIGTYPE_p_Xapian__InvalidOperationError swig_types[25]
#define SWIGTYPE_p_Xapian__KeyMaker swig_types[26]
#define SWIGTYPE_p_Xapian__LogicError swig_types[27]
#define SWIGTYPE_p_Xapian__MSet swig_types[28]
#define SWIGTYPE_p_Xapian__MSetIterator swig_types[29]
#define SWIGTYPE_p_Xapian__MatchDecider swig_types[30]
#define SWIGTYPE_p_Xapian__MatchSpy swig_types[31]
#define SWIGTYPE_p_Xapian__MultiValueKeyMaker swig_types[32]
#define SWIGTYPE_p_Xapian__MultiValueSorter swig_types[33]
#define SWIGTYPE_p_Xapian__NetworkError swig_types[34]
#define SWIGTYPE_p_Xapian__NetworkTimeoutError swig_types[35]
#define SWIGTYPE_p_Xapian__NumberValueRangeProcessor swig_types[36]
#define SWIGTYPE_p_Xapian__PositionIterator swig_types[37]
#define SWIGTYPE_p_Xapian__PostingIterator swig_types[38]
#define SWIGTYPE_p_Xapian__PostingSource swig_types[39]
#define SWIGTYPE_p_Xapian__Query swig_types[40]
#define SWIGTYPE_p_Xapian__QueryParser swig_types[41]
#define SWIGTYPE_p_Xapian__QueryParserError swig_types[42]
#define SWIGTYPE_p_Xapian__RSet swig_types[43]
#define SWIGTYPE_p_Xapian__RangeError swig_types[44]
#define SWIGTYPE_p_Xapian__Registry swig_types[45]
#define SWIGTYPE_p_Xapian__RuntimeError swig_types[46]
#define SWIGTYPE_p_Xapian__SerialisationError swig_types[47]
#define SWIGTYPE_p_Xapian__SimpleStopper swig_types[48]
#define SWIGTYPE_p_Xapian__Sorter swig_types[49]
#define SWIGTYPE_p_Xapian__Stem swig_types[50]
#define SWIGTYPE_p_Xapian__StemImplementation swig_types[51]
#define SWIGTYPE_p_Xapian__Stopper swig_types[52]
#define SWIGTYPE_p_Xapian__StringValueRangeProcessor swig_types[53]
#define SWIGTYPE_p_Xapian__TermGenerator swig_types[54]
#define SWIGTYPE_p_Xapian__TermIterator swig_types[55]
#define SWIGTYPE_p_Xapian__TradWeight swig_types[56]
#define SWIGTYPE_p_Xapian__UnimplementedError swig_types[57]
#define SWIGTYPE_p_Xapian__ValueCountMatchSpy swig_types[58]
#define SWIGTYPE_p_Xapian__ValueIterator swig_types[59]
#define SWIGTYPE_p_Xapian__ValueMapPostingSource swig_types[60]
#define SWIGTYPE_p_Xapian__ValuePostingSource swig_types[61]
#define SWIGTYPE_p_Xapian__ValueRangeProcessor swig_types[62]
#define SWIGTYPE_p_Xapian__ValueSetMatchDecider swig_types[63]
#define SWIGTYPE_p_Xapian__ValueWeightPostingSource swig_types[64]
#define SWIGTYPE_p_Xapian__Weight swig_types[65]
#define SWIGTYPE_p_Xapian__WritableDatabase swig_types[66]
#define SWIGTYPE_p_compaction_level swig_types[67]
#define SWIGTYPE_p_docid_order swig_types[68]
#define SWIGTYPE_p_double swig_types[69]
#define SWIGTYPE_p_feature_flag swig_types[70]
#define SWIGTYPE_p_first_type swig_types[71]
#define SWIGTYPE_p_int swig_types[72]
#define SWIGTYPE_p_op swig_types[73]
#define SWIGTYPE_p_second_type swig_types[74]
#define SWIGTYPE_p_std__string swig_types[75]
#define SWIGTYPE_p_stem_strategy swig_types[76]
#define SWIGTYPE_p_unsigned_int swig_types[77]
static swig_type_info *swig_types[79];
static swig_module_info swig_module = {swig_types, 78, 0, 0, 0, 0};
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)

/* -------- TYPES TABLE (END) -------- */

#define SWIG_name      "xapian"
#define SWIG_init      luaopen_xapian
#define SWIG_init_user luaopen_xapian_user

#define SWIG_LUACODE   luaopen_xapian_luacode


namespace swig {
typedef struct{} LANGUAGE_OBJ;
}


/* xapian.i: the Xapian scripting interface.
 *
 * Copyright 1999,2000,2001 BrightStation PLC
 * Copyright 2001,2002 Ananova Ltd
 * Copyright 2002,2003,2005 James Aylett
 * Copyright 2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2015 Olly Betts
 * Copyright 2007 Lemur Consulting Ltd
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
 * USA
 */


/** @file xapian-head.i
 * @brief Header for SWIG interface file for Xapian.
 */
/* Copyright (C) 2005,2006,2007,2008,2009,2011 Olly Betts
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
 * USA
 */

// Disable any deprecation warnings for Xapian methods/functions/classes.
#define XAPIAN_DEPRECATED(D) D
#define XAPIAN_DEPRECATED_CLASS

#include <xapian.h>

#include <string>
#include <vector>

using namespace std;

// If a backend has been disabled in xapian-core (manually or automatically) we
// include a stub definition here so the bindings can still be built.
namespace Xapian {
#ifndef XAPIAN_HAS_BRASS_BACKEND
    namespace Brass {
	static Database open(const string &) {
	    throw FeatureUnavailableError("Brass backend not supported");
	}
	static WritableDatabase open(const string &, int, int = 8192) {
	    throw FeatureUnavailableError("Brass backend not supported");
	}
    }
#endif

#ifndef XAPIAN_HAS_CHERT_BACKEND
    namespace Chert {
	static Database open(const string &) {
	    throw FeatureUnavailableError("Chert backend not supported");
	}
	static WritableDatabase open(const string &, int, int = 8192) {
	    throw FeatureUnavailableError("Chert backend not supported");
	}
    }
#endif

#ifndef XAPIAN_HAS_FLINT_BACKEND
    namespace Flint {
	static Database open(const string &) {
	    throw FeatureUnavailableError("Flint backend not supported");
	}
	static WritableDatabase open(const string &, int, int = 8192) {
	    throw FeatureUnavailableError("Flint backend not supported");
	}
    }
#endif

#ifndef XAPIAN_HAS_INMEMORY_BACKEND
    namespace InMemory {
	static WritableDatabase open() {
	    throw FeatureUnavailableError("InMemory backend not supported");
	}
    }
#endif

#ifndef XAPIAN_HAS_REMOTE_BACKEND
    namespace Remote {
	static Database open(const string &, unsigned int, timeout = 0, timeout = 0) {
	    throw FeatureUnavailableError("Remote backend not supported");
	}

	static WritableDatabase open_writable(const string &, unsigned int, timeout = 0, timeout = 0) {
	    throw FeatureUnavailableError("Remote backend not supported");
	}

	static Database open(const string &, const string &, timeout = 0) {
	    throw FeatureUnavailableError("Remote backend not supported");
	}

	static WritableDatabase open_writable(const string &, const string &, timeout = 0) {
	    throw FeatureUnavailableError("Remote backend not supported");
	}
    }
#endif
}


#include <stdexcept>


#define SWIG_exception(a,b)\
{ lua_pushfstring(L,"%s:%s",#a,b);SWIG_fail; }


#include <stdexcept>


	#include <string>


SWIGINTERN int SWIG_lua_isnilstring(lua_State *L, int idx) {
  int ret = lua_isstring(L, idx);
  if (!ret)
   ret = lua_isnil(L, idx);
  return ret;
}


#include <vector>


#include <map>
#include <algorithm>
#include <stdexcept>


#include <utility>


#ifdef __cplusplus	/* generic alloc/dealloc fns*/
#define SWIG_ALLOC_ARRAY(TYPE,LEN) 	new TYPE[LEN]
#define SWIG_FREE_ARRAY(PTR)		delete[] PTR
#else
#define SWIG_ALLOC_ARRAY(TYPE,LEN) 	(TYPE *)malloc(LEN*sizeof(TYPE))
#define SWIG_FREE_ARRAY(PTR)		free(PTR)
#endif
/* counting the size of arrays:*/
SWIGINTERN int SWIG_itable_size(lua_State* L, int index)
{
	int n=0;
	while(1){
		lua_rawgeti(L,index,n+1);
		if (lua_isnil(L,-1))break;
		++n;
		lua_pop(L,1);
	}
	lua_pop(L,1);
	return n;
}

SWIGINTERN int SWIG_table_size(lua_State* L, int index)
{
	int n=0;
	lua_pushnil(L);  /* first key*/
	while (lua_next(L, index) != 0) {
		++n;
		lua_pop(L, 1);  /* removes `value'; keeps `key' for next iteration*/
	}
	return n;
}

/* super macro to declare array typemap helper fns */
#define SWIG_DECLARE_TYPEMAP_ARR_FN(NAME,TYPE)\
	SWIGINTERN int SWIG_read_##NAME##_num_array(lua_State* L,int index,TYPE *array,int size){\
		int i;\
		for (i = 0; i < size; i++) {\
			lua_rawgeti(L,index,i+1);\
			if (lua_isnumber(L,-1)){\
				array[i] = (TYPE)lua_tonumber(L,-1);\
			} else {\
				lua_pop(L,1);\
				return 0;\
			}\
			lua_pop(L,1);\
		}\
		return 1;\
	}\
	SWIGINTERN TYPE* SWIG_get_##NAME##_num_array_fixed(lua_State* L, int index, int size){\
		TYPE *array;\
		if (!lua_istable(L,index) || SWIG_itable_size(L,index) != size) {\
			lua_pushfstring(L,"expected a table of size %d",size);\
			return 0;\
		}\
		array=SWIG_ALLOC_ARRAY(TYPE,size);\
		if (!SWIG_read_##NAME##_num_array(L,index,array,size)){\
			lua_pushstring(L,"table must contain numbers");\
			SWIG_FREE_ARRAY(array);\
			return 0;\
		}\
		return array;\
	}\
	SWIGINTERN TYPE* SWIG_get_##NAME##_num_array_var(lua_State* L, int index, int* size)\
	{\
		TYPE *array;\
		if (!lua_istable(L,index)) {\
			lua_pushstring(L,"expected a table");\
			return 0;\
		}\
		*size=SWIG_itable_size(L,index);\
		if (*size<1){\
			lua_pushstring(L,"table appears to be empty");\
			return 0;\
		}\
		array=SWIG_ALLOC_ARRAY(TYPE,*size);\
		if (!SWIG_read_##NAME##_num_array(L,index,array,*size)){\
			lua_pushstring(L,"table must contain numbers");\
			SWIG_FREE_ARRAY(array);\
			return 0;\
		}\
		return array;\
	}\
	SWIGINTERN void SWIG_write_##NAME##_num_array(lua_State* L,TYPE *array,int size){\
		int i;\
		lua_newtable(L);\
		for (i = 0; i < size; i++){\
			lua_pushnumber(L,(lua_Number)array[i]);\
			lua_rawseti(L,-2,i+1);/* -1 is the number, -2 is the table*/ \
		}\
	}

SWIG_DECLARE_TYPEMAP_ARR_FN(schar,signed char);
SWIG_DECLARE_TYPEMAP_ARR_FN(uchar,unsigned char);
SWIG_DECLARE_TYPEMAP_ARR_FN(int,int);
SWIG_DECLARE_TYPEMAP_ARR_FN(uint,unsigned int);
SWIG_DECLARE_TYPEMAP_ARR_FN(short,short);
SWIG_DECLARE_TYPEMAP_ARR_FN(ushort,unsigned short);
SWIG_DECLARE_TYPEMAP_ARR_FN(long,long);
SWIG_DECLARE_TYPEMAP_ARR_FN(ulong,unsigned long);
SWIG_DECLARE_TYPEMAP_ARR_FN(float,float);
SWIG_DECLARE_TYPEMAP_ARR_FN(double,double);

SWIGINTERN int SWIG_read_ptr_array(lua_State* L,int index,void **array,int size,swig_type_info *type){
	int i;
	for (i = 0; i < size; i++) {
		lua_rawgeti(L,index,i+1);
		if (!lua_isuserdata(L,-1) || SWIG_ConvertPtr(L,-1,&array[i],type,0)==-1){
			lua_pop(L,1);
			return 0;
		}
		lua_pop(L,1);
	}
	return 1;
}
SWIGINTERN void** SWIG_get_ptr_array_fixed(lua_State* L, int index, int size,swig_type_info *type){
	void **array;
	if (!lua_istable(L,index) || SWIG_itable_size(L,index) != size) {
		lua_pushfstring(L,"expected a table of size %d",size);
		return 0;
	}
	array=SWIG_ALLOC_ARRAY(void*,size);
	if (!SWIG_read_ptr_array(L,index,array,size,type)){
		lua_pushfstring(L,"table must contain pointers of type %s",type->name);
		SWIG_FREE_ARRAY(array);
		return 0;
	}
	return array;
}
SWIGINTERN void** SWIG_get_ptr_array_var(lua_State* L, int index, int* size,swig_type_info *type){
	void **array;
	if (!lua_istable(L,index)) {
		lua_pushstring(L,"expected a table");
		return 0;
	}
	*size=SWIG_itable_size(L,index);
	if (*size<1){
		lua_pushstring(L,"table appears to be empty");
		return 0;
	}
	array=SWIG_ALLOC_ARRAY(void*,*size);
	if (!SWIG_read_ptr_array(L,index,array,*size,type)){
		lua_pushfstring(L,"table must contain pointers of type %s",type->name);
		SWIG_FREE_ARRAY(array);
		return 0;
	}
	return array;
}
SWIGINTERN void SWIG_write_ptr_array(lua_State* L,void **array,int size,swig_type_info *type,int own){
	int i;
	lua_newtable(L);
	for (i = 0; i < size; i++){
		SWIG_NewPointerObj(L,array[i],type,own);
		lua_rawseti(L,-2,i+1);/* -1 is the number, -2 is the table*/
	}
}


#if LUA_VERSION_NUM-0 >= 502
// luaL_typerror was removed in Lua 5.2.
int luaL_typerror (lua_State *L, int narg, const char *tname) {
  const char *msg = lua_pushfstring(L, "%s expected, got %s",
                                    tname, luaL_typename(L, narg));
  return luaL_argerror(L, narg, msg);
}
#endif

// Define lua_rawlen for Lua 5.1 (Lua 5.2 already has it).
//
// Newer SWIG already does this, hence the check for !defined lua_rawlen.
#if !defined lua_rawlen && LUA_VERSION_NUM == 501
# define lua_rawlen lua_objlen
#endif

// LUA_RIDX_GLOBALS is new in Lua 5.2.
#ifdef LUA_RIDX_GLOBALS
# ifndef LUA_GLOBALSINDEX
#  define LUA_GLOBALSINDEX (-10002)
# endif
#define lua_pushvalue(L,P) do { if ((P) == LUA_GLOBALSINDEX) { lua_rawgeti(L, LUA_REGISTRYINDEX, LUA_RIDX_GLOBALS); } else { lua_pushvalue(L,P); } } while (0)
#endif


class luaExpandDecider : public Xapian::ExpandDecider {
	int r;
	lua_State* L;

	public:
		luaExpandDecider(lua_State* S) {
			L = S;
			if (!lua_isfunction(L, -1)) {
				luaL_typerror(L, -1, "function");
			}
			r = luaL_ref(L, LUA_REGISTRYINDEX);
		}

		~luaExpandDecider() {
			luaL_unref(L, LUA_REGISTRYINDEX, r);
		}

		bool operator()(const std::string &term) const {
			lua_rawgeti(L, LUA_REGISTRYINDEX, r);
			if (!lua_isfunction(L, -1)) {
				luaL_typerror(L, -1, "function");
			}

			lua_pushlstring(L, (char *)term.c_str(), term.length());
			if (lua_pcall(L, 1, 1, 0) != 0){
				luaL_error(L, "error running function: %s", lua_tostring(L, -1));
			}
			if (!lua_isboolean(L, -1)) {
				luaL_error(L, "function must return a boolean");
			}
			bool result = lua_toboolean(L, -1);
			lua_pop(L, 1);
			return result;
		}
};


class luaStopper : public Xapian::Stopper {
	int r;
	lua_State* L;

	public:
		luaStopper(lua_State* S) {
			L = S;
			if (!lua_isfunction(L, -1)) {
				luaL_typerror(L, -1, "function");
			}
			r = luaL_ref(L, LUA_REGISTRYINDEX);
		}

		~luaStopper() {
			luaL_unref(L, LUA_REGISTRYINDEX, r);
		}

		bool operator()(const std::string &term) const {
			lua_rawgeti(L, LUA_REGISTRYINDEX, r);
			if (!lua_isfunction(L, -1)) {
				luaL_typerror(L, -1, "function");
			}

			lua_pushlstring(L, (char *)term.c_str(), term.length());
			if (lua_pcall(L, 1, 1, 0) != 0){
				luaL_error(L, "error running function: %s", lua_tostring(L, -1));
			}
			if (!lua_isboolean(L, -1)) {
				luaL_error(L, "function must return a boolean");
			}
			bool result = lua_toboolean(L, -1);
			lua_pop(L, 1);
			return result;
		}
};


class luaMatchDecider : public Xapian::MatchDecider {
	int r;
	lua_State* L;

	public:
		luaMatchDecider(lua_State* S) {
			L = S;
			if (!lua_isfunction(L, -1)) {
				luaL_typerror(L, -1, "function");
			}
			r = luaL_ref(L, LUA_REGISTRYINDEX);
		}

		~luaMatchDecider() {
			luaL_unref(L, LUA_REGISTRYINDEX, r);
		}

		bool operator()(const Xapian::Document &doc) const {
			lua_rawgeti(L, LUA_REGISTRYINDEX, r);
			if (!lua_isfunction(L, -1)) {
				luaL_typerror(L, -1, "function");
			}

			SWIG_NewPointerObj(L, &doc, SWIGTYPE_p_Xapian__Document, 0);
			if (lua_pcall(L, 1, 1, 0) != 0){
				luaL_error(L, "error running function: %s", lua_tostring(L, -1));
			}
			if (!lua_isboolean(L, -1)) {
				luaL_error(L, "function must return a boolean");
			}
			bool result = lua_toboolean(L, -1);
			lua_pop(L, 1);
			return result;
		}
};


class luaStemImplementation : public Xapian::StemImplementation {
	int r;
	lua_State* L;

	public:
		luaStemImplementation(lua_State* S) {
			L = S;
			if (!lua_isfunction(L, -1)) {
				luaL_typerror(L, -1, "function");
			}
			r = luaL_ref(L, LUA_REGISTRYINDEX);
		}

		~luaStemImplementation() {
			luaL_unref(L, LUA_REGISTRYINDEX, r);
		}

		std::string operator()(const std::string &word) {
			lua_rawgeti(L, LUA_REGISTRYINDEX, r);
			if (!lua_isfunction(L, -1)) {
				luaL_typerror(L, -1, "function");
			}

			lua_pushlstring(L, (char *)word.c_str(), word.length());
			if (lua_pcall(L, 1, 1, 0) != 0){
				luaL_error(L, "error running function: %s", lua_tostring(L, -1));
			}
			if (!lua_isstring(L, -1)) {
				luaL_error(L, "function must return a string");
			}
			size_t len;
			const char * p = lua_tolstring(L, -1, &len);
			std::string result(p, len);
			lua_pop(L, 1);
			return result;
		}
		std::string get_description() const {
			lua_rawgeti(L, LUA_REGISTRYINDEX, r);
			if (!lua_isfunction(L, -1)) {
				luaL_typerror(L, -1, "function");
			}

			if (lua_pcall(L, 0, 1, 0) != 0){
				luaL_error(L, "error running function: %s", lua_tostring(L, -1));
			}
			if (!lua_isstring(L, -1)) {
				luaL_error(L, "function must return a string");
			}

			size_t len;
			const char * p = lua_tolstring(L, -1, &len);
			std::string result(p, len);
			lua_pop(L, 1);
			return result;
		}
};


class luaKeyMaker : public Xapian::KeyMaker {
	int r;
	lua_State* L;

	public:
		luaKeyMaker(lua_State* S) {
			L = S;
			if (!lua_isfunction(L, -1)) {
				luaL_typerror(L, -1, "function");
			}
			r = luaL_ref(L, LUA_REGISTRYINDEX);
		}

		~luaKeyMaker() {
			luaL_unref(L, LUA_REGISTRYINDEX, r);
		}

		std::string operator()(const Xapian::Document &doc) const {
			lua_rawgeti(L, LUA_REGISTRYINDEX, r);
			if (!lua_isfunction(L, -1)) {
				luaL_typerror(L, -1, "function");
			}

			SWIG_NewPointerObj(L, &doc, SWIGTYPE_p_Xapian__Document, 0);
			if (lua_pcall(L, 1, 1, 0) != 0){
				luaL_error(L, "error running function: %s", lua_tostring(L, -1));
			}
			if (!lua_isstring(L, -1)) {
				luaL_error(L, "function must return a string");
			}
			size_t len;
			const char * p = lua_tolstring(L, -1, &len);
			std::string result(p, len);
			lua_pop(L, 1);
			return result;
		}
};


class luaValueRangeProcessor : public Xapian::ValueRangeProcessor {
	int r;
	lua_State* L;

	public:
		luaValueRangeProcessor(lua_State* S) {
			L = S;
			if (!lua_isfunction(L, -1)) {
				luaL_typerror(L, -1, "function");
			}
			r = luaL_ref(L, LUA_REGISTRYINDEX);
		}

		~luaValueRangeProcessor() {
			luaL_unref(L, LUA_REGISTRYINDEX, r);
		}

		Xapian::valueno operator()(std::string &begin, std::string &end) {
			lua_rawgeti(L, LUA_REGISTRYINDEX, r);
			if (!lua_isfunction(L, -1)) {
				luaL_typerror(L, -1, "function");
			}

			lua_pushlstring(L, (char *)begin.c_str(), begin.length());
			lua_pushlstring(L, (char *)end.c_str(), end.length());

			if (lua_pcall(L, 2, 1, 0) != 0){
				luaL_error(L, "error running function: %s", lua_tostring(L, -1));
			}
			if (!lua_isnumber(L, -1)) {
				luaL_error(L, "function must return a nubmer");
			}
			Xapian::valueno result(lua_tonumber(L, -1));
			lua_pop(L, 1);
			return result;
		}
};


class luaMatchSpy : public Xapian::MatchSpy {
	int r;
	lua_State* L;

	public:
		luaMatchSpy(lua_State* S) {
			L = S;
			if (!lua_isfunction(L, -1)) {
				luaL_typerror(L, -1, "function");
			}
			r = luaL_ref(L, LUA_REGISTRYINDEX);
		}

		~luaMatchSpy() {
			luaL_unref(L, LUA_REGISTRYINDEX, r);
		}

		void operator()(const Xapian::Document &doc, Xapian::weight wt) {
			lua_rawgeti(L, LUA_REGISTRYINDEX, r);
			if (!lua_isfunction(L, -1)) {
				luaL_typerror(L, -1, "function");
			}

			SWIG_NewPointerObj(L, &doc, SWIGTYPE_p_Xapian__Document, 0);
			SWIG_NewPointerObj(L, &wt, SWIGTYPE_p_Xapian__Weight, 0);
			if (lua_pcall(L, 2, 1, 0) != 0){
				luaL_error(L, "error running function: %s", lua_tostring(L, -1));
			}
			return;
		}
};


namespace Xapian {
void handle_exception(lua_State* L) {
    try {
	throw;
    } catch (const Xapian::RangeError &e) {
	SWIG_NewPointerObj(L, (void *)new RangeError(e), SWIGTYPE_p_Xapian__RangeError, 1);
    } catch (const Xapian::SerialisationError &e) {
	SWIG_NewPointerObj(L, (void *)new SerialisationError(e), SWIGTYPE_p_Xapian__SerialisationError, 1);
    } catch (const Xapian::QueryParserError &e) {
	SWIG_NewPointerObj(L, (void *)new QueryParserError(e), SWIGTYPE_p_Xapian__QueryParserError, 1);
    } catch (const Xapian::NetworkTimeoutError &e) {
	SWIG_NewPointerObj(L, (void *)new NetworkTimeoutError(e), SWIGTYPE_p_Xapian__NetworkTimeoutError, 1);
    } catch (const Xapian::NetworkError &e) {
	SWIG_NewPointerObj(L, (void *)new NetworkError(e), SWIGTYPE_p_Xapian__NetworkError, 1);
    } catch (const Xapian::InternalError &e) {
	SWIG_NewPointerObj(L, (void *)new InternalError(e), SWIGTYPE_p_Xapian__InternalError, 1);
    } catch (const Xapian::FeatureUnavailableError &e) {
	SWIG_NewPointerObj(L, (void *)new FeatureUnavailableError(e), SWIGTYPE_p_Xapian__FeatureUnavailableError, 1);
    } catch (const Xapian::DocNotFoundError &e) {
	SWIG_NewPointerObj(L, (void *)new DocNotFoundError(e), SWIGTYPE_p_Xapian__DocNotFoundError, 1);
    } catch (const Xapian::DatabaseVersionError &e) {
	SWIG_NewPointerObj(L, (void *)new DatabaseVersionError(e), SWIGTYPE_p_Xapian__DatabaseVersionError, 1);
    } catch (const Xapian::DatabaseOpeningError &e) {
	SWIG_NewPointerObj(L, (void *)new DatabaseOpeningError(e), SWIGTYPE_p_Xapian__DatabaseOpeningError, 1);
    } catch (const Xapian::DatabaseModifiedError &e) {
	SWIG_NewPointerObj(L, (void *)new DatabaseModifiedError(e), SWIGTYPE_p_Xapian__DatabaseModifiedError, 1);
    } catch (const Xapian::DatabaseLockError &e) {
	SWIG_NewPointerObj(L, (void *)new DatabaseLockError(e), SWIGTYPE_p_Xapian__DatabaseLockError, 1);
    } catch (const Xapian::DatabaseCreateError &e) {
	SWIG_NewPointerObj(L, (void *)new DatabaseCreateError(e), SWIGTYPE_p_Xapian__DatabaseCreateError, 1);
    } catch (const Xapian::DatabaseCorruptError &e) {
	SWIG_NewPointerObj(L, (void *)new DatabaseCorruptError(e), SWIGTYPE_p_Xapian__DatabaseCorruptError, 1);
    } catch (const Xapian::DatabaseError &e) {
	SWIG_NewPointerObj(L, (void *)new DatabaseError(e), SWIGTYPE_p_Xapian__DatabaseError, 1);
    } catch (const Xapian::UnimplementedError &e) {
	SWIG_NewPointerObj(L, (void *)new UnimplementedError(e), SWIGTYPE_p_Xapian__UnimplementedError, 1);
    } catch (const Xapian::InvalidOperationError &e) {
	SWIG_NewPointerObj(L, (void *)new InvalidOperationError(e), SWIGTYPE_p_Xapian__InvalidOperationError, 1);
    } catch (const Xapian::InvalidArgumentError &e) {
	SWIG_NewPointerObj(L, (void *)new InvalidArgumentError(e), SWIGTYPE_p_Xapian__InvalidArgumentError, 1);
    } catch (const Xapian::AssertionError &e) {
	SWIG_NewPointerObj(L, (void *)new AssertionError(e), SWIGTYPE_p_Xapian__AssertionError, 1);
    } catch (const Xapian::RuntimeError &e) {
	SWIG_NewPointerObj(L, (void *)new RuntimeError(e), SWIGTYPE_p_Xapian__RuntimeError, 1);
    } catch (const Xapian::LogicError &e) {
	SWIG_NewPointerObj(L, (void *)new LogicError(e), SWIGTYPE_p_Xapian__LogicError, 1);
    } catch (const std::exception& e) {
	lua_pushfstring(L, "std::exception: %s", e.what());
    } catch (...) {
	lua_pushstring(L, "Unknown exception");
    }
}
}

SWIGINTERN Xapian::termpos Xapian_PositionIterator_get_termpos(Xapian::PositionIterator const *self){
	    return *(*self);
	}
SWIGINTERN void Xapian_PositionIterator_next(Xapian::PositionIterator *self){ ++(*self); }
SWIGINTERN bool Xapian_PositionIterator_equals(Xapian::PositionIterator const *self,Xapian::PositionIterator const &other){
	    return (*self) == other;
	}
SWIGINTERN Xapian::docid Xapian_PostingIterator_get_docid(Xapian::PostingIterator const *self){
	return *(*self);
    }
SWIGINTERN void Xapian_PostingIterator_next(Xapian::PostingIterator *self){ ++(*self); }
SWIGINTERN bool Xapian_PostingIterator_equals(Xapian::PostingIterator const *self,Xapian::PostingIterator const &other){
	return (*self) == other;
    }
SWIGINTERN std::string Xapian_TermIterator_get_term(Xapian::TermIterator const *self){
	    return *(*self);
	}
SWIGINTERN void Xapian_TermIterator_next(Xapian::TermIterator *self){ ++(*self); }
SWIGINTERN bool Xapian_TermIterator_equals(Xapian::TermIterator const *self,Xapian::TermIterator const &other){
	    return (*self) == other;
	}
SWIGINTERN std::string Xapian_ValueIterator_get_value(Xapian::ValueIterator const *self){
	    return *(*self);
	}
SWIGINTERN void Xapian_ValueIterator_next(Xapian::ValueIterator *self){ ++(*self); }
SWIGINTERN bool Xapian_ValueIterator_equals(Xapian::ValueIterator const *self,Xapian::ValueIterator const &other){
	    return (*self) == other;
	}
SWIGINTERN std::pair< Xapian::TermIterator,Xapian::TermIterator > Xapian_Document_termlist(Xapian::Document *self){
		return std::make_pair(self->termlist_begin(), self->termlist_end());
	}
SWIGINTERN std::pair< Xapian::ValueIterator,Xapian::ValueIterator > Xapian_Document_values(Xapian::Document *self){
		return std::make_pair(self->values_begin(), self->values_end());
	}
SWIGINTERN Xapian::MSetIterator Xapian_MSet_get_hit(Xapian::MSet const *self,Xapian::doccount i){
	    return ((*self)[i]);
	}
SWIGINTERN int Xapian_MSet_get_document_percentage(Xapian::MSet const *self,Xapian::doccount i){
	    return (*self).convert_to_percent( ((*self)[i]) );
	}
SWIGINTERN Xapian::Document const Xapian_MSet_get_document(Xapian::MSet const *self,Xapian::doccount i){
	    return ((*self)[i]).get_document();
	}
SWIGINTERN Xapian::docid Xapian_MSet_get_docid(Xapian::MSet const *self,Xapian::doccount i){
	    return *((*self)[i]);
	}
SWIGINTERN std::pair< Xapian::MSetIterator,Xapian::MSetIterator > Xapian_MSet_items(Xapian::MSet *self){
		return std::make_pair(self->begin(), self->end());
	}
SWIGINTERN Xapian::docid Xapian_MSetIterator_get_docid(Xapian::MSetIterator const *self){
	    return *(*self);
	}
SWIGINTERN void Xapian_MSetIterator_next(Xapian::MSetIterator *self){ ++(*self); }
SWIGINTERN void Xapian_MSetIterator_prev(Xapian::MSetIterator *self){ --(*self); }
SWIGINTERN bool Xapian_MSetIterator_equals(Xapian::MSetIterator const *self,Xapian::MSetIterator const &other){
	    return (*self) == other;
	}
SWIGINTERN std::pair< Xapian::ESetIterator,Xapian::ESetIterator > Xapian_ESet_terms(Xapian::ESet *self){
		return std::make_pair(self->begin(), self->end());
	}
SWIGINTERN std::string Xapian_ESetIterator_get_term(Xapian::ESetIterator const *self){
	    return *(*self);
	}
SWIGINTERN void Xapian_ESetIterator_next(Xapian::ESetIterator *self){ ++(*self); }
SWIGINTERN void Xapian_ESetIterator_prev(Xapian::ESetIterator *self){ --(*self); }
SWIGINTERN bool Xapian_ESetIterator_equals(Xapian::ESetIterator const *self,Xapian::ESetIterator const &other){
	    return (*self) == other;
	}
SWIGINTERN std::pair< Xapian::TermIterator,Xapian::TermIterator > Xapian_Enquire_get_matching_terms__SWIG_0(Xapian::Enquire *self,Xapian::docid did){
		return std::make_pair(self->get_matching_terms_begin(did), self->get_matching_terms_end(did));
	}
SWIGINTERN std::pair< Xapian::TermIterator,Xapian::TermIterator > Xapian_Enquire_get_matching_terms__SWIG_1(Xapian::Enquire *self,Xapian::MSetIterator const &it){
		return std::make_pair(self->get_matching_terms_begin(it), self->get_matching_terms_end(it));
	}
SWIGINTERN std::pair< Xapian::TermIterator,Xapian::TermIterator > Xapian_ValueCountMatchSpy_values(Xapian::ValueCountMatchSpy *self){
		return std::make_pair(self->values_begin(), self->values_end());
	}
SWIGINTERN std::pair< Xapian::TermIterator,Xapian::TermIterator > Xapian_ValueCountMatchSpy_top_values(Xapian::ValueCountMatchSpy *self,size_t maxvalues){
		return std::make_pair(self->top_values_begin(maxvalues), self->top_values_end(maxvalues));
	}
SWIGINTERN std::pair< Xapian::TermIterator,Xapian::TermIterator > Xapian_Database_allterms__SWIG_0(Xapian::Database *self){
		return std::make_pair(self->allterms_begin(), self->allterms_end());
	}
SWIGINTERN std::pair< Xapian::TermIterator,Xapian::TermIterator > Xapian_Database_spellings(Xapian::Database *self){
		return std::make_pair(self->spellings_begin(), self->spellings_end());
	}
SWIGINTERN std::pair< Xapian::PostingIterator,Xapian::PostingIterator > Xapian_Database_postlist(Xapian::Database *self,std::string const &tname){
		return std::make_pair(self->postlist_begin(tname), self->postlist_end(tname));
	}
SWIGINTERN std::pair< Xapian::TermIterator,Xapian::TermIterator > Xapian_Database_termlist(Xapian::Database *self,Xapian::docid did){
		return std::make_pair(self->termlist_begin(did), self->termlist_end(did));
	}
SWIGINTERN std::pair< Xapian::ValueIterator,Xapian::ValueIterator > Xapian_Database_valuestream(Xapian::Database *self,Xapian::valueno slot){
		return std::make_pair(self->valuestream_begin(slot), self->valuestream_end(slot));
	}
SWIGINTERN std::pair< Xapian::TermIterator,Xapian::TermIterator > Xapian_Database_allterms__SWIG_1(Xapian::Database *self,std::string const &prefix){
		return std::make_pair(self->allterms_begin(prefix), self->allterms_end(prefix));
	}
SWIGINTERN std::pair< Xapian::TermIterator,Xapian::TermIterator > Xapian_Database_synonyms(Xapian::Database *self,std::string const &term){
		return std::make_pair(self->synonyms_begin(term), self->synonyms_end(term));
	}
SWIGINTERN std::pair< Xapian::TermIterator,Xapian::TermIterator > Xapian_Database_synonym_keys(Xapian::Database *self,std::string const &prefix){
		return std::make_pair(self->synonym_keys_begin(prefix), self->synonym_keys_end(prefix));
	}
SWIGINTERN std::pair< Xapian::TermIterator,Xapian::TermIterator > Xapian_Database_metadata_keys(Xapian::Database *self,std::string const &prefix){
		return std::make_pair(self->metadata_keys_begin(prefix), self->metadata_keys_end(prefix));
	}
SWIGINTERN std::pair< Xapian::PositionIterator,Xapian::PositionIterator > Xapian_Database_positionlist(Xapian::Database *self,Xapian::docid did,std::string const &tname){
		return std::make_pair(self->positionlist_begin(did, tname), self->positionlist_end(did, tname));
	}
SWIGINTERN std::pair< Xapian::TermIterator,Xapian::TermIterator > Xapian_Query_get_terms(Xapian::Query *self){
		return std::make_pair(self->get_terms_begin(), self->get_terms_end());
	}
SWIGINTERN Xapian::Query *new_Xapian_Query__SWIG_13(Xapian::Query::op op,std::vector< Xapian::Query > const &subqs,Xapian::termcount param=0){
		return new Xapian::Query(op, subqs.begin(), subqs.end(), param);
	    }
SWIGINTERN std::pair< Xapian::TermIterator,Xapian::TermIterator > Xapian_QueryParser_stoplist(Xapian::QueryParser *self){
		return std::make_pair(self->stoplist_begin(), self->stoplist_end());
	}
#ifdef __cplusplus
extern "C" {
#endif
static int _wrap_new_string__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  std::string *result = 0 ;
  
  SWIG_check_num_args("std::string::string",0,0)
  result = (std::string *)new std::string();
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_std__string,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_string__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  char *arg1 = (char *) 0 ;
  std::string *result = 0 ;
  
  SWIG_check_num_args("std::string::string",1,1)
  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("std::string::string",1,"char const *");
  arg1 = (char *)lua_tostring(L, 1);
  result = (std::string *)new std::string((char const *)arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_std__string,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_string(lua_State* L) {
  int argc;
  int argv[2]={
    1,2
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_string__SWIG_0(L);
  }
  if (argc == 1) {
    int _v;
    {
      _v = SWIG_lua_isnilstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_string__SWIG_1(L);
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_string'\n"
    "  Possible C/C++ prototypes are:\n"
    "    std::string::string()\n"
    "    std::string::string(char const *)\n");
  lua_error(L);return 0;
}


static int _wrap_string_size(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = (std::string *) 0 ;
  unsigned int result;
  
  SWIG_check_num_args("std::string::size",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::size",1,"std::string const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){
    SWIG_fail_ptr("string_size",1,SWIGTYPE_p_std__string);
  }
  
  result = (unsigned int)((std::string const *)arg1)->size();
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_string_length(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = (std::string *) 0 ;
  unsigned int result;
  
  SWIG_check_num_args("std::string::length",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::length",1,"std::string const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){
    SWIG_fail_ptr("string_length",1,SWIGTYPE_p_std__string);
  }
  
  result = (unsigned int)((std::string const *)arg1)->length();
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_string_empty(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = (std::string *) 0 ;
  bool result;
  
  SWIG_check_num_args("std::string::empty",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::empty",1,"std::string const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){
    SWIG_fail_ptr("string_empty",1,SWIGTYPE_p_std__string);
  }
  
  result = (bool)((std::string const *)arg1)->empty();
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_string_c_str(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = (std::string *) 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("std::string::c_str",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::c_str",1,"std::string const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){
    SWIG_fail_ptr("string_c_str",1,SWIGTYPE_p_std__string);
  }
  
  result = (char *)((std::string const *)arg1)->c_str();
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_string_data(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = (std::string *) 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("std::string::data",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::data",1,"std::string const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){
    SWIG_fail_ptr("string_data",1,SWIGTYPE_p_std__string);
  }
  
  result = (char *)((std::string const *)arg1)->data();
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_string_assign(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = (std::string *) 0 ;
  char *arg2 = (char *) 0 ;
  
  SWIG_check_num_args("std::string::assign",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::assign",1,"std::string *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("std::string::assign",2,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){
    SWIG_fail_ptr("string_assign",1,SWIGTYPE_p_std__string);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  (arg1)->assign((char const *)arg2);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_string(void *obj) {
std::string *arg1 = (std::string *) obj;
delete arg1;
}
static swig_lua_method swig_std_string_methods[] = {
    {"size", _wrap_string_size}, 
    {"length", _wrap_string_length}, 
    {"empty", _wrap_string_empty}, 
    {"c_str", _wrap_string_c_str}, 
    {"data", _wrap_string_data}, 
    {"assign", _wrap_string_assign}, 
    {0,0}
};
static swig_lua_attribute swig_std_string_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_std_string_bases[] = {0};
static const char *swig_std_string_base_names[] = {0};
static swig_lua_class _wrap_class_std_string = { "string", &SWIGTYPE_p_std__string,_wrap_new_string, swig_delete_string, swig_std_string_methods, swig_std_string_attributes, swig_std_string_bases, swig_std_string_base_names };

static int _wrap_Error_get_type(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Error *arg1 = (Xapian::Error *) 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Xapian::Error::get_type",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Error::get_type",1,"Xapian::Error const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Error,0))){
    SWIG_fail_ptr("Error_get_type",1,SWIGTYPE_p_Xapian__Error);
  }
  
  result = (char *)((Xapian::Error const *)arg1)->get_type();
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Error_get_msg(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Error *arg1 = (Xapian::Error *) 0 ;
  std::string *result = 0 ;
  
  SWIG_check_num_args("Xapian::Error::get_msg",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Error::get_msg",1,"Xapian::Error const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Error,0))){
    SWIG_fail_ptr("Error_get_msg",1,SWIGTYPE_p_Xapian__Error);
  }
  
  result = (std::string *) &((Xapian::Error const *)arg1)->get_msg();
  lua_pushlstring(L,result->data(),result->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Error_get_context(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Error *arg1 = (Xapian::Error *) 0 ;
  std::string *result = 0 ;
  
  SWIG_check_num_args("Xapian::Error::get_context",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Error::get_context",1,"Xapian::Error const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Error,0))){
    SWIG_fail_ptr("Error_get_context",1,SWIGTYPE_p_Xapian__Error);
  }
  
  result = (std::string *) &((Xapian::Error const *)arg1)->get_context();
  lua_pushlstring(L,result->data(),result->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Error_get_error_string(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Error *arg1 = (Xapian::Error *) 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Xapian::Error::get_error_string",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Error::get_error_string",1,"Xapian::Error const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Error,0))){
    SWIG_fail_ptr("Error_get_error_string",1,SWIGTYPE_p_Xapian__Error);
  }
  
  result = (char *)((Xapian::Error const *)arg1)->get_error_string();
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Error___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Error *arg1 = (Xapian::Error *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::Error::get_description",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Error::get_description",1,"Xapian::Error const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Error,0))){
    SWIG_fail_ptr("Error___tostring",1,SWIGTYPE_p_Xapian__Error);
  }
  
  result = ((Xapian::Error const *)arg1)->get_description();
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_Error(void *obj) {
Xapian::Error *arg1 = (Xapian::Error *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_Error_methods[] = {
    {"get_type", _wrap_Error_get_type}, 
    {"get_msg", _wrap_Error_get_msg}, 
    {"get_context", _wrap_Error_get_context}, 
    {"get_error_string", _wrap_Error_get_error_string}, 
    {"__tostring", _wrap_Error___tostring}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_Error_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_Error_bases[] = {0};
static const char *swig_Xapian_Error_base_names[] = {0};
static swig_lua_class _wrap_class_Xapian_Error = { "Error", &SWIGTYPE_p_Xapian__Error,0, swig_delete_Error, swig_Xapian_Error_methods, swig_Xapian_Error_attributes, swig_Xapian_Error_bases, swig_Xapian_Error_base_names };

static void swig_delete_LogicError(void *obj) {
Xapian::LogicError *arg1 = (Xapian::LogicError *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_LogicError_methods[] = {
    {0,0}
};
static swig_lua_attribute swig_Xapian_LogicError_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_LogicError_bases[] = {0,0};
static const char *swig_Xapian_LogicError_base_names[] = {"Xapian::Error *",0};
static swig_lua_class _wrap_class_Xapian_LogicError = { "LogicError", &SWIGTYPE_p_Xapian__LogicError,0, swig_delete_LogicError, swig_Xapian_LogicError_methods, swig_Xapian_LogicError_attributes, swig_Xapian_LogicError_bases, swig_Xapian_LogicError_base_names };

static void swig_delete_RuntimeError(void *obj) {
Xapian::RuntimeError *arg1 = (Xapian::RuntimeError *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_RuntimeError_methods[] = {
    {0,0}
};
static swig_lua_attribute swig_Xapian_RuntimeError_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_RuntimeError_bases[] = {0,0};
static const char *swig_Xapian_RuntimeError_base_names[] = {"Xapian::Error *",0};
static swig_lua_class _wrap_class_Xapian_RuntimeError = { "RuntimeError", &SWIGTYPE_p_Xapian__RuntimeError,0, swig_delete_RuntimeError, swig_Xapian_RuntimeError_methods, swig_Xapian_RuntimeError_attributes, swig_Xapian_RuntimeError_bases, swig_Xapian_RuntimeError_base_names };

static int _wrap_new_AssertionError__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  char *arg3 = (char *) 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::AssertionError *result = 0 ;
  
  SWIG_check_num_args("Xapian::AssertionError::AssertionError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::AssertionError::AssertionError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::AssertionError::AssertionError",2,"std::string const &");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("Xapian::AssertionError::AssertionError",3,"char const *");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (char *)lua_tostring(L, 3);
  result = (Xapian::AssertionError *)new Xapian::AssertionError((std::string const &)*arg1,(std::string const &)*arg2,(char const *)arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__AssertionError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_AssertionError__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  int arg3 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::AssertionError *result = 0 ;
  
  SWIG_check_num_args("Xapian::AssertionError::AssertionError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::AssertionError::AssertionError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::AssertionError::AssertionError",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::AssertionError::AssertionError",3,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (int)lua_tonumber(L, 3);
  result = (Xapian::AssertionError *)new Xapian::AssertionError((std::string const &)*arg1,(std::string const &)*arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__AssertionError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_AssertionError__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::AssertionError *result = 0 ;
  
  SWIG_check_num_args("Xapian::AssertionError::AssertionError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::AssertionError::AssertionError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::AssertionError::AssertionError",2,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  result = (Xapian::AssertionError *)new Xapian::AssertionError((std::string const &)*arg1,(std::string const &)*arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__AssertionError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_AssertionError__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string temp1 ;
  Xapian::AssertionError *result = 0 ;
  
  SWIG_check_num_args("Xapian::AssertionError::AssertionError",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::AssertionError::AssertionError",1,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  result = (Xapian::AssertionError *)new Xapian::AssertionError((std::string const &)*arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__AssertionError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_AssertionError__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  int arg2 ;
  std::string temp1 ;
  Xapian::AssertionError *result = 0 ;
  
  SWIG_check_num_args("Xapian::AssertionError::AssertionError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::AssertionError::AssertionError",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::AssertionError::AssertionError",2,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  arg2 = (int)lua_tonumber(L, 2);
  result = (Xapian::AssertionError *)new Xapian::AssertionError((std::string const &)*arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__AssertionError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_AssertionError(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_AssertionError__SWIG_3(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_AssertionError__SWIG_4(L);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_AssertionError__SWIG_2(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_AssertionError__SWIG_1(L);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = SWIG_lua_isnilstring(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_AssertionError__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_AssertionError'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::AssertionError::AssertionError(std::string const &,std::string const &,char const *)\n"
    "    Xapian::AssertionError::AssertionError(std::string const &,std::string const &,int)\n"
    "    Xapian::AssertionError::AssertionError(std::string const &,std::string const &)\n"
    "    Xapian::AssertionError::AssertionError(std::string const &)\n"
    "    Xapian::AssertionError::AssertionError(std::string const &,int)\n");
  lua_error(L);return 0;
}


static void swig_delete_AssertionError(void *obj) {
Xapian::AssertionError *arg1 = (Xapian::AssertionError *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_AssertionError_methods[] = {
    {0,0}
};
static swig_lua_attribute swig_Xapian_AssertionError_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_AssertionError_bases[] = {0,0};
static const char *swig_Xapian_AssertionError_base_names[] = {"Xapian::LogicError *",0};
static swig_lua_class _wrap_class_Xapian_AssertionError = { "AssertionError", &SWIGTYPE_p_Xapian__AssertionError,_wrap_new_AssertionError, swig_delete_AssertionError, swig_Xapian_AssertionError_methods, swig_Xapian_AssertionError_attributes, swig_Xapian_AssertionError_bases, swig_Xapian_AssertionError_base_names };

static int _wrap_new_InvalidArgumentError__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  char *arg3 = (char *) 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::InvalidArgumentError *result = 0 ;
  
  SWIG_check_num_args("Xapian::InvalidArgumentError::InvalidArgumentError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::InvalidArgumentError::InvalidArgumentError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::InvalidArgumentError::InvalidArgumentError",2,"std::string const &");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("Xapian::InvalidArgumentError::InvalidArgumentError",3,"char const *");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (char *)lua_tostring(L, 3);
  result = (Xapian::InvalidArgumentError *)new Xapian::InvalidArgumentError((std::string const &)*arg1,(std::string const &)*arg2,(char const *)arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__InvalidArgumentError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_InvalidArgumentError__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  int arg3 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::InvalidArgumentError *result = 0 ;
  
  SWIG_check_num_args("Xapian::InvalidArgumentError::InvalidArgumentError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::InvalidArgumentError::InvalidArgumentError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::InvalidArgumentError::InvalidArgumentError",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::InvalidArgumentError::InvalidArgumentError",3,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (int)lua_tonumber(L, 3);
  result = (Xapian::InvalidArgumentError *)new Xapian::InvalidArgumentError((std::string const &)*arg1,(std::string const &)*arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__InvalidArgumentError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_InvalidArgumentError__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::InvalidArgumentError *result = 0 ;
  
  SWIG_check_num_args("Xapian::InvalidArgumentError::InvalidArgumentError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::InvalidArgumentError::InvalidArgumentError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::InvalidArgumentError::InvalidArgumentError",2,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  result = (Xapian::InvalidArgumentError *)new Xapian::InvalidArgumentError((std::string const &)*arg1,(std::string const &)*arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__InvalidArgumentError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_InvalidArgumentError__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string temp1 ;
  Xapian::InvalidArgumentError *result = 0 ;
  
  SWIG_check_num_args("Xapian::InvalidArgumentError::InvalidArgumentError",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::InvalidArgumentError::InvalidArgumentError",1,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  result = (Xapian::InvalidArgumentError *)new Xapian::InvalidArgumentError((std::string const &)*arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__InvalidArgumentError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_InvalidArgumentError__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  int arg2 ;
  std::string temp1 ;
  Xapian::InvalidArgumentError *result = 0 ;
  
  SWIG_check_num_args("Xapian::InvalidArgumentError::InvalidArgumentError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::InvalidArgumentError::InvalidArgumentError",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::InvalidArgumentError::InvalidArgumentError",2,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  arg2 = (int)lua_tonumber(L, 2);
  result = (Xapian::InvalidArgumentError *)new Xapian::InvalidArgumentError((std::string const &)*arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__InvalidArgumentError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_InvalidArgumentError(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_InvalidArgumentError__SWIG_3(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_InvalidArgumentError__SWIG_4(L);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_InvalidArgumentError__SWIG_2(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_InvalidArgumentError__SWIG_1(L);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = SWIG_lua_isnilstring(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_InvalidArgumentError__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_InvalidArgumentError'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::InvalidArgumentError::InvalidArgumentError(std::string const &,std::string const &,char const *)\n"
    "    Xapian::InvalidArgumentError::InvalidArgumentError(std::string const &,std::string const &,int)\n"
    "    Xapian::InvalidArgumentError::InvalidArgumentError(std::string const &,std::string const &)\n"
    "    Xapian::InvalidArgumentError::InvalidArgumentError(std::string const &)\n"
    "    Xapian::InvalidArgumentError::InvalidArgumentError(std::string const &,int)\n");
  lua_error(L);return 0;
}


static void swig_delete_InvalidArgumentError(void *obj) {
Xapian::InvalidArgumentError *arg1 = (Xapian::InvalidArgumentError *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_InvalidArgumentError_methods[] = {
    {0,0}
};
static swig_lua_attribute swig_Xapian_InvalidArgumentError_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_InvalidArgumentError_bases[] = {0,0};
static const char *swig_Xapian_InvalidArgumentError_base_names[] = {"Xapian::LogicError *",0};
static swig_lua_class _wrap_class_Xapian_InvalidArgumentError = { "InvalidArgumentError", &SWIGTYPE_p_Xapian__InvalidArgumentError,_wrap_new_InvalidArgumentError, swig_delete_InvalidArgumentError, swig_Xapian_InvalidArgumentError_methods, swig_Xapian_InvalidArgumentError_attributes, swig_Xapian_InvalidArgumentError_bases, swig_Xapian_InvalidArgumentError_base_names };

static int _wrap_new_InvalidOperationError__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  char *arg3 = (char *) 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::InvalidOperationError *result = 0 ;
  
  SWIG_check_num_args("Xapian::InvalidOperationError::InvalidOperationError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::InvalidOperationError::InvalidOperationError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::InvalidOperationError::InvalidOperationError",2,"std::string const &");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("Xapian::InvalidOperationError::InvalidOperationError",3,"char const *");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (char *)lua_tostring(L, 3);
  result = (Xapian::InvalidOperationError *)new Xapian::InvalidOperationError((std::string const &)*arg1,(std::string const &)*arg2,(char const *)arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__InvalidOperationError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_InvalidOperationError__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  int arg3 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::InvalidOperationError *result = 0 ;
  
  SWIG_check_num_args("Xapian::InvalidOperationError::InvalidOperationError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::InvalidOperationError::InvalidOperationError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::InvalidOperationError::InvalidOperationError",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::InvalidOperationError::InvalidOperationError",3,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (int)lua_tonumber(L, 3);
  result = (Xapian::InvalidOperationError *)new Xapian::InvalidOperationError((std::string const &)*arg1,(std::string const &)*arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__InvalidOperationError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_InvalidOperationError__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::InvalidOperationError *result = 0 ;
  
  SWIG_check_num_args("Xapian::InvalidOperationError::InvalidOperationError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::InvalidOperationError::InvalidOperationError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::InvalidOperationError::InvalidOperationError",2,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  result = (Xapian::InvalidOperationError *)new Xapian::InvalidOperationError((std::string const &)*arg1,(std::string const &)*arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__InvalidOperationError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_InvalidOperationError__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string temp1 ;
  Xapian::InvalidOperationError *result = 0 ;
  
  SWIG_check_num_args("Xapian::InvalidOperationError::InvalidOperationError",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::InvalidOperationError::InvalidOperationError",1,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  result = (Xapian::InvalidOperationError *)new Xapian::InvalidOperationError((std::string const &)*arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__InvalidOperationError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_InvalidOperationError__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  int arg2 ;
  std::string temp1 ;
  Xapian::InvalidOperationError *result = 0 ;
  
  SWIG_check_num_args("Xapian::InvalidOperationError::InvalidOperationError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::InvalidOperationError::InvalidOperationError",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::InvalidOperationError::InvalidOperationError",2,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  arg2 = (int)lua_tonumber(L, 2);
  result = (Xapian::InvalidOperationError *)new Xapian::InvalidOperationError((std::string const &)*arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__InvalidOperationError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_InvalidOperationError(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_InvalidOperationError__SWIG_3(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_InvalidOperationError__SWIG_4(L);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_InvalidOperationError__SWIG_2(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_InvalidOperationError__SWIG_1(L);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = SWIG_lua_isnilstring(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_InvalidOperationError__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_InvalidOperationError'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::InvalidOperationError::InvalidOperationError(std::string const &,std::string const &,char const *)\n"
    "    Xapian::InvalidOperationError::InvalidOperationError(std::string const &,std::string const &,int)\n"
    "    Xapian::InvalidOperationError::InvalidOperationError(std::string const &,std::string const &)\n"
    "    Xapian::InvalidOperationError::InvalidOperationError(std::string const &)\n"
    "    Xapian::InvalidOperationError::InvalidOperationError(std::string const &,int)\n");
  lua_error(L);return 0;
}


static void swig_delete_InvalidOperationError(void *obj) {
Xapian::InvalidOperationError *arg1 = (Xapian::InvalidOperationError *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_InvalidOperationError_methods[] = {
    {0,0}
};
static swig_lua_attribute swig_Xapian_InvalidOperationError_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_InvalidOperationError_bases[] = {0,0};
static const char *swig_Xapian_InvalidOperationError_base_names[] = {"Xapian::LogicError *",0};
static swig_lua_class _wrap_class_Xapian_InvalidOperationError = { "InvalidOperationError", &SWIGTYPE_p_Xapian__InvalidOperationError,_wrap_new_InvalidOperationError, swig_delete_InvalidOperationError, swig_Xapian_InvalidOperationError_methods, swig_Xapian_InvalidOperationError_attributes, swig_Xapian_InvalidOperationError_bases, swig_Xapian_InvalidOperationError_base_names };

static int _wrap_new_UnimplementedError__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  char *arg3 = (char *) 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::UnimplementedError *result = 0 ;
  
  SWIG_check_num_args("Xapian::UnimplementedError::UnimplementedError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::UnimplementedError::UnimplementedError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::UnimplementedError::UnimplementedError",2,"std::string const &");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("Xapian::UnimplementedError::UnimplementedError",3,"char const *");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (char *)lua_tostring(L, 3);
  result = (Xapian::UnimplementedError *)new Xapian::UnimplementedError((std::string const &)*arg1,(std::string const &)*arg2,(char const *)arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__UnimplementedError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_UnimplementedError__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  int arg3 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::UnimplementedError *result = 0 ;
  
  SWIG_check_num_args("Xapian::UnimplementedError::UnimplementedError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::UnimplementedError::UnimplementedError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::UnimplementedError::UnimplementedError",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::UnimplementedError::UnimplementedError",3,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (int)lua_tonumber(L, 3);
  result = (Xapian::UnimplementedError *)new Xapian::UnimplementedError((std::string const &)*arg1,(std::string const &)*arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__UnimplementedError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_UnimplementedError__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::UnimplementedError *result = 0 ;
  
  SWIG_check_num_args("Xapian::UnimplementedError::UnimplementedError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::UnimplementedError::UnimplementedError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::UnimplementedError::UnimplementedError",2,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  result = (Xapian::UnimplementedError *)new Xapian::UnimplementedError((std::string const &)*arg1,(std::string const &)*arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__UnimplementedError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_UnimplementedError__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string temp1 ;
  Xapian::UnimplementedError *result = 0 ;
  
  SWIG_check_num_args("Xapian::UnimplementedError::UnimplementedError",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::UnimplementedError::UnimplementedError",1,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  result = (Xapian::UnimplementedError *)new Xapian::UnimplementedError((std::string const &)*arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__UnimplementedError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_UnimplementedError__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  int arg2 ;
  std::string temp1 ;
  Xapian::UnimplementedError *result = 0 ;
  
  SWIG_check_num_args("Xapian::UnimplementedError::UnimplementedError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::UnimplementedError::UnimplementedError",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::UnimplementedError::UnimplementedError",2,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  arg2 = (int)lua_tonumber(L, 2);
  result = (Xapian::UnimplementedError *)new Xapian::UnimplementedError((std::string const &)*arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__UnimplementedError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_UnimplementedError(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_UnimplementedError__SWIG_3(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_UnimplementedError__SWIG_4(L);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_UnimplementedError__SWIG_2(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_UnimplementedError__SWIG_1(L);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = SWIG_lua_isnilstring(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_UnimplementedError__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_UnimplementedError'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::UnimplementedError::UnimplementedError(std::string const &,std::string const &,char const *)\n"
    "    Xapian::UnimplementedError::UnimplementedError(std::string const &,std::string const &,int)\n"
    "    Xapian::UnimplementedError::UnimplementedError(std::string const &,std::string const &)\n"
    "    Xapian::UnimplementedError::UnimplementedError(std::string const &)\n"
    "    Xapian::UnimplementedError::UnimplementedError(std::string const &,int)\n");
  lua_error(L);return 0;
}


static void swig_delete_UnimplementedError(void *obj) {
Xapian::UnimplementedError *arg1 = (Xapian::UnimplementedError *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_UnimplementedError_methods[] = {
    {0,0}
};
static swig_lua_attribute swig_Xapian_UnimplementedError_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_UnimplementedError_bases[] = {0,0};
static const char *swig_Xapian_UnimplementedError_base_names[] = {"Xapian::LogicError *",0};
static swig_lua_class _wrap_class_Xapian_UnimplementedError = { "UnimplementedError", &SWIGTYPE_p_Xapian__UnimplementedError,_wrap_new_UnimplementedError, swig_delete_UnimplementedError, swig_Xapian_UnimplementedError_methods, swig_Xapian_UnimplementedError_attributes, swig_Xapian_UnimplementedError_bases, swig_Xapian_UnimplementedError_base_names };

static int _wrap_new_DatabaseError__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  char *arg3 = (char *) 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::DatabaseError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseError::DatabaseError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseError::DatabaseError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DatabaseError::DatabaseError",2,"std::string const &");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("Xapian::DatabaseError::DatabaseError",3,"char const *");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (char *)lua_tostring(L, 3);
  result = (Xapian::DatabaseError *)new Xapian::DatabaseError((std::string const &)*arg1,(std::string const &)*arg2,(char const *)arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseError__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  int arg3 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::DatabaseError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseError::DatabaseError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseError::DatabaseError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DatabaseError::DatabaseError",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::DatabaseError::DatabaseError",3,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (int)lua_tonumber(L, 3);
  result = (Xapian::DatabaseError *)new Xapian::DatabaseError((std::string const &)*arg1,(std::string const &)*arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseError__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::DatabaseError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseError::DatabaseError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseError::DatabaseError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DatabaseError::DatabaseError",2,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  result = (Xapian::DatabaseError *)new Xapian::DatabaseError((std::string const &)*arg1,(std::string const &)*arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseError__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string temp1 ;
  Xapian::DatabaseError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseError::DatabaseError",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseError::DatabaseError",1,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  result = (Xapian::DatabaseError *)new Xapian::DatabaseError((std::string const &)*arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseError__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  int arg2 ;
  std::string temp1 ;
  Xapian::DatabaseError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseError::DatabaseError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseError::DatabaseError",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::DatabaseError::DatabaseError",2,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  arg2 = (int)lua_tonumber(L, 2);
  result = (Xapian::DatabaseError *)new Xapian::DatabaseError((std::string const &)*arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseError(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_DatabaseError__SWIG_3(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_DatabaseError__SWIG_4(L);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_DatabaseError__SWIG_2(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_DatabaseError__SWIG_1(L);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = SWIG_lua_isnilstring(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_DatabaseError__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_DatabaseError'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::DatabaseError::DatabaseError(std::string const &,std::string const &,char const *)\n"
    "    Xapian::DatabaseError::DatabaseError(std::string const &,std::string const &,int)\n"
    "    Xapian::DatabaseError::DatabaseError(std::string const &,std::string const &)\n"
    "    Xapian::DatabaseError::DatabaseError(std::string const &)\n"
    "    Xapian::DatabaseError::DatabaseError(std::string const &,int)\n");
  lua_error(L);return 0;
}


static void swig_delete_DatabaseError(void *obj) {
Xapian::DatabaseError *arg1 = (Xapian::DatabaseError *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_DatabaseError_methods[] = {
    {0,0}
};
static swig_lua_attribute swig_Xapian_DatabaseError_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_DatabaseError_bases[] = {0,0};
static const char *swig_Xapian_DatabaseError_base_names[] = {"Xapian::RuntimeError *",0};
static swig_lua_class _wrap_class_Xapian_DatabaseError = { "DatabaseError", &SWIGTYPE_p_Xapian__DatabaseError,_wrap_new_DatabaseError, swig_delete_DatabaseError, swig_Xapian_DatabaseError_methods, swig_Xapian_DatabaseError_attributes, swig_Xapian_DatabaseError_bases, swig_Xapian_DatabaseError_base_names };

static int _wrap_new_DatabaseCorruptError__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  char *arg3 = (char *) 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::DatabaseCorruptError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseCorruptError::DatabaseCorruptError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseCorruptError::DatabaseCorruptError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DatabaseCorruptError::DatabaseCorruptError",2,"std::string const &");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("Xapian::DatabaseCorruptError::DatabaseCorruptError",3,"char const *");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (char *)lua_tostring(L, 3);
  result = (Xapian::DatabaseCorruptError *)new Xapian::DatabaseCorruptError((std::string const &)*arg1,(std::string const &)*arg2,(char const *)arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseCorruptError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseCorruptError__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  int arg3 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::DatabaseCorruptError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseCorruptError::DatabaseCorruptError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseCorruptError::DatabaseCorruptError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DatabaseCorruptError::DatabaseCorruptError",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::DatabaseCorruptError::DatabaseCorruptError",3,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (int)lua_tonumber(L, 3);
  result = (Xapian::DatabaseCorruptError *)new Xapian::DatabaseCorruptError((std::string const &)*arg1,(std::string const &)*arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseCorruptError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseCorruptError__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::DatabaseCorruptError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseCorruptError::DatabaseCorruptError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseCorruptError::DatabaseCorruptError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DatabaseCorruptError::DatabaseCorruptError",2,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  result = (Xapian::DatabaseCorruptError *)new Xapian::DatabaseCorruptError((std::string const &)*arg1,(std::string const &)*arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseCorruptError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseCorruptError__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string temp1 ;
  Xapian::DatabaseCorruptError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseCorruptError::DatabaseCorruptError",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseCorruptError::DatabaseCorruptError",1,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  result = (Xapian::DatabaseCorruptError *)new Xapian::DatabaseCorruptError((std::string const &)*arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseCorruptError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseCorruptError__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  int arg2 ;
  std::string temp1 ;
  Xapian::DatabaseCorruptError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseCorruptError::DatabaseCorruptError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseCorruptError::DatabaseCorruptError",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::DatabaseCorruptError::DatabaseCorruptError",2,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  arg2 = (int)lua_tonumber(L, 2);
  result = (Xapian::DatabaseCorruptError *)new Xapian::DatabaseCorruptError((std::string const &)*arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseCorruptError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseCorruptError(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_DatabaseCorruptError__SWIG_3(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_DatabaseCorruptError__SWIG_4(L);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_DatabaseCorruptError__SWIG_2(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_DatabaseCorruptError__SWIG_1(L);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = SWIG_lua_isnilstring(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_DatabaseCorruptError__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_DatabaseCorruptError'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::DatabaseCorruptError::DatabaseCorruptError(std::string const &,std::string const &,char const *)\n"
    "    Xapian::DatabaseCorruptError::DatabaseCorruptError(std::string const &,std::string const &,int)\n"
    "    Xapian::DatabaseCorruptError::DatabaseCorruptError(std::string const &,std::string const &)\n"
    "    Xapian::DatabaseCorruptError::DatabaseCorruptError(std::string const &)\n"
    "    Xapian::DatabaseCorruptError::DatabaseCorruptError(std::string const &,int)\n");
  lua_error(L);return 0;
}


static void swig_delete_DatabaseCorruptError(void *obj) {
Xapian::DatabaseCorruptError *arg1 = (Xapian::DatabaseCorruptError *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_DatabaseCorruptError_methods[] = {
    {0,0}
};
static swig_lua_attribute swig_Xapian_DatabaseCorruptError_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_DatabaseCorruptError_bases[] = {0,0};
static const char *swig_Xapian_DatabaseCorruptError_base_names[] = {"Xapian::DatabaseError *",0};
static swig_lua_class _wrap_class_Xapian_DatabaseCorruptError = { "DatabaseCorruptError", &SWIGTYPE_p_Xapian__DatabaseCorruptError,_wrap_new_DatabaseCorruptError, swig_delete_DatabaseCorruptError, swig_Xapian_DatabaseCorruptError_methods, swig_Xapian_DatabaseCorruptError_attributes, swig_Xapian_DatabaseCorruptError_bases, swig_Xapian_DatabaseCorruptError_base_names };

static int _wrap_new_DatabaseCreateError__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  char *arg3 = (char *) 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::DatabaseCreateError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseCreateError::DatabaseCreateError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseCreateError::DatabaseCreateError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DatabaseCreateError::DatabaseCreateError",2,"std::string const &");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("Xapian::DatabaseCreateError::DatabaseCreateError",3,"char const *");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (char *)lua_tostring(L, 3);
  result = (Xapian::DatabaseCreateError *)new Xapian::DatabaseCreateError((std::string const &)*arg1,(std::string const &)*arg2,(char const *)arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseCreateError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseCreateError__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  int arg3 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::DatabaseCreateError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseCreateError::DatabaseCreateError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseCreateError::DatabaseCreateError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DatabaseCreateError::DatabaseCreateError",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::DatabaseCreateError::DatabaseCreateError",3,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (int)lua_tonumber(L, 3);
  result = (Xapian::DatabaseCreateError *)new Xapian::DatabaseCreateError((std::string const &)*arg1,(std::string const &)*arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseCreateError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseCreateError__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::DatabaseCreateError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseCreateError::DatabaseCreateError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseCreateError::DatabaseCreateError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DatabaseCreateError::DatabaseCreateError",2,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  result = (Xapian::DatabaseCreateError *)new Xapian::DatabaseCreateError((std::string const &)*arg1,(std::string const &)*arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseCreateError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseCreateError__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string temp1 ;
  Xapian::DatabaseCreateError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseCreateError::DatabaseCreateError",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseCreateError::DatabaseCreateError",1,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  result = (Xapian::DatabaseCreateError *)new Xapian::DatabaseCreateError((std::string const &)*arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseCreateError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseCreateError__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  int arg2 ;
  std::string temp1 ;
  Xapian::DatabaseCreateError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseCreateError::DatabaseCreateError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseCreateError::DatabaseCreateError",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::DatabaseCreateError::DatabaseCreateError",2,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  arg2 = (int)lua_tonumber(L, 2);
  result = (Xapian::DatabaseCreateError *)new Xapian::DatabaseCreateError((std::string const &)*arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseCreateError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseCreateError(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_DatabaseCreateError__SWIG_3(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_DatabaseCreateError__SWIG_4(L);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_DatabaseCreateError__SWIG_2(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_DatabaseCreateError__SWIG_1(L);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = SWIG_lua_isnilstring(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_DatabaseCreateError__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_DatabaseCreateError'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::DatabaseCreateError::DatabaseCreateError(std::string const &,std::string const &,char const *)\n"
    "    Xapian::DatabaseCreateError::DatabaseCreateError(std::string const &,std::string const &,int)\n"
    "    Xapian::DatabaseCreateError::DatabaseCreateError(std::string const &,std::string const &)\n"
    "    Xapian::DatabaseCreateError::DatabaseCreateError(std::string const &)\n"
    "    Xapian::DatabaseCreateError::DatabaseCreateError(std::string const &,int)\n");
  lua_error(L);return 0;
}


static void swig_delete_DatabaseCreateError(void *obj) {
Xapian::DatabaseCreateError *arg1 = (Xapian::DatabaseCreateError *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_DatabaseCreateError_methods[] = {
    {0,0}
};
static swig_lua_attribute swig_Xapian_DatabaseCreateError_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_DatabaseCreateError_bases[] = {0,0};
static const char *swig_Xapian_DatabaseCreateError_base_names[] = {"Xapian::DatabaseError *",0};
static swig_lua_class _wrap_class_Xapian_DatabaseCreateError = { "DatabaseCreateError", &SWIGTYPE_p_Xapian__DatabaseCreateError,_wrap_new_DatabaseCreateError, swig_delete_DatabaseCreateError, swig_Xapian_DatabaseCreateError_methods, swig_Xapian_DatabaseCreateError_attributes, swig_Xapian_DatabaseCreateError_bases, swig_Xapian_DatabaseCreateError_base_names };

static int _wrap_new_DatabaseLockError__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  char *arg3 = (char *) 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::DatabaseLockError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseLockError::DatabaseLockError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseLockError::DatabaseLockError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DatabaseLockError::DatabaseLockError",2,"std::string const &");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("Xapian::DatabaseLockError::DatabaseLockError",3,"char const *");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (char *)lua_tostring(L, 3);
  result = (Xapian::DatabaseLockError *)new Xapian::DatabaseLockError((std::string const &)*arg1,(std::string const &)*arg2,(char const *)arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseLockError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseLockError__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  int arg3 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::DatabaseLockError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseLockError::DatabaseLockError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseLockError::DatabaseLockError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DatabaseLockError::DatabaseLockError",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::DatabaseLockError::DatabaseLockError",3,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (int)lua_tonumber(L, 3);
  result = (Xapian::DatabaseLockError *)new Xapian::DatabaseLockError((std::string const &)*arg1,(std::string const &)*arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseLockError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseLockError__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::DatabaseLockError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseLockError::DatabaseLockError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseLockError::DatabaseLockError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DatabaseLockError::DatabaseLockError",2,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  result = (Xapian::DatabaseLockError *)new Xapian::DatabaseLockError((std::string const &)*arg1,(std::string const &)*arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseLockError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseLockError__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string temp1 ;
  Xapian::DatabaseLockError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseLockError::DatabaseLockError",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseLockError::DatabaseLockError",1,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  result = (Xapian::DatabaseLockError *)new Xapian::DatabaseLockError((std::string const &)*arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseLockError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseLockError__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  int arg2 ;
  std::string temp1 ;
  Xapian::DatabaseLockError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseLockError::DatabaseLockError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseLockError::DatabaseLockError",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::DatabaseLockError::DatabaseLockError",2,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  arg2 = (int)lua_tonumber(L, 2);
  result = (Xapian::DatabaseLockError *)new Xapian::DatabaseLockError((std::string const &)*arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseLockError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseLockError(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_DatabaseLockError__SWIG_3(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_DatabaseLockError__SWIG_4(L);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_DatabaseLockError__SWIG_2(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_DatabaseLockError__SWIG_1(L);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = SWIG_lua_isnilstring(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_DatabaseLockError__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_DatabaseLockError'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::DatabaseLockError::DatabaseLockError(std::string const &,std::string const &,char const *)\n"
    "    Xapian::DatabaseLockError::DatabaseLockError(std::string const &,std::string const &,int)\n"
    "    Xapian::DatabaseLockError::DatabaseLockError(std::string const &,std::string const &)\n"
    "    Xapian::DatabaseLockError::DatabaseLockError(std::string const &)\n"
    "    Xapian::DatabaseLockError::DatabaseLockError(std::string const &,int)\n");
  lua_error(L);return 0;
}


static void swig_delete_DatabaseLockError(void *obj) {
Xapian::DatabaseLockError *arg1 = (Xapian::DatabaseLockError *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_DatabaseLockError_methods[] = {
    {0,0}
};
static swig_lua_attribute swig_Xapian_DatabaseLockError_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_DatabaseLockError_bases[] = {0,0};
static const char *swig_Xapian_DatabaseLockError_base_names[] = {"Xapian::DatabaseError *",0};
static swig_lua_class _wrap_class_Xapian_DatabaseLockError = { "DatabaseLockError", &SWIGTYPE_p_Xapian__DatabaseLockError,_wrap_new_DatabaseLockError, swig_delete_DatabaseLockError, swig_Xapian_DatabaseLockError_methods, swig_Xapian_DatabaseLockError_attributes, swig_Xapian_DatabaseLockError_bases, swig_Xapian_DatabaseLockError_base_names };

static int _wrap_new_DatabaseModifiedError__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  char *arg3 = (char *) 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::DatabaseModifiedError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseModifiedError::DatabaseModifiedError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseModifiedError::DatabaseModifiedError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DatabaseModifiedError::DatabaseModifiedError",2,"std::string const &");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("Xapian::DatabaseModifiedError::DatabaseModifiedError",3,"char const *");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (char *)lua_tostring(L, 3);
  result = (Xapian::DatabaseModifiedError *)new Xapian::DatabaseModifiedError((std::string const &)*arg1,(std::string const &)*arg2,(char const *)arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseModifiedError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseModifiedError__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  int arg3 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::DatabaseModifiedError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseModifiedError::DatabaseModifiedError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseModifiedError::DatabaseModifiedError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DatabaseModifiedError::DatabaseModifiedError",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::DatabaseModifiedError::DatabaseModifiedError",3,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (int)lua_tonumber(L, 3);
  result = (Xapian::DatabaseModifiedError *)new Xapian::DatabaseModifiedError((std::string const &)*arg1,(std::string const &)*arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseModifiedError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseModifiedError__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::DatabaseModifiedError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseModifiedError::DatabaseModifiedError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseModifiedError::DatabaseModifiedError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DatabaseModifiedError::DatabaseModifiedError",2,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  result = (Xapian::DatabaseModifiedError *)new Xapian::DatabaseModifiedError((std::string const &)*arg1,(std::string const &)*arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseModifiedError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseModifiedError__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string temp1 ;
  Xapian::DatabaseModifiedError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseModifiedError::DatabaseModifiedError",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseModifiedError::DatabaseModifiedError",1,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  result = (Xapian::DatabaseModifiedError *)new Xapian::DatabaseModifiedError((std::string const &)*arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseModifiedError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseModifiedError__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  int arg2 ;
  std::string temp1 ;
  Xapian::DatabaseModifiedError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseModifiedError::DatabaseModifiedError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseModifiedError::DatabaseModifiedError",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::DatabaseModifiedError::DatabaseModifiedError",2,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  arg2 = (int)lua_tonumber(L, 2);
  result = (Xapian::DatabaseModifiedError *)new Xapian::DatabaseModifiedError((std::string const &)*arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseModifiedError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseModifiedError(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_DatabaseModifiedError__SWIG_3(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_DatabaseModifiedError__SWIG_4(L);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_DatabaseModifiedError__SWIG_2(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_DatabaseModifiedError__SWIG_1(L);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = SWIG_lua_isnilstring(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_DatabaseModifiedError__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_DatabaseModifiedError'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::DatabaseModifiedError::DatabaseModifiedError(std::string const &,std::string const &,char const *)\n"
    "    Xapian::DatabaseModifiedError::DatabaseModifiedError(std::string const &,std::string const &,int)\n"
    "    Xapian::DatabaseModifiedError::DatabaseModifiedError(std::string const &,std::string const &)\n"
    "    Xapian::DatabaseModifiedError::DatabaseModifiedError(std::string const &)\n"
    "    Xapian::DatabaseModifiedError::DatabaseModifiedError(std::string const &,int)\n");
  lua_error(L);return 0;
}


static void swig_delete_DatabaseModifiedError(void *obj) {
Xapian::DatabaseModifiedError *arg1 = (Xapian::DatabaseModifiedError *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_DatabaseModifiedError_methods[] = {
    {0,0}
};
static swig_lua_attribute swig_Xapian_DatabaseModifiedError_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_DatabaseModifiedError_bases[] = {0,0};
static const char *swig_Xapian_DatabaseModifiedError_base_names[] = {"Xapian::DatabaseError *",0};
static swig_lua_class _wrap_class_Xapian_DatabaseModifiedError = { "DatabaseModifiedError", &SWIGTYPE_p_Xapian__DatabaseModifiedError,_wrap_new_DatabaseModifiedError, swig_delete_DatabaseModifiedError, swig_Xapian_DatabaseModifiedError_methods, swig_Xapian_DatabaseModifiedError_attributes, swig_Xapian_DatabaseModifiedError_bases, swig_Xapian_DatabaseModifiedError_base_names };

static int _wrap_new_DatabaseOpeningError__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  char *arg3 = (char *) 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::DatabaseOpeningError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseOpeningError::DatabaseOpeningError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseOpeningError::DatabaseOpeningError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DatabaseOpeningError::DatabaseOpeningError",2,"std::string const &");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("Xapian::DatabaseOpeningError::DatabaseOpeningError",3,"char const *");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (char *)lua_tostring(L, 3);
  result = (Xapian::DatabaseOpeningError *)new Xapian::DatabaseOpeningError((std::string const &)*arg1,(std::string const &)*arg2,(char const *)arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseOpeningError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseOpeningError__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  int arg3 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::DatabaseOpeningError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseOpeningError::DatabaseOpeningError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseOpeningError::DatabaseOpeningError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DatabaseOpeningError::DatabaseOpeningError",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::DatabaseOpeningError::DatabaseOpeningError",3,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (int)lua_tonumber(L, 3);
  result = (Xapian::DatabaseOpeningError *)new Xapian::DatabaseOpeningError((std::string const &)*arg1,(std::string const &)*arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseOpeningError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseOpeningError__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::DatabaseOpeningError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseOpeningError::DatabaseOpeningError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseOpeningError::DatabaseOpeningError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DatabaseOpeningError::DatabaseOpeningError",2,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  result = (Xapian::DatabaseOpeningError *)new Xapian::DatabaseOpeningError((std::string const &)*arg1,(std::string const &)*arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseOpeningError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseOpeningError__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string temp1 ;
  Xapian::DatabaseOpeningError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseOpeningError::DatabaseOpeningError",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseOpeningError::DatabaseOpeningError",1,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  result = (Xapian::DatabaseOpeningError *)new Xapian::DatabaseOpeningError((std::string const &)*arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseOpeningError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseOpeningError__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  int arg2 ;
  std::string temp1 ;
  Xapian::DatabaseOpeningError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseOpeningError::DatabaseOpeningError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseOpeningError::DatabaseOpeningError",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::DatabaseOpeningError::DatabaseOpeningError",2,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  arg2 = (int)lua_tonumber(L, 2);
  result = (Xapian::DatabaseOpeningError *)new Xapian::DatabaseOpeningError((std::string const &)*arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseOpeningError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseOpeningError(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_DatabaseOpeningError__SWIG_3(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_DatabaseOpeningError__SWIG_4(L);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_DatabaseOpeningError__SWIG_2(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_DatabaseOpeningError__SWIG_1(L);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = SWIG_lua_isnilstring(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_DatabaseOpeningError__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_DatabaseOpeningError'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::DatabaseOpeningError::DatabaseOpeningError(std::string const &,std::string const &,char const *)\n"
    "    Xapian::DatabaseOpeningError::DatabaseOpeningError(std::string const &,std::string const &,int)\n"
    "    Xapian::DatabaseOpeningError::DatabaseOpeningError(std::string const &,std::string const &)\n"
    "    Xapian::DatabaseOpeningError::DatabaseOpeningError(std::string const &)\n"
    "    Xapian::DatabaseOpeningError::DatabaseOpeningError(std::string const &,int)\n");
  lua_error(L);return 0;
}


static void swig_delete_DatabaseOpeningError(void *obj) {
Xapian::DatabaseOpeningError *arg1 = (Xapian::DatabaseOpeningError *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_DatabaseOpeningError_methods[] = {
    {0,0}
};
static swig_lua_attribute swig_Xapian_DatabaseOpeningError_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_DatabaseOpeningError_bases[] = {0,0};
static const char *swig_Xapian_DatabaseOpeningError_base_names[] = {"Xapian::DatabaseError *",0};
static swig_lua_class _wrap_class_Xapian_DatabaseOpeningError = { "DatabaseOpeningError", &SWIGTYPE_p_Xapian__DatabaseOpeningError,_wrap_new_DatabaseOpeningError, swig_delete_DatabaseOpeningError, swig_Xapian_DatabaseOpeningError_methods, swig_Xapian_DatabaseOpeningError_attributes, swig_Xapian_DatabaseOpeningError_bases, swig_Xapian_DatabaseOpeningError_base_names };

static int _wrap_new_DatabaseVersionError__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  char *arg3 = (char *) 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::DatabaseVersionError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseVersionError::DatabaseVersionError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseVersionError::DatabaseVersionError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DatabaseVersionError::DatabaseVersionError",2,"std::string const &");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("Xapian::DatabaseVersionError::DatabaseVersionError",3,"char const *");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (char *)lua_tostring(L, 3);
  result = (Xapian::DatabaseVersionError *)new Xapian::DatabaseVersionError((std::string const &)*arg1,(std::string const &)*arg2,(char const *)arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseVersionError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseVersionError__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  int arg3 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::DatabaseVersionError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseVersionError::DatabaseVersionError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseVersionError::DatabaseVersionError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DatabaseVersionError::DatabaseVersionError",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::DatabaseVersionError::DatabaseVersionError",3,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (int)lua_tonumber(L, 3);
  result = (Xapian::DatabaseVersionError *)new Xapian::DatabaseVersionError((std::string const &)*arg1,(std::string const &)*arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseVersionError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseVersionError__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::DatabaseVersionError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseVersionError::DatabaseVersionError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseVersionError::DatabaseVersionError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DatabaseVersionError::DatabaseVersionError",2,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  result = (Xapian::DatabaseVersionError *)new Xapian::DatabaseVersionError((std::string const &)*arg1,(std::string const &)*arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseVersionError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseVersionError__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string temp1 ;
  Xapian::DatabaseVersionError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseVersionError::DatabaseVersionError",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseVersionError::DatabaseVersionError",1,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  result = (Xapian::DatabaseVersionError *)new Xapian::DatabaseVersionError((std::string const &)*arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseVersionError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseVersionError__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  int arg2 ;
  std::string temp1 ;
  Xapian::DatabaseVersionError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseVersionError::DatabaseVersionError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseVersionError::DatabaseVersionError",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::DatabaseVersionError::DatabaseVersionError",2,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  arg2 = (int)lua_tonumber(L, 2);
  result = (Xapian::DatabaseVersionError *)new Xapian::DatabaseVersionError((std::string const &)*arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseVersionError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseVersionError(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_DatabaseVersionError__SWIG_3(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_DatabaseVersionError__SWIG_4(L);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_DatabaseVersionError__SWIG_2(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_DatabaseVersionError__SWIG_1(L);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = SWIG_lua_isnilstring(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_DatabaseVersionError__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_DatabaseVersionError'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::DatabaseVersionError::DatabaseVersionError(std::string const &,std::string const &,char const *)\n"
    "    Xapian::DatabaseVersionError::DatabaseVersionError(std::string const &,std::string const &,int)\n"
    "    Xapian::DatabaseVersionError::DatabaseVersionError(std::string const &,std::string const &)\n"
    "    Xapian::DatabaseVersionError::DatabaseVersionError(std::string const &)\n"
    "    Xapian::DatabaseVersionError::DatabaseVersionError(std::string const &,int)\n");
  lua_error(L);return 0;
}


static void swig_delete_DatabaseVersionError(void *obj) {
Xapian::DatabaseVersionError *arg1 = (Xapian::DatabaseVersionError *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_DatabaseVersionError_methods[] = {
    {0,0}
};
static swig_lua_attribute swig_Xapian_DatabaseVersionError_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_DatabaseVersionError_bases[] = {0,0};
static const char *swig_Xapian_DatabaseVersionError_base_names[] = {"Xapian::DatabaseOpeningError *",0};
static swig_lua_class _wrap_class_Xapian_DatabaseVersionError = { "DatabaseVersionError", &SWIGTYPE_p_Xapian__DatabaseVersionError,_wrap_new_DatabaseVersionError, swig_delete_DatabaseVersionError, swig_Xapian_DatabaseVersionError_methods, swig_Xapian_DatabaseVersionError_attributes, swig_Xapian_DatabaseVersionError_bases, swig_Xapian_DatabaseVersionError_base_names };

static int _wrap_new_DocNotFoundError__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  char *arg3 = (char *) 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::DocNotFoundError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DocNotFoundError::DocNotFoundError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DocNotFoundError::DocNotFoundError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DocNotFoundError::DocNotFoundError",2,"std::string const &");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("Xapian::DocNotFoundError::DocNotFoundError",3,"char const *");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (char *)lua_tostring(L, 3);
  result = (Xapian::DocNotFoundError *)new Xapian::DocNotFoundError((std::string const &)*arg1,(std::string const &)*arg2,(char const *)arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DocNotFoundError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DocNotFoundError__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  int arg3 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::DocNotFoundError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DocNotFoundError::DocNotFoundError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DocNotFoundError::DocNotFoundError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DocNotFoundError::DocNotFoundError",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::DocNotFoundError::DocNotFoundError",3,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (int)lua_tonumber(L, 3);
  result = (Xapian::DocNotFoundError *)new Xapian::DocNotFoundError((std::string const &)*arg1,(std::string const &)*arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DocNotFoundError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DocNotFoundError__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::DocNotFoundError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DocNotFoundError::DocNotFoundError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DocNotFoundError::DocNotFoundError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DocNotFoundError::DocNotFoundError",2,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  result = (Xapian::DocNotFoundError *)new Xapian::DocNotFoundError((std::string const &)*arg1,(std::string const &)*arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DocNotFoundError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DocNotFoundError__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string temp1 ;
  Xapian::DocNotFoundError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DocNotFoundError::DocNotFoundError",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DocNotFoundError::DocNotFoundError",1,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  result = (Xapian::DocNotFoundError *)new Xapian::DocNotFoundError((std::string const &)*arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DocNotFoundError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DocNotFoundError__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  int arg2 ;
  std::string temp1 ;
  Xapian::DocNotFoundError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DocNotFoundError::DocNotFoundError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DocNotFoundError::DocNotFoundError",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::DocNotFoundError::DocNotFoundError",2,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  arg2 = (int)lua_tonumber(L, 2);
  result = (Xapian::DocNotFoundError *)new Xapian::DocNotFoundError((std::string const &)*arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DocNotFoundError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DocNotFoundError(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_DocNotFoundError__SWIG_3(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_DocNotFoundError__SWIG_4(L);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_DocNotFoundError__SWIG_2(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_DocNotFoundError__SWIG_1(L);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = SWIG_lua_isnilstring(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_DocNotFoundError__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_DocNotFoundError'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::DocNotFoundError::DocNotFoundError(std::string const &,std::string const &,char const *)\n"
    "    Xapian::DocNotFoundError::DocNotFoundError(std::string const &,std::string const &,int)\n"
    "    Xapian::DocNotFoundError::DocNotFoundError(std::string const &,std::string const &)\n"
    "    Xapian::DocNotFoundError::DocNotFoundError(std::string const &)\n"
    "    Xapian::DocNotFoundError::DocNotFoundError(std::string const &,int)\n");
  lua_error(L);return 0;
}


static void swig_delete_DocNotFoundError(void *obj) {
Xapian::DocNotFoundError *arg1 = (Xapian::DocNotFoundError *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_DocNotFoundError_methods[] = {
    {0,0}
};
static swig_lua_attribute swig_Xapian_DocNotFoundError_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_DocNotFoundError_bases[] = {0,0};
static const char *swig_Xapian_DocNotFoundError_base_names[] = {"Xapian::RuntimeError *",0};
static swig_lua_class _wrap_class_Xapian_DocNotFoundError = { "DocNotFoundError", &SWIGTYPE_p_Xapian__DocNotFoundError,_wrap_new_DocNotFoundError, swig_delete_DocNotFoundError, swig_Xapian_DocNotFoundError_methods, swig_Xapian_DocNotFoundError_attributes, swig_Xapian_DocNotFoundError_bases, swig_Xapian_DocNotFoundError_base_names };

static int _wrap_new_FeatureUnavailableError__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  char *arg3 = (char *) 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::FeatureUnavailableError *result = 0 ;
  
  SWIG_check_num_args("Xapian::FeatureUnavailableError::FeatureUnavailableError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::FeatureUnavailableError::FeatureUnavailableError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::FeatureUnavailableError::FeatureUnavailableError",2,"std::string const &");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("Xapian::FeatureUnavailableError::FeatureUnavailableError",3,"char const *");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (char *)lua_tostring(L, 3);
  result = (Xapian::FeatureUnavailableError *)new Xapian::FeatureUnavailableError((std::string const &)*arg1,(std::string const &)*arg2,(char const *)arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__FeatureUnavailableError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_FeatureUnavailableError__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  int arg3 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::FeatureUnavailableError *result = 0 ;
  
  SWIG_check_num_args("Xapian::FeatureUnavailableError::FeatureUnavailableError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::FeatureUnavailableError::FeatureUnavailableError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::FeatureUnavailableError::FeatureUnavailableError",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::FeatureUnavailableError::FeatureUnavailableError",3,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (int)lua_tonumber(L, 3);
  result = (Xapian::FeatureUnavailableError *)new Xapian::FeatureUnavailableError((std::string const &)*arg1,(std::string const &)*arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__FeatureUnavailableError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_FeatureUnavailableError__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::FeatureUnavailableError *result = 0 ;
  
  SWIG_check_num_args("Xapian::FeatureUnavailableError::FeatureUnavailableError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::FeatureUnavailableError::FeatureUnavailableError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::FeatureUnavailableError::FeatureUnavailableError",2,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  result = (Xapian::FeatureUnavailableError *)new Xapian::FeatureUnavailableError((std::string const &)*arg1,(std::string const &)*arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__FeatureUnavailableError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_FeatureUnavailableError__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string temp1 ;
  Xapian::FeatureUnavailableError *result = 0 ;
  
  SWIG_check_num_args("Xapian::FeatureUnavailableError::FeatureUnavailableError",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::FeatureUnavailableError::FeatureUnavailableError",1,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  result = (Xapian::FeatureUnavailableError *)new Xapian::FeatureUnavailableError((std::string const &)*arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__FeatureUnavailableError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_FeatureUnavailableError__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  int arg2 ;
  std::string temp1 ;
  Xapian::FeatureUnavailableError *result = 0 ;
  
  SWIG_check_num_args("Xapian::FeatureUnavailableError::FeatureUnavailableError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::FeatureUnavailableError::FeatureUnavailableError",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::FeatureUnavailableError::FeatureUnavailableError",2,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  arg2 = (int)lua_tonumber(L, 2);
  result = (Xapian::FeatureUnavailableError *)new Xapian::FeatureUnavailableError((std::string const &)*arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__FeatureUnavailableError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_FeatureUnavailableError(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_FeatureUnavailableError__SWIG_3(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_FeatureUnavailableError__SWIG_4(L);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_FeatureUnavailableError__SWIG_2(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_FeatureUnavailableError__SWIG_1(L);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = SWIG_lua_isnilstring(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_FeatureUnavailableError__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_FeatureUnavailableError'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::FeatureUnavailableError::FeatureUnavailableError(std::string const &,std::string const &,char const *)\n"
    "    Xapian::FeatureUnavailableError::FeatureUnavailableError(std::string const &,std::string const &,int)\n"
    "    Xapian::FeatureUnavailableError::FeatureUnavailableError(std::string const &,std::string const &)\n"
    "    Xapian::FeatureUnavailableError::FeatureUnavailableError(std::string const &)\n"
    "    Xapian::FeatureUnavailableError::FeatureUnavailableError(std::string const &,int)\n");
  lua_error(L);return 0;
}


static void swig_delete_FeatureUnavailableError(void *obj) {
Xapian::FeatureUnavailableError *arg1 = (Xapian::FeatureUnavailableError *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_FeatureUnavailableError_methods[] = {
    {0,0}
};
static swig_lua_attribute swig_Xapian_FeatureUnavailableError_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_FeatureUnavailableError_bases[] = {0,0};
static const char *swig_Xapian_FeatureUnavailableError_base_names[] = {"Xapian::RuntimeError *",0};
static swig_lua_class _wrap_class_Xapian_FeatureUnavailableError = { "FeatureUnavailableError", &SWIGTYPE_p_Xapian__FeatureUnavailableError,_wrap_new_FeatureUnavailableError, swig_delete_FeatureUnavailableError, swig_Xapian_FeatureUnavailableError_methods, swig_Xapian_FeatureUnavailableError_attributes, swig_Xapian_FeatureUnavailableError_bases, swig_Xapian_FeatureUnavailableError_base_names };

static int _wrap_new_InternalError__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  char *arg3 = (char *) 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::InternalError *result = 0 ;
  
  SWIG_check_num_args("Xapian::InternalError::InternalError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::InternalError::InternalError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::InternalError::InternalError",2,"std::string const &");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("Xapian::InternalError::InternalError",3,"char const *");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (char *)lua_tostring(L, 3);
  result = (Xapian::InternalError *)new Xapian::InternalError((std::string const &)*arg1,(std::string const &)*arg2,(char const *)arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__InternalError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_InternalError__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  int arg3 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::InternalError *result = 0 ;
  
  SWIG_check_num_args("Xapian::InternalError::InternalError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::InternalError::InternalError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::InternalError::InternalError",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::InternalError::InternalError",3,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (int)lua_tonumber(L, 3);
  result = (Xapian::InternalError *)new Xapian::InternalError((std::string const &)*arg1,(std::string const &)*arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__InternalError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_InternalError__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::InternalError *result = 0 ;
  
  SWIG_check_num_args("Xapian::InternalError::InternalError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::InternalError::InternalError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::InternalError::InternalError",2,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  result = (Xapian::InternalError *)new Xapian::InternalError((std::string const &)*arg1,(std::string const &)*arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__InternalError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_InternalError__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string temp1 ;
  Xapian::InternalError *result = 0 ;
  
  SWIG_check_num_args("Xapian::InternalError::InternalError",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::InternalError::InternalError",1,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  result = (Xapian::InternalError *)new Xapian::InternalError((std::string const &)*arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__InternalError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_InternalError__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  int arg2 ;
  std::string temp1 ;
  Xapian::InternalError *result = 0 ;
  
  SWIG_check_num_args("Xapian::InternalError::InternalError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::InternalError::InternalError",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::InternalError::InternalError",2,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  arg2 = (int)lua_tonumber(L, 2);
  result = (Xapian::InternalError *)new Xapian::InternalError((std::string const &)*arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__InternalError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_InternalError(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_InternalError__SWIG_3(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_InternalError__SWIG_4(L);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_InternalError__SWIG_2(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_InternalError__SWIG_1(L);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = SWIG_lua_isnilstring(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_InternalError__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_InternalError'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::InternalError::InternalError(std::string const &,std::string const &,char const *)\n"
    "    Xapian::InternalError::InternalError(std::string const &,std::string const &,int)\n"
    "    Xapian::InternalError::InternalError(std::string const &,std::string const &)\n"
    "    Xapian::InternalError::InternalError(std::string const &)\n"
    "    Xapian::InternalError::InternalError(std::string const &,int)\n");
  lua_error(L);return 0;
}


static void swig_delete_InternalError(void *obj) {
Xapian::InternalError *arg1 = (Xapian::InternalError *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_InternalError_methods[] = {
    {0,0}
};
static swig_lua_attribute swig_Xapian_InternalError_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_InternalError_bases[] = {0,0};
static const char *swig_Xapian_InternalError_base_names[] = {"Xapian::RuntimeError *",0};
static swig_lua_class _wrap_class_Xapian_InternalError = { "InternalError", &SWIGTYPE_p_Xapian__InternalError,_wrap_new_InternalError, swig_delete_InternalError, swig_Xapian_InternalError_methods, swig_Xapian_InternalError_attributes, swig_Xapian_InternalError_bases, swig_Xapian_InternalError_base_names };

static int _wrap_new_NetworkError__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  char *arg3 = (char *) 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::NetworkError *result = 0 ;
  
  SWIG_check_num_args("Xapian::NetworkError::NetworkError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::NetworkError::NetworkError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::NetworkError::NetworkError",2,"std::string const &");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("Xapian::NetworkError::NetworkError",3,"char const *");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (char *)lua_tostring(L, 3);
  result = (Xapian::NetworkError *)new Xapian::NetworkError((std::string const &)*arg1,(std::string const &)*arg2,(char const *)arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__NetworkError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_NetworkError__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  int arg3 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::NetworkError *result = 0 ;
  
  SWIG_check_num_args("Xapian::NetworkError::NetworkError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::NetworkError::NetworkError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::NetworkError::NetworkError",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::NetworkError::NetworkError",3,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (int)lua_tonumber(L, 3);
  result = (Xapian::NetworkError *)new Xapian::NetworkError((std::string const &)*arg1,(std::string const &)*arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__NetworkError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_NetworkError__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::NetworkError *result = 0 ;
  
  SWIG_check_num_args("Xapian::NetworkError::NetworkError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::NetworkError::NetworkError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::NetworkError::NetworkError",2,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  result = (Xapian::NetworkError *)new Xapian::NetworkError((std::string const &)*arg1,(std::string const &)*arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__NetworkError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_NetworkError__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string temp1 ;
  Xapian::NetworkError *result = 0 ;
  
  SWIG_check_num_args("Xapian::NetworkError::NetworkError",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::NetworkError::NetworkError",1,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  result = (Xapian::NetworkError *)new Xapian::NetworkError((std::string const &)*arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__NetworkError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_NetworkError__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  int arg2 ;
  std::string temp1 ;
  Xapian::NetworkError *result = 0 ;
  
  SWIG_check_num_args("Xapian::NetworkError::NetworkError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::NetworkError::NetworkError",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::NetworkError::NetworkError",2,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  arg2 = (int)lua_tonumber(L, 2);
  result = (Xapian::NetworkError *)new Xapian::NetworkError((std::string const &)*arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__NetworkError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_NetworkError(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_NetworkError__SWIG_3(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_NetworkError__SWIG_4(L);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_NetworkError__SWIG_2(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_NetworkError__SWIG_1(L);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = SWIG_lua_isnilstring(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_NetworkError__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_NetworkError'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::NetworkError::NetworkError(std::string const &,std::string const &,char const *)\n"
    "    Xapian::NetworkError::NetworkError(std::string const &,std::string const &,int)\n"
    "    Xapian::NetworkError::NetworkError(std::string const &,std::string const &)\n"
    "    Xapian::NetworkError::NetworkError(std::string const &)\n"
    "    Xapian::NetworkError::NetworkError(std::string const &,int)\n");
  lua_error(L);return 0;
}


static void swig_delete_NetworkError(void *obj) {
Xapian::NetworkError *arg1 = (Xapian::NetworkError *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_NetworkError_methods[] = {
    {0,0}
};
static swig_lua_attribute swig_Xapian_NetworkError_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_NetworkError_bases[] = {0,0};
static const char *swig_Xapian_NetworkError_base_names[] = {"Xapian::RuntimeError *",0};
static swig_lua_class _wrap_class_Xapian_NetworkError = { "NetworkError", &SWIGTYPE_p_Xapian__NetworkError,_wrap_new_NetworkError, swig_delete_NetworkError, swig_Xapian_NetworkError_methods, swig_Xapian_NetworkError_attributes, swig_Xapian_NetworkError_bases, swig_Xapian_NetworkError_base_names };

static int _wrap_new_NetworkTimeoutError__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  char *arg3 = (char *) 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::NetworkTimeoutError *result = 0 ;
  
  SWIG_check_num_args("Xapian::NetworkTimeoutError::NetworkTimeoutError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::NetworkTimeoutError::NetworkTimeoutError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::NetworkTimeoutError::NetworkTimeoutError",2,"std::string const &");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("Xapian::NetworkTimeoutError::NetworkTimeoutError",3,"char const *");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (char *)lua_tostring(L, 3);
  result = (Xapian::NetworkTimeoutError *)new Xapian::NetworkTimeoutError((std::string const &)*arg1,(std::string const &)*arg2,(char const *)arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__NetworkTimeoutError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_NetworkTimeoutError__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  int arg3 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::NetworkTimeoutError *result = 0 ;
  
  SWIG_check_num_args("Xapian::NetworkTimeoutError::NetworkTimeoutError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::NetworkTimeoutError::NetworkTimeoutError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::NetworkTimeoutError::NetworkTimeoutError",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::NetworkTimeoutError::NetworkTimeoutError",3,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (int)lua_tonumber(L, 3);
  result = (Xapian::NetworkTimeoutError *)new Xapian::NetworkTimeoutError((std::string const &)*arg1,(std::string const &)*arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__NetworkTimeoutError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_NetworkTimeoutError__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::NetworkTimeoutError *result = 0 ;
  
  SWIG_check_num_args("Xapian::NetworkTimeoutError::NetworkTimeoutError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::NetworkTimeoutError::NetworkTimeoutError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::NetworkTimeoutError::NetworkTimeoutError",2,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  result = (Xapian::NetworkTimeoutError *)new Xapian::NetworkTimeoutError((std::string const &)*arg1,(std::string const &)*arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__NetworkTimeoutError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_NetworkTimeoutError__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string temp1 ;
  Xapian::NetworkTimeoutError *result = 0 ;
  
  SWIG_check_num_args("Xapian::NetworkTimeoutError::NetworkTimeoutError",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::NetworkTimeoutError::NetworkTimeoutError",1,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  result = (Xapian::NetworkTimeoutError *)new Xapian::NetworkTimeoutError((std::string const &)*arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__NetworkTimeoutError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_NetworkTimeoutError__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  int arg2 ;
  std::string temp1 ;
  Xapian::NetworkTimeoutError *result = 0 ;
  
  SWIG_check_num_args("Xapian::NetworkTimeoutError::NetworkTimeoutError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::NetworkTimeoutError::NetworkTimeoutError",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::NetworkTimeoutError::NetworkTimeoutError",2,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  arg2 = (int)lua_tonumber(L, 2);
  result = (Xapian::NetworkTimeoutError *)new Xapian::NetworkTimeoutError((std::string const &)*arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__NetworkTimeoutError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_NetworkTimeoutError(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_NetworkTimeoutError__SWIG_3(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_NetworkTimeoutError__SWIG_4(L);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_NetworkTimeoutError__SWIG_2(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_NetworkTimeoutError__SWIG_1(L);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = SWIG_lua_isnilstring(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_NetworkTimeoutError__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_NetworkTimeoutError'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::NetworkTimeoutError::NetworkTimeoutError(std::string const &,std::string const &,char const *)\n"
    "    Xapian::NetworkTimeoutError::NetworkTimeoutError(std::string const &,std::string const &,int)\n"
    "    Xapian::NetworkTimeoutError::NetworkTimeoutError(std::string const &,std::string const &)\n"
    "    Xapian::NetworkTimeoutError::NetworkTimeoutError(std::string const &)\n"
    "    Xapian::NetworkTimeoutError::NetworkTimeoutError(std::string const &,int)\n");
  lua_error(L);return 0;
}


static void swig_delete_NetworkTimeoutError(void *obj) {
Xapian::NetworkTimeoutError *arg1 = (Xapian::NetworkTimeoutError *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_NetworkTimeoutError_methods[] = {
    {0,0}
};
static swig_lua_attribute swig_Xapian_NetworkTimeoutError_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_NetworkTimeoutError_bases[] = {0,0};
static const char *swig_Xapian_NetworkTimeoutError_base_names[] = {"Xapian::NetworkError *",0};
static swig_lua_class _wrap_class_Xapian_NetworkTimeoutError = { "NetworkTimeoutError", &SWIGTYPE_p_Xapian__NetworkTimeoutError,_wrap_new_NetworkTimeoutError, swig_delete_NetworkTimeoutError, swig_Xapian_NetworkTimeoutError_methods, swig_Xapian_NetworkTimeoutError_attributes, swig_Xapian_NetworkTimeoutError_bases, swig_Xapian_NetworkTimeoutError_base_names };

static int _wrap_new_QueryParserError__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  char *arg3 = (char *) 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::QueryParserError *result = 0 ;
  
  SWIG_check_num_args("Xapian::QueryParserError::QueryParserError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::QueryParserError::QueryParserError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::QueryParserError::QueryParserError",2,"std::string const &");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("Xapian::QueryParserError::QueryParserError",3,"char const *");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (char *)lua_tostring(L, 3);
  result = (Xapian::QueryParserError *)new Xapian::QueryParserError((std::string const &)*arg1,(std::string const &)*arg2,(char const *)arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__QueryParserError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_QueryParserError__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  int arg3 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::QueryParserError *result = 0 ;
  
  SWIG_check_num_args("Xapian::QueryParserError::QueryParserError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::QueryParserError::QueryParserError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::QueryParserError::QueryParserError",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::QueryParserError::QueryParserError",3,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (int)lua_tonumber(L, 3);
  result = (Xapian::QueryParserError *)new Xapian::QueryParserError((std::string const &)*arg1,(std::string const &)*arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__QueryParserError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_QueryParserError__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::QueryParserError *result = 0 ;
  
  SWIG_check_num_args("Xapian::QueryParserError::QueryParserError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::QueryParserError::QueryParserError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::QueryParserError::QueryParserError",2,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  result = (Xapian::QueryParserError *)new Xapian::QueryParserError((std::string const &)*arg1,(std::string const &)*arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__QueryParserError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_QueryParserError__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string temp1 ;
  Xapian::QueryParserError *result = 0 ;
  
  SWIG_check_num_args("Xapian::QueryParserError::QueryParserError",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::QueryParserError::QueryParserError",1,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  result = (Xapian::QueryParserError *)new Xapian::QueryParserError((std::string const &)*arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__QueryParserError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_QueryParserError__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  int arg2 ;
  std::string temp1 ;
  Xapian::QueryParserError *result = 0 ;
  
  SWIG_check_num_args("Xapian::QueryParserError::QueryParserError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::QueryParserError::QueryParserError",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::QueryParserError::QueryParserError",2,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  arg2 = (int)lua_tonumber(L, 2);
  result = (Xapian::QueryParserError *)new Xapian::QueryParserError((std::string const &)*arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__QueryParserError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_QueryParserError(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_QueryParserError__SWIG_3(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_QueryParserError__SWIG_4(L);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_QueryParserError__SWIG_2(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_QueryParserError__SWIG_1(L);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = SWIG_lua_isnilstring(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_QueryParserError__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_QueryParserError'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::QueryParserError::QueryParserError(std::string const &,std::string const &,char const *)\n"
    "    Xapian::QueryParserError::QueryParserError(std::string const &,std::string const &,int)\n"
    "    Xapian::QueryParserError::QueryParserError(std::string const &,std::string const &)\n"
    "    Xapian::QueryParserError::QueryParserError(std::string const &)\n"
    "    Xapian::QueryParserError::QueryParserError(std::string const &,int)\n");
  lua_error(L);return 0;
}


static void swig_delete_QueryParserError(void *obj) {
Xapian::QueryParserError *arg1 = (Xapian::QueryParserError *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_QueryParserError_methods[] = {
    {0,0}
};
static swig_lua_attribute swig_Xapian_QueryParserError_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_QueryParserError_bases[] = {0,0};
static const char *swig_Xapian_QueryParserError_base_names[] = {"Xapian::RuntimeError *",0};
static swig_lua_class _wrap_class_Xapian_QueryParserError = { "QueryParserError", &SWIGTYPE_p_Xapian__QueryParserError,_wrap_new_QueryParserError, swig_delete_QueryParserError, swig_Xapian_QueryParserError_methods, swig_Xapian_QueryParserError_attributes, swig_Xapian_QueryParserError_bases, swig_Xapian_QueryParserError_base_names };

static int _wrap_new_SerialisationError__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  char *arg3 = (char *) 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::SerialisationError *result = 0 ;
  
  SWIG_check_num_args("Xapian::SerialisationError::SerialisationError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::SerialisationError::SerialisationError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::SerialisationError::SerialisationError",2,"std::string const &");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("Xapian::SerialisationError::SerialisationError",3,"char const *");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (char *)lua_tostring(L, 3);
  result = (Xapian::SerialisationError *)new Xapian::SerialisationError((std::string const &)*arg1,(std::string const &)*arg2,(char const *)arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__SerialisationError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_SerialisationError__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  int arg3 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::SerialisationError *result = 0 ;
  
  SWIG_check_num_args("Xapian::SerialisationError::SerialisationError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::SerialisationError::SerialisationError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::SerialisationError::SerialisationError",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::SerialisationError::SerialisationError",3,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (int)lua_tonumber(L, 3);
  result = (Xapian::SerialisationError *)new Xapian::SerialisationError((std::string const &)*arg1,(std::string const &)*arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__SerialisationError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_SerialisationError__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::SerialisationError *result = 0 ;
  
  SWIG_check_num_args("Xapian::SerialisationError::SerialisationError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::SerialisationError::SerialisationError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::SerialisationError::SerialisationError",2,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  result = (Xapian::SerialisationError *)new Xapian::SerialisationError((std::string const &)*arg1,(std::string const &)*arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__SerialisationError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_SerialisationError__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string temp1 ;
  Xapian::SerialisationError *result = 0 ;
  
  SWIG_check_num_args("Xapian::SerialisationError::SerialisationError",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::SerialisationError::SerialisationError",1,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  result = (Xapian::SerialisationError *)new Xapian::SerialisationError((std::string const &)*arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__SerialisationError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_SerialisationError__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  int arg2 ;
  std::string temp1 ;
  Xapian::SerialisationError *result = 0 ;
  
  SWIG_check_num_args("Xapian::SerialisationError::SerialisationError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::SerialisationError::SerialisationError",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::SerialisationError::SerialisationError",2,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  arg2 = (int)lua_tonumber(L, 2);
  result = (Xapian::SerialisationError *)new Xapian::SerialisationError((std::string const &)*arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__SerialisationError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_SerialisationError(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_SerialisationError__SWIG_3(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_SerialisationError__SWIG_4(L);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_SerialisationError__SWIG_2(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_SerialisationError__SWIG_1(L);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = SWIG_lua_isnilstring(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_SerialisationError__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_SerialisationError'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::SerialisationError::SerialisationError(std::string const &,std::string const &,char const *)\n"
    "    Xapian::SerialisationError::SerialisationError(std::string const &,std::string const &,int)\n"
    "    Xapian::SerialisationError::SerialisationError(std::string const &,std::string const &)\n"
    "    Xapian::SerialisationError::SerialisationError(std::string const &)\n"
    "    Xapian::SerialisationError::SerialisationError(std::string const &,int)\n");
  lua_error(L);return 0;
}


static void swig_delete_SerialisationError(void *obj) {
Xapian::SerialisationError *arg1 = (Xapian::SerialisationError *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_SerialisationError_methods[] = {
    {0,0}
};
static swig_lua_attribute swig_Xapian_SerialisationError_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_SerialisationError_bases[] = {0,0};
static const char *swig_Xapian_SerialisationError_base_names[] = {"Xapian::RuntimeError *",0};
static swig_lua_class _wrap_class_Xapian_SerialisationError = { "SerialisationError", &SWIGTYPE_p_Xapian__SerialisationError,_wrap_new_SerialisationError, swig_delete_SerialisationError, swig_Xapian_SerialisationError_methods, swig_Xapian_SerialisationError_attributes, swig_Xapian_SerialisationError_bases, swig_Xapian_SerialisationError_base_names };

static int _wrap_new_RangeError__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  char *arg3 = (char *) 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::RangeError *result = 0 ;
  
  SWIG_check_num_args("Xapian::RangeError::RangeError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::RangeError::RangeError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::RangeError::RangeError",2,"std::string const &");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("Xapian::RangeError::RangeError",3,"char const *");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (char *)lua_tostring(L, 3);
  result = (Xapian::RangeError *)new Xapian::RangeError((std::string const &)*arg1,(std::string const &)*arg2,(char const *)arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__RangeError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_RangeError__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  int arg3 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::RangeError *result = 0 ;
  
  SWIG_check_num_args("Xapian::RangeError::RangeError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::RangeError::RangeError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::RangeError::RangeError",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::RangeError::RangeError",3,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (int)lua_tonumber(L, 3);
  result = (Xapian::RangeError *)new Xapian::RangeError((std::string const &)*arg1,(std::string const &)*arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__RangeError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_RangeError__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::RangeError *result = 0 ;
  
  SWIG_check_num_args("Xapian::RangeError::RangeError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::RangeError::RangeError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::RangeError::RangeError",2,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  result = (Xapian::RangeError *)new Xapian::RangeError((std::string const &)*arg1,(std::string const &)*arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__RangeError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_RangeError__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string temp1 ;
  Xapian::RangeError *result = 0 ;
  
  SWIG_check_num_args("Xapian::RangeError::RangeError",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::RangeError::RangeError",1,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  result = (Xapian::RangeError *)new Xapian::RangeError((std::string const &)*arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__RangeError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_RangeError__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  int arg2 ;
  std::string temp1 ;
  Xapian::RangeError *result = 0 ;
  
  SWIG_check_num_args("Xapian::RangeError::RangeError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::RangeError::RangeError",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::RangeError::RangeError",2,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  arg2 = (int)lua_tonumber(L, 2);
  result = (Xapian::RangeError *)new Xapian::RangeError((std::string const &)*arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__RangeError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_RangeError(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_RangeError__SWIG_3(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_RangeError__SWIG_4(L);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_RangeError__SWIG_2(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_RangeError__SWIG_1(L);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = SWIG_lua_isnilstring(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_RangeError__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_RangeError'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::RangeError::RangeError(std::string const &,std::string const &,char const *)\n"
    "    Xapian::RangeError::RangeError(std::string const &,std::string const &,int)\n"
    "    Xapian::RangeError::RangeError(std::string const &,std::string const &)\n"
    "    Xapian::RangeError::RangeError(std::string const &)\n"
    "    Xapian::RangeError::RangeError(std::string const &,int)\n");
  lua_error(L);return 0;
}


static void swig_delete_RangeError(void *obj) {
Xapian::RangeError *arg1 = (Xapian::RangeError *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_RangeError_methods[] = {
    {0,0}
};
static swig_lua_attribute swig_Xapian_RangeError_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_RangeError_bases[] = {0,0};
static const char *swig_Xapian_RangeError_base_names[] = {"Xapian::RuntimeError *",0};
static swig_lua_class _wrap_class_Xapian_RangeError = { "RangeError", &SWIGTYPE_p_Xapian__RangeError,_wrap_new_RangeError, swig_delete_RangeError, swig_Xapian_RangeError_methods, swig_Xapian_RangeError_attributes, swig_Xapian_RangeError_bases, swig_Xapian_RangeError_base_names };

static int _wrap_BAD_VALUENO_get(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno result;
  
  SWIG_check_num_args("Xapian::BAD_VALUENO",0,0)
  result = (Xapian::valueno)(Xapian::valueno)Xapian::BAD_VALUENO;
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_version_string(lua_State* L) {
  int SWIG_arg = 0;
  char *result = 0 ;
  
  SWIG_check_num_args("Xapian::version_string",0,0)
  result = (char *)Xapian::version_string();
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_major_version(lua_State* L) {
  int SWIG_arg = 0;
  int result;
  
  SWIG_check_num_args("Xapian::major_version",0,0)
  result = (int)Xapian::major_version();
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_minor_version(lua_State* L) {
  int SWIG_arg = 0;
  int result;
  
  SWIG_check_num_args("Xapian::minor_version",0,0)
  result = (int)Xapian::minor_version();
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_revision(lua_State* L) {
  int SWIG_arg = 0;
  int result;
  
  SWIG_check_num_args("Xapian::revision",0,0)
  result = (int)Xapian::revision();
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_PositionIterator__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PositionIterator *result = 0 ;
  
  SWIG_check_num_args("Xapian::PositionIterator::PositionIterator",0,0)
  {
    try {
      result = (Xapian::PositionIterator *)new Xapian::PositionIterator();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__PositionIterator,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_PositionIterator__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PositionIterator *arg1 = 0 ;
  Xapian::PositionIterator *result = 0 ;
  
  SWIG_check_num_args("Xapian::PositionIterator::PositionIterator",1,1)
  if(!lua_isuserdata(L,1)) SWIG_fail_arg("Xapian::PositionIterator::PositionIterator",1,"Xapian::PositionIterator const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PositionIterator,0))){
    SWIG_fail_ptr("new_PositionIterator",1,SWIGTYPE_p_Xapian__PositionIterator);
  }
  
  {
    try {
      result = (Xapian::PositionIterator *)new Xapian::PositionIterator((Xapian::PositionIterator const &)*arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__PositionIterator,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_PositionIterator(lua_State* L) {
  int argc;
  int argv[2]={
    1,2
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_PositionIterator__SWIG_0(L);
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__PositionIterator, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_new_PositionIterator__SWIG_1(L);
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_PositionIterator'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::PositionIterator::PositionIterator()\n"
    "    Xapian::PositionIterator::PositionIterator(Xapian::PositionIterator const &)\n");
  lua_error(L);return 0;
}


static int _wrap_PositionIterator_get_termpos(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 0 ;
  Xapian::termpos result;
  
  SWIG_check_num_args("Xapian::PositionIterator::get_termpos",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PositionIterator::get_termpos",1,"Xapian::PositionIterator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PositionIterator,0))){
    SWIG_fail_ptr("PositionIterator_get_termpos",1,SWIGTYPE_p_Xapian__PositionIterator);
  }
  
  {
    try {
      result = (Xapian::termpos)Xapian_PositionIterator_get_termpos((Xapian::PositionIterator const *)arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_PositionIterator_next(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 0 ;
  
  SWIG_check_num_args("Xapian::PositionIterator::next",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PositionIterator::next",1,"Xapian::PositionIterator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PositionIterator,0))){
    SWIG_fail_ptr("PositionIterator_next",1,SWIGTYPE_p_Xapian__PositionIterator);
  }
  
  {
    try {
      Xapian_PositionIterator_next(arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_PositionIterator_equals(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 0 ;
  Xapian::PositionIterator *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("Xapian::PositionIterator::equals",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PositionIterator::equals",1,"Xapian::PositionIterator const *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::PositionIterator::equals",2,"Xapian::PositionIterator const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PositionIterator,0))){
    SWIG_fail_ptr("PositionIterator_equals",1,SWIGTYPE_p_Xapian__PositionIterator);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__PositionIterator,0))){
    SWIG_fail_ptr("PositionIterator_equals",2,SWIGTYPE_p_Xapian__PositionIterator);
  }
  
  {
    try {
      result = (bool)Xapian_PositionIterator_equals((Xapian::PositionIterator const *)arg1,(Xapian::PositionIterator const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_PositionIterator_skip_to(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 0 ;
  Xapian::termpos arg2 ;
  
  SWIG_check_num_args("Xapian::PositionIterator::skip_to",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PositionIterator::skip_to",1,"Xapian::PositionIterator *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::PositionIterator::skip_to",2,"Xapian::termpos");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PositionIterator,0))){
    SWIG_fail_ptr("PositionIterator_skip_to",1,SWIGTYPE_p_Xapian__PositionIterator);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::termpos)lua_tonumber(L, 2);
  {
    try {
      (arg1)->skip_to(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_PositionIterator___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::PositionIterator::get_description",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PositionIterator::get_description",1,"Xapian::PositionIterator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PositionIterator,0))){
    SWIG_fail_ptr("PositionIterator___tostring",1,SWIGTYPE_p_Xapian__PositionIterator);
  }
  
  {
    try {
      result = ((Xapian::PositionIterator const *)arg1)->get_description();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_PositionIterator(void *obj) {
Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_PositionIterator_methods[] = {
    {"get_termpos", _wrap_PositionIterator_get_termpos}, 
    {"next", _wrap_PositionIterator_next}, 
    {"equals", _wrap_PositionIterator_equals}, 
    {"skip_to", _wrap_PositionIterator_skip_to}, 
    {"__tostring", _wrap_PositionIterator___tostring}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_PositionIterator_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_PositionIterator_bases[] = {0};
static const char *swig_Xapian_PositionIterator_base_names[] = {0};
static swig_lua_class _wrap_class_Xapian_PositionIterator = { "PositionIterator", &SWIGTYPE_p_Xapian__PositionIterator,_wrap_new_PositionIterator, swig_delete_PositionIterator, swig_Xapian_PositionIterator_methods, swig_Xapian_PositionIterator_attributes, swig_Xapian_PositionIterator_bases, swig_Xapian_PositionIterator_base_names };

static int _wrap_new_PostingIterator__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PostingIterator *result = 0 ;
  
  SWIG_check_num_args("Xapian::PostingIterator::PostingIterator",0,0)
  {
    try {
      result = (Xapian::PostingIterator *)new Xapian::PostingIterator();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__PostingIterator,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_PostingIterator__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PostingIterator *arg1 = 0 ;
  Xapian::PostingIterator *result = 0 ;
  
  SWIG_check_num_args("Xapian::PostingIterator::PostingIterator",1,1)
  if(!lua_isuserdata(L,1)) SWIG_fail_arg("Xapian::PostingIterator::PostingIterator",1,"Xapian::PostingIterator const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PostingIterator,0))){
    SWIG_fail_ptr("new_PostingIterator",1,SWIGTYPE_p_Xapian__PostingIterator);
  }
  
  {
    try {
      result = (Xapian::PostingIterator *)new Xapian::PostingIterator((Xapian::PostingIterator const &)*arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__PostingIterator,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_PostingIterator(lua_State* L) {
  int argc;
  int argv[2]={
    1,2
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_PostingIterator__SWIG_0(L);
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__PostingIterator, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_new_PostingIterator__SWIG_1(L);
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_PostingIterator'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::PostingIterator::PostingIterator()\n"
    "    Xapian::PostingIterator::PostingIterator(Xapian::PostingIterator const &)\n");
  lua_error(L);return 0;
}


static int _wrap_PostingIterator_skip_to(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::docid arg2 ;
  
  SWIG_check_num_args("Xapian::PostingIterator::skip_to",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PostingIterator::skip_to",1,"Xapian::PostingIterator *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::PostingIterator::skip_to",2,"Xapian::docid");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PostingIterator,0))){
    SWIG_fail_ptr("PostingIterator_skip_to",1,SWIGTYPE_p_Xapian__PostingIterator);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::docid)lua_tonumber(L, 2);
  {
    try {
      (arg1)->skip_to(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_PostingIterator_get_doclength(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::termcount result;
  
  SWIG_check_num_args("Xapian::PostingIterator::get_doclength",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PostingIterator::get_doclength",1,"Xapian::PostingIterator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PostingIterator,0))){
    SWIG_fail_ptr("PostingIterator_get_doclength",1,SWIGTYPE_p_Xapian__PostingIterator);
  }
  
  {
    try {
      result = (Xapian::termcount)((Xapian::PostingIterator const *)arg1)->get_doclength();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_PostingIterator_get_wdf(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::termcount result;
  
  SWIG_check_num_args("Xapian::PostingIterator::get_wdf",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PostingIterator::get_wdf",1,"Xapian::PostingIterator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PostingIterator,0))){
    SWIG_fail_ptr("PostingIterator_get_wdf",1,SWIGTYPE_p_Xapian__PostingIterator);
  }
  
  {
    try {
      result = (Xapian::termcount)((Xapian::PostingIterator const *)arg1)->get_wdf();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_PostingIterator_positionlist_begin(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::PositionIterator result;
  
  SWIG_check_num_args("Xapian::PostingIterator::positionlist_begin",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PostingIterator::positionlist_begin",1,"Xapian::PostingIterator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PostingIterator,0))){
    SWIG_fail_ptr("PostingIterator_positionlist_begin",1,SWIGTYPE_p_Xapian__PostingIterator);
  }
  
  {
    try {
      result = ((Xapian::PostingIterator const *)arg1)->positionlist_begin();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::PositionIterator * resultptr = new Xapian::PositionIterator((const Xapian::PositionIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__PositionIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_PostingIterator_positionlist_end(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::PositionIterator result;
  
  SWIG_check_num_args("Xapian::PostingIterator::positionlist_end",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PostingIterator::positionlist_end",1,"Xapian::PostingIterator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PostingIterator,0))){
    SWIG_fail_ptr("PostingIterator_positionlist_end",1,SWIGTYPE_p_Xapian__PostingIterator);
  }
  
  {
    try {
      result = ((Xapian::PostingIterator const *)arg1)->positionlist_end();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::PositionIterator * resultptr = new Xapian::PositionIterator((const Xapian::PositionIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__PositionIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_PostingIterator___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::PostingIterator::get_description",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PostingIterator::get_description",1,"Xapian::PostingIterator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PostingIterator,0))){
    SWIG_fail_ptr("PostingIterator___tostring",1,SWIGTYPE_p_Xapian__PostingIterator);
  }
  
  {
    try {
      result = ((Xapian::PostingIterator const *)arg1)->get_description();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_PostingIterator_get_docid(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::docid result;
  
  SWIG_check_num_args("Xapian::PostingIterator::get_docid",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PostingIterator::get_docid",1,"Xapian::PostingIterator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PostingIterator,0))){
    SWIG_fail_ptr("PostingIterator_get_docid",1,SWIGTYPE_p_Xapian__PostingIterator);
  }
  
  {
    try {
      result = (Xapian::docid)Xapian_PostingIterator_get_docid((Xapian::PostingIterator const *)arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_PostingIterator_next(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  
  SWIG_check_num_args("Xapian::PostingIterator::next",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PostingIterator::next",1,"Xapian::PostingIterator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PostingIterator,0))){
    SWIG_fail_ptr("PostingIterator_next",1,SWIGTYPE_p_Xapian__PostingIterator);
  }
  
  {
    try {
      Xapian_PostingIterator_next(arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_PostingIterator_equals(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::PostingIterator *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("Xapian::PostingIterator::equals",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PostingIterator::equals",1,"Xapian::PostingIterator const *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::PostingIterator::equals",2,"Xapian::PostingIterator const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PostingIterator,0))){
    SWIG_fail_ptr("PostingIterator_equals",1,SWIGTYPE_p_Xapian__PostingIterator);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__PostingIterator,0))){
    SWIG_fail_ptr("PostingIterator_equals",2,SWIGTYPE_p_Xapian__PostingIterator);
  }
  
  {
    try {
      result = (bool)Xapian_PostingIterator_equals((Xapian::PostingIterator const *)arg1,(Xapian::PostingIterator const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_PostingIterator(void *obj) {
Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_PostingIterator_methods[] = {
    {"skip_to", _wrap_PostingIterator_skip_to}, 
    {"get_doclength", _wrap_PostingIterator_get_doclength}, 
    {"get_wdf", _wrap_PostingIterator_get_wdf}, 
    {"positionlist_begin", _wrap_PostingIterator_positionlist_begin}, 
    {"positionlist_end", _wrap_PostingIterator_positionlist_end}, 
    {"__tostring", _wrap_PostingIterator___tostring}, 
    {"get_docid", _wrap_PostingIterator_get_docid}, 
    {"next", _wrap_PostingIterator_next}, 
    {"equals", _wrap_PostingIterator_equals}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_PostingIterator_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_PostingIterator_bases[] = {0};
static const char *swig_Xapian_PostingIterator_base_names[] = {0};
static swig_lua_class _wrap_class_Xapian_PostingIterator = { "PostingIterator", &SWIGTYPE_p_Xapian__PostingIterator,_wrap_new_PostingIterator, swig_delete_PostingIterator, swig_Xapian_PostingIterator_methods, swig_Xapian_PostingIterator_attributes, swig_Xapian_PostingIterator_bases, swig_Xapian_PostingIterator_base_names };

static int _wrap___eq(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PostingIterator *arg1 = 0 ;
  Xapian::PostingIterator *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("Xapian::operator ==",2,2)
  if(!lua_isuserdata(L,1)) SWIG_fail_arg("Xapian::operator ==",1,"Xapian::PostingIterator const &");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::operator ==",2,"Xapian::PostingIterator const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PostingIterator,0))){
    SWIG_fail_ptr("__eq",1,SWIGTYPE_p_Xapian__PostingIterator);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__PostingIterator,0))){
    SWIG_fail_ptr("__eq",2,SWIGTYPE_p_Xapian__PostingIterator);
  }
  
  {
    try {
      result = (bool)Xapian::operator ==((Xapian::PostingIterator const &)*arg1,(Xapian::PostingIterator const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_TermIterator__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermIterator *result = 0 ;
  
  SWIG_check_num_args("Xapian::TermIterator::TermIterator",0,0)
  {
    try {
      result = (Xapian::TermIterator *)new Xapian::TermIterator();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_TermIterator__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermIterator *arg1 = 0 ;
  Xapian::TermIterator *result = 0 ;
  
  SWIG_check_num_args("Xapian::TermIterator::TermIterator",1,1)
  if(!lua_isuserdata(L,1)) SWIG_fail_arg("Xapian::TermIterator::TermIterator",1,"Xapian::TermIterator const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermIterator,0))){
    SWIG_fail_ptr("new_TermIterator",1,SWIGTYPE_p_Xapian__TermIterator);
  }
  
  {
    try {
      result = (Xapian::TermIterator *)new Xapian::TermIterator((Xapian::TermIterator const &)*arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_TermIterator(lua_State* L) {
  int argc;
  int argv[2]={
    1,2
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_TermIterator__SWIG_0(L);
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__TermIterator, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_new_TermIterator__SWIG_1(L);
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_TermIterator'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::TermIterator::TermIterator()\n"
    "    Xapian::TermIterator::TermIterator(Xapian::TermIterator const &)\n");
  lua_error(L);return 0;
}


static int _wrap_TermIterator_get_term(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::TermIterator::get_term",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TermIterator::get_term",1,"Xapian::TermIterator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermIterator,0))){
    SWIG_fail_ptr("TermIterator_get_term",1,SWIGTYPE_p_Xapian__TermIterator);
  }
  
  {
    try {
      result = Xapian_TermIterator_get_term((Xapian::TermIterator const *)arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TermIterator_next(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  
  SWIG_check_num_args("Xapian::TermIterator::next",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TermIterator::next",1,"Xapian::TermIterator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermIterator,0))){
    SWIG_fail_ptr("TermIterator_next",1,SWIGTYPE_p_Xapian__TermIterator);
  }
  
  {
    try {
      Xapian_TermIterator_next(arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TermIterator_equals(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  Xapian::TermIterator *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("Xapian::TermIterator::equals",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TermIterator::equals",1,"Xapian::TermIterator const *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::TermIterator::equals",2,"Xapian::TermIterator const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermIterator,0))){
    SWIG_fail_ptr("TermIterator_equals",1,SWIGTYPE_p_Xapian__TermIterator);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__TermIterator,0))){
    SWIG_fail_ptr("TermIterator_equals",2,SWIGTYPE_p_Xapian__TermIterator);
  }
  
  {
    try {
      result = (bool)Xapian_TermIterator_equals((Xapian::TermIterator const *)arg1,(Xapian::TermIterator const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TermIterator_skip_to(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::TermIterator::skip_to",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TermIterator::skip_to",1,"Xapian::TermIterator *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::TermIterator::skip_to",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermIterator,0))){
    SWIG_fail_ptr("TermIterator_skip_to",1,SWIGTYPE_p_Xapian__TermIterator);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      (arg1)->skip_to((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TermIterator_get_wdf(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  Xapian::termcount result;
  
  SWIG_check_num_args("Xapian::TermIterator::get_wdf",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TermIterator::get_wdf",1,"Xapian::TermIterator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermIterator,0))){
    SWIG_fail_ptr("TermIterator_get_wdf",1,SWIGTYPE_p_Xapian__TermIterator);
  }
  
  {
    try {
      result = (Xapian::termcount)((Xapian::TermIterator const *)arg1)->get_wdf();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TermIterator_get_termfreq(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  Xapian::doccount result;
  
  SWIG_check_num_args("Xapian::TermIterator::get_termfreq",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TermIterator::get_termfreq",1,"Xapian::TermIterator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermIterator,0))){
    SWIG_fail_ptr("TermIterator_get_termfreq",1,SWIGTYPE_p_Xapian__TermIterator);
  }
  
  {
    try {
      result = (Xapian::doccount)((Xapian::TermIterator const *)arg1)->get_termfreq();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TermIterator_positionlist_count(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  Xapian::termcount result;
  
  SWIG_check_num_args("Xapian::TermIterator::positionlist_count",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TermIterator::positionlist_count",1,"Xapian::TermIterator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermIterator,0))){
    SWIG_fail_ptr("TermIterator_positionlist_count",1,SWIGTYPE_p_Xapian__TermIterator);
  }
  
  {
    try {
      result = (Xapian::termcount)((Xapian::TermIterator const *)arg1)->positionlist_count();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TermIterator_positionlist_begin(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  Xapian::PositionIterator result;
  
  SWIG_check_num_args("Xapian::TermIterator::positionlist_begin",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TermIterator::positionlist_begin",1,"Xapian::TermIterator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermIterator,0))){
    SWIG_fail_ptr("TermIterator_positionlist_begin",1,SWIGTYPE_p_Xapian__TermIterator);
  }
  
  {
    try {
      result = (arg1)->positionlist_begin();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::PositionIterator * resultptr = new Xapian::PositionIterator((const Xapian::PositionIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__PositionIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TermIterator_positionlist_end(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  Xapian::PositionIterator result;
  
  SWIG_check_num_args("Xapian::TermIterator::positionlist_end",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TermIterator::positionlist_end",1,"Xapian::TermIterator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermIterator,0))){
    SWIG_fail_ptr("TermIterator_positionlist_end",1,SWIGTYPE_p_Xapian__TermIterator);
  }
  
  {
    try {
      result = (arg1)->positionlist_end();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::PositionIterator * resultptr = new Xapian::PositionIterator((const Xapian::PositionIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__PositionIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TermIterator___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::TermIterator::get_description",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TermIterator::get_description",1,"Xapian::TermIterator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermIterator,0))){
    SWIG_fail_ptr("TermIterator___tostring",1,SWIGTYPE_p_Xapian__TermIterator);
  }
  
  {
    try {
      result = ((Xapian::TermIterator const *)arg1)->get_description();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_TermIterator(void *obj) {
Xapian::TermIterator *arg1 = (Xapian::TermIterator *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_TermIterator_methods[] = {
    {"get_term", _wrap_TermIterator_get_term}, 
    {"next", _wrap_TermIterator_next}, 
    {"equals", _wrap_TermIterator_equals}, 
    {"skip_to", _wrap_TermIterator_skip_to}, 
    {"get_wdf", _wrap_TermIterator_get_wdf}, 
    {"get_termfreq", _wrap_TermIterator_get_termfreq}, 
    {"positionlist_count", _wrap_TermIterator_positionlist_count}, 
    {"positionlist_begin", _wrap_TermIterator_positionlist_begin}, 
    {"positionlist_end", _wrap_TermIterator_positionlist_end}, 
    {"__tostring", _wrap_TermIterator___tostring}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_TermIterator_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_TermIterator_bases[] = {0};
static const char *swig_Xapian_TermIterator_base_names[] = {0};
static swig_lua_class _wrap_class_Xapian_TermIterator = { "TermIterator", &SWIGTYPE_p_Xapian__TermIterator,_wrap_new_TermIterator, swig_delete_TermIterator, swig_Xapian_TermIterator_methods, swig_Xapian_TermIterator_attributes, swig_Xapian_TermIterator_bases, swig_Xapian_TermIterator_base_names };

static int _wrap_new_ValueIterator__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueIterator *result = 0 ;
  
  SWIG_check_num_args("Xapian::ValueIterator::ValueIterator",0,0)
  {
    try {
      result = (Xapian::ValueIterator *)new Xapian::ValueIterator();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__ValueIterator,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_ValueIterator__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueIterator *arg1 = 0 ;
  Xapian::ValueIterator *result = 0 ;
  
  SWIG_check_num_args("Xapian::ValueIterator::ValueIterator",1,1)
  if(!lua_isuserdata(L,1)) SWIG_fail_arg("Xapian::ValueIterator::ValueIterator",1,"Xapian::ValueIterator const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueIterator,0))){
    SWIG_fail_ptr("new_ValueIterator",1,SWIGTYPE_p_Xapian__ValueIterator);
  }
  
  {
    try {
      result = (Xapian::ValueIterator *)new Xapian::ValueIterator((Xapian::ValueIterator const &)*arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__ValueIterator,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_ValueIterator(lua_State* L) {
  int argc;
  int argv[2]={
    1,2
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_ValueIterator__SWIG_0(L);
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__ValueIterator, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_new_ValueIterator__SWIG_1(L);
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_ValueIterator'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::ValueIterator::ValueIterator()\n"
    "    Xapian::ValueIterator::ValueIterator(Xapian::ValueIterator const &)\n");
  lua_error(L);return 0;
}


static int _wrap_ValueIterator_get_value(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::ValueIterator::get_value",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueIterator::get_value",1,"Xapian::ValueIterator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueIterator,0))){
    SWIG_fail_ptr("ValueIterator_get_value",1,SWIGTYPE_p_Xapian__ValueIterator);
  }
  
  {
    try {
      result = Xapian_ValueIterator_get_value((Xapian::ValueIterator const *)arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValueIterator_next(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  
  SWIG_check_num_args("Xapian::ValueIterator::next",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueIterator::next",1,"Xapian::ValueIterator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueIterator,0))){
    SWIG_fail_ptr("ValueIterator_next",1,SWIGTYPE_p_Xapian__ValueIterator);
  }
  
  {
    try {
      Xapian_ValueIterator_next(arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValueIterator_equals(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  Xapian::ValueIterator *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("Xapian::ValueIterator::equals",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueIterator::equals",1,"Xapian::ValueIterator const *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::ValueIterator::equals",2,"Xapian::ValueIterator const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueIterator,0))){
    SWIG_fail_ptr("ValueIterator_equals",1,SWIGTYPE_p_Xapian__ValueIterator);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__ValueIterator,0))){
    SWIG_fail_ptr("ValueIterator_equals",2,SWIGTYPE_p_Xapian__ValueIterator);
  }
  
  {
    try {
      result = (bool)Xapian_ValueIterator_equals((Xapian::ValueIterator const *)arg1,(Xapian::ValueIterator const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValueIterator_get_docid(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  Xapian::docid result;
  
  SWIG_check_num_args("Xapian::ValueIterator::get_docid",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueIterator::get_docid",1,"Xapian::ValueIterator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueIterator,0))){
    SWIG_fail_ptr("ValueIterator_get_docid",1,SWIGTYPE_p_Xapian__ValueIterator);
  }
  
  {
    try {
      result = (Xapian::docid)((Xapian::ValueIterator const *)arg1)->get_docid();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValueIterator_get_valueno(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  Xapian::valueno result;
  
  SWIG_check_num_args("Xapian::ValueIterator::get_valueno",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueIterator::get_valueno",1,"Xapian::ValueIterator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueIterator,0))){
    SWIG_fail_ptr("ValueIterator_get_valueno",1,SWIGTYPE_p_Xapian__ValueIterator);
  }
  
  {
    try {
      result = (Xapian::valueno)((Xapian::ValueIterator const *)arg1)->get_valueno();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValueIterator_skip_to(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  Xapian::docid arg2 ;
  
  SWIG_check_num_args("Xapian::ValueIterator::skip_to",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueIterator::skip_to",1,"Xapian::ValueIterator *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::ValueIterator::skip_to",2,"Xapian::docid");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueIterator,0))){
    SWIG_fail_ptr("ValueIterator_skip_to",1,SWIGTYPE_p_Xapian__ValueIterator);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::docid)lua_tonumber(L, 2);
  {
    try {
      (arg1)->skip_to(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValueIterator_check(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  Xapian::docid arg2 ;
  bool result;
  
  SWIG_check_num_args("Xapian::ValueIterator::check",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueIterator::check",1,"Xapian::ValueIterator *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::ValueIterator::check",2,"Xapian::docid");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueIterator,0))){
    SWIG_fail_ptr("ValueIterator_check",1,SWIGTYPE_p_Xapian__ValueIterator);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::docid)lua_tonumber(L, 2);
  {
    try {
      result = (bool)(arg1)->check(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValueIterator___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::ValueIterator::get_description",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueIterator::get_description",1,"Xapian::ValueIterator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueIterator,0))){
    SWIG_fail_ptr("ValueIterator___tostring",1,SWIGTYPE_p_Xapian__ValueIterator);
  }
  
  {
    try {
      result = ((Xapian::ValueIterator const *)arg1)->get_description();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_ValueIterator(void *obj) {
Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_ValueIterator_methods[] = {
    {"get_value", _wrap_ValueIterator_get_value}, 
    {"next", _wrap_ValueIterator_next}, 
    {"equals", _wrap_ValueIterator_equals}, 
    {"get_docid", _wrap_ValueIterator_get_docid}, 
    {"get_valueno", _wrap_ValueIterator_get_valueno}, 
    {"skip_to", _wrap_ValueIterator_skip_to}, 
    {"check", _wrap_ValueIterator_check}, 
    {"__tostring", _wrap_ValueIterator___tostring}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_ValueIterator_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_ValueIterator_bases[] = {0};
static const char *swig_Xapian_ValueIterator_base_names[] = {0};
static swig_lua_class _wrap_class_Xapian_ValueIterator = { "ValueIterator", &SWIGTYPE_p_Xapian__ValueIterator,_wrap_new_ValueIterator, swig_delete_ValueIterator, swig_Xapian_ValueIterator_methods, swig_Xapian_ValueIterator_attributes, swig_Xapian_ValueIterator_bases, swig_Xapian_ValueIterator_base_names };

static int _wrap_new_Document__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Document *arg1 = 0 ;
  Xapian::Document *result = 0 ;
  
  SWIG_check_num_args("Xapian::Document::Document",1,1)
  if(!lua_isuserdata(L,1)) SWIG_fail_arg("Xapian::Document::Document",1,"Xapian::Document const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("new_Document",1,SWIGTYPE_p_Xapian__Document);
  }
  
  {
    try {
      result = (Xapian::Document *)new Xapian::Document((Xapian::Document const &)*arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__Document,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_Document__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Document *result = 0 ;
  
  SWIG_check_num_args("Xapian::Document::Document",0,0)
  {
    try {
      result = (Xapian::Document *)new Xapian::Document();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__Document,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_Document(lua_State* L) {
  int argc;
  int argv[2]={
    1,2
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_Document__SWIG_1(L);
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Document, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_new_Document__SWIG_0(L);
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_Document'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Document::Document(Xapian::Document const &)\n"
    "    Xapian::Document::Document()\n");
  lua_error(L);return 0;
}


static int _wrap_Document_get_value(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::valueno arg2 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::Document::get_value",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Document::get_value",1,"Xapian::Document const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Document::get_value",2,"Xapian::valueno");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("Document_get_value",1,SWIGTYPE_p_Xapian__Document);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::valueno)lua_tonumber(L, 2);
  {
    try {
      result = ((Xapian::Document const *)arg1)->get_value(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Document_add_value(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::valueno arg2 ;
  std::string *arg3 = 0 ;
  std::string temp3 ;
  
  SWIG_check_num_args("Xapian::Document::add_value",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Document::add_value",1,"Xapian::Document *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Document::add_value",2,"Xapian::valueno");
  if(!lua_isstring(L,3)) SWIG_fail_arg("Xapian::Document::add_value",3,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("Document_add_value",1,SWIGTYPE_p_Xapian__Document);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::valueno)lua_tonumber(L, 2);
  temp3.assign(lua_tostring(L,3),lua_rawlen(L,3)); arg3=&temp3;
  {
    try {
      (arg1)->add_value(arg2,(std::string const &)*arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Document_remove_value(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::valueno arg2 ;
  
  SWIG_check_num_args("Xapian::Document::remove_value",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Document::remove_value",1,"Xapian::Document *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Document::remove_value",2,"Xapian::valueno");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("Document_remove_value",1,SWIGTYPE_p_Xapian__Document);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::valueno)lua_tonumber(L, 2);
  {
    try {
      (arg1)->remove_value(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Document_clear_values(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  
  SWIG_check_num_args("Xapian::Document::clear_values",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Document::clear_values",1,"Xapian::Document *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("Document_clear_values",1,SWIGTYPE_p_Xapian__Document);
  }
  
  {
    try {
      (arg1)->clear_values();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Document_get_data(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::Document::get_data",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Document::get_data",1,"Xapian::Document const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("Document_get_data",1,SWIGTYPE_p_Xapian__Document);
  }
  
  {
    try {
      result = ((Xapian::Document const *)arg1)->get_data();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Document_set_data(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::Document::set_data",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Document::set_data",1,"Xapian::Document *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Document::set_data",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("Document_set_data",1,SWIGTYPE_p_Xapian__Document);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      (arg1)->set_data((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Document_add_posting__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termpos arg3 ;
  Xapian::termcount arg4 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::Document::add_posting",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Document::add_posting",1,"Xapian::Document *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Document::add_posting",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Document::add_posting",3,"Xapian::termpos");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::Document::add_posting",4,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("Document_add_posting",1,SWIGTYPE_p_Xapian__Document);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::termpos)lua_tonumber(L, 3);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (Xapian::termcount)lua_tonumber(L, 4);
  {
    try {
      (arg1)->add_posting((std::string const &)*arg2,arg3,arg4);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Document_add_posting__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termpos arg3 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::Document::add_posting",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Document::add_posting",1,"Xapian::Document *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Document::add_posting",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Document::add_posting",3,"Xapian::termpos");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("Document_add_posting",1,SWIGTYPE_p_Xapian__Document);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::termpos)lua_tonumber(L, 3);
  {
    try {
      (arg1)->add_posting((std::string const &)*arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Document_add_posting(lua_State* L) {
  int argc;
  int argv[5]={
    1,2,3,4,5
  };
  
  argc = lua_gettop(L);
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Document, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_Document_add_posting__SWIG_1(L);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Document, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          {
            _v = lua_isnumber(L,argv[3]);
          }
          if (_v) {
            return _wrap_Document_add_posting__SWIG_0(L);
          }
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'Document_add_posting'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Document::add_posting(std::string const &,Xapian::termpos,Xapian::termcount)\n"
    "    Xapian::Document::add_posting(std::string const &,Xapian::termpos)\n");
  lua_error(L);return 0;
}


static int _wrap_Document_add_term__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termcount arg3 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::Document::add_term",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Document::add_term",1,"Xapian::Document *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Document::add_term",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Document::add_term",3,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("Document_add_term",1,SWIGTYPE_p_Xapian__Document);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::termcount)lua_tonumber(L, 3);
  {
    try {
      (arg1)->add_term((std::string const &)*arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Document_add_term__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::Document::add_term",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Document::add_term",1,"Xapian::Document *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Document::add_term",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("Document_add_term",1,SWIGTYPE_p_Xapian__Document);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      (arg1)->add_term((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Document_add_term(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Document, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_Document_add_term__SWIG_1(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Document, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_Document_add_term__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'Document_add_term'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Document::add_term(std::string const &,Xapian::termcount)\n"
    "    Xapian::Document::add_term(std::string const &)\n");
  lua_error(L);return 0;
}


static int _wrap_Document_add_boolean_term(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::Document::add_boolean_term",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Document::add_boolean_term",1,"Xapian::Document *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Document::add_boolean_term",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("Document_add_boolean_term",1,SWIGTYPE_p_Xapian__Document);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      (arg1)->add_boolean_term((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Document_remove_posting__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termpos arg3 ;
  Xapian::termcount arg4 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::Document::remove_posting",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Document::remove_posting",1,"Xapian::Document *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Document::remove_posting",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Document::remove_posting",3,"Xapian::termpos");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::Document::remove_posting",4,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("Document_remove_posting",1,SWIGTYPE_p_Xapian__Document);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::termpos)lua_tonumber(L, 3);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (Xapian::termcount)lua_tonumber(L, 4);
  {
    try {
      (arg1)->remove_posting((std::string const &)*arg2,arg3,arg4);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Document_remove_posting__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termpos arg3 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::Document::remove_posting",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Document::remove_posting",1,"Xapian::Document *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Document::remove_posting",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Document::remove_posting",3,"Xapian::termpos");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("Document_remove_posting",1,SWIGTYPE_p_Xapian__Document);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::termpos)lua_tonumber(L, 3);
  {
    try {
      (arg1)->remove_posting((std::string const &)*arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Document_remove_posting(lua_State* L) {
  int argc;
  int argv[5]={
    1,2,3,4,5
  };
  
  argc = lua_gettop(L);
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Document, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_Document_remove_posting__SWIG_1(L);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Document, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          {
            _v = lua_isnumber(L,argv[3]);
          }
          if (_v) {
            return _wrap_Document_remove_posting__SWIG_0(L);
          }
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'Document_remove_posting'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Document::remove_posting(std::string const &,Xapian::termpos,Xapian::termcount)\n"
    "    Xapian::Document::remove_posting(std::string const &,Xapian::termpos)\n");
  lua_error(L);return 0;
}


static int _wrap_Document_remove_term(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::Document::remove_term",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Document::remove_term",1,"Xapian::Document *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Document::remove_term",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("Document_remove_term",1,SWIGTYPE_p_Xapian__Document);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      (arg1)->remove_term((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Document_clear_terms(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  
  SWIG_check_num_args("Xapian::Document::clear_terms",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Document::clear_terms",1,"Xapian::Document *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("Document_clear_terms",1,SWIGTYPE_p_Xapian__Document);
  }
  
  {
    try {
      (arg1)->clear_terms();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Document_termlist_count(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::termcount result;
  
  SWIG_check_num_args("Xapian::Document::termlist_count",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Document::termlist_count",1,"Xapian::Document const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("Document_termlist_count",1,SWIGTYPE_p_Xapian__Document);
  }
  
  {
    try {
      result = (Xapian::termcount)((Xapian::Document const *)arg1)->termlist_count();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Document_termlist_begin(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::Document::termlist_begin",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Document::termlist_begin",1,"Xapian::Document const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("Document_termlist_begin",1,SWIGTYPE_p_Xapian__Document);
  }
  
  {
    try {
      result = ((Xapian::Document const *)arg1)->termlist_begin();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Document_termlist_end(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::Document::termlist_end",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Document::termlist_end",1,"Xapian::Document const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("Document_termlist_end",1,SWIGTYPE_p_Xapian__Document);
  }
  
  {
    try {
      result = ((Xapian::Document const *)arg1)->termlist_end();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Document_values_count(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::termcount result;
  
  SWIG_check_num_args("Xapian::Document::values_count",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Document::values_count",1,"Xapian::Document const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("Document_values_count",1,SWIGTYPE_p_Xapian__Document);
  }
  
  {
    try {
      result = (Xapian::termcount)((Xapian::Document const *)arg1)->values_count();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Document_values_begin(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::ValueIterator result;
  
  SWIG_check_num_args("Xapian::Document::values_begin",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Document::values_begin",1,"Xapian::Document const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("Document_values_begin",1,SWIGTYPE_p_Xapian__Document);
  }
  
  {
    try {
      result = ((Xapian::Document const *)arg1)->values_begin();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::ValueIterator * resultptr = new Xapian::ValueIterator((const Xapian::ValueIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__ValueIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Document_values_end(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::ValueIterator result;
  
  SWIG_check_num_args("Xapian::Document::values_end",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Document::values_end",1,"Xapian::Document const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("Document_values_end",1,SWIGTYPE_p_Xapian__Document);
  }
  
  {
    try {
      result = ((Xapian::Document const *)arg1)->values_end();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::ValueIterator * resultptr = new Xapian::ValueIterator((const Xapian::ValueIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__ValueIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Document_get_docid(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::docid result;
  
  SWIG_check_num_args("Xapian::Document::get_docid",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Document::get_docid",1,"Xapian::Document const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("Document_get_docid",1,SWIGTYPE_p_Xapian__Document);
  }
  
  {
    try {
      result = (Xapian::docid)((Xapian::Document const *)arg1)->get_docid();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Document_serialise(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::Document::serialise",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Document::serialise",1,"Xapian::Document const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("Document_serialise",1,SWIGTYPE_p_Xapian__Document);
  }
  
  {
    try {
      result = ((Xapian::Document const *)arg1)->serialise();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Document_unserialise(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string temp1 ;
  Xapian::Document result;
  
  SWIG_check_num_args("Xapian::Document::unserialise",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::Document::unserialise",1,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  {
    try {
      result = Xapian::Document::unserialise((std::string const &)*arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::Document * resultptr = new Xapian::Document((const Xapian::Document &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__Document,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Document___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::Document::get_description",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Document::get_description",1,"Xapian::Document const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("Document___tostring",1,SWIGTYPE_p_Xapian__Document);
  }
  
  {
    try {
      result = ((Xapian::Document const *)arg1)->get_description();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Document_termlist(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::pair< Xapian::TermIterator,Xapian::TermIterator > result;
  
  SWIG_check_num_args("Xapian::Document::termlist",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Document::termlist",1,"Xapian::Document *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("Document_termlist",1,SWIGTYPE_p_Xapian__Document);
  }
  
  result = Xapian_Document_termlist(arg1);
  {
    lua_getglobal(L, "xapian");
    lua_pushstring(L, "Iterator");
    lua_gettable(L, -2);
    lua_remove(L, -2);
    
    if (!lua_isfunction(L, -1)) {
      luaL_typerror(L, -1, "function");
    }
    
    Xapian::TermIterator * begin = new Xapian::TermIterator((const Xapian::TermIterator &)(&result)->first);
    SWIG_NewPointerObj(L, (void *) begin, SWIGTYPE_p_Xapian__TermIterator, 1);
    
    Xapian::TermIterator * end = new Xapian::TermIterator((const Xapian::TermIterator &)(&result)->second);
    SWIG_NewPointerObj(L, (void *) end, SWIGTYPE_p_Xapian__TermIterator, 1);
    
    if (lua_pcall(L, 2, 1, 0) != 0) {
      luaL_error(L, "error running function: %s", lua_tostring(L, -1));
    }
    
    SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Document_values(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  SwigValueWrapper< std::pair< Xapian::ValueIterator,Xapian::ValueIterator > > result;
  
  SWIG_check_num_args("Xapian::Document::values",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Document::values",1,"Xapian::Document *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("Document_values",1,SWIGTYPE_p_Xapian__Document);
  }
  
  result = Xapian_Document_values(arg1);
  {
    lua_getglobal(L, "xapian");
    lua_pushstring(L, "Iterator");
    lua_gettable(L, -2);
    lua_remove(L, -2);
    
    if (!lua_isfunction(L, -1)) {
      luaL_typerror(L, -1, "function");
    }
    
    Xapian::ValueIterator * begin = new Xapian::ValueIterator((const Xapian::ValueIterator &)(&result)->first);
    SWIG_NewPointerObj(L, (void *) begin, SWIGTYPE_p_Xapian__ValueIterator, 1);
    
    Xapian::ValueIterator * end = new Xapian::ValueIterator((const Xapian::ValueIterator &)(&result)->second);
    SWIG_NewPointerObj(L, (void *) end, SWIGTYPE_p_Xapian__ValueIterator, 1);
    
    if (lua_pcall(L, 2, 1, 0) != 0) {
      luaL_error(L, "error running function: %s", lua_tostring(L, -1));
    }
    
    SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_Document(void *obj) {
Xapian::Document *arg1 = (Xapian::Document *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_Document_methods[] = {
    {"get_value", _wrap_Document_get_value}, 
    {"add_value", _wrap_Document_add_value}, 
    {"remove_value", _wrap_Document_remove_value}, 
    {"clear_values", _wrap_Document_clear_values}, 
    {"get_data", _wrap_Document_get_data}, 
    {"set_data", _wrap_Document_set_data}, 
    {"add_posting", _wrap_Document_add_posting}, 
    {"add_term", _wrap_Document_add_term}, 
    {"add_boolean_term", _wrap_Document_add_boolean_term}, 
    {"remove_posting", _wrap_Document_remove_posting}, 
    {"remove_term", _wrap_Document_remove_term}, 
    {"clear_terms", _wrap_Document_clear_terms}, 
    {"termlist_count", _wrap_Document_termlist_count}, 
    {"termlist_begin", _wrap_Document_termlist_begin}, 
    {"termlist_end", _wrap_Document_termlist_end}, 
    {"values_count", _wrap_Document_values_count}, 
    {"values_begin", _wrap_Document_values_begin}, 
    {"values_end", _wrap_Document_values_end}, 
    {"get_docid", _wrap_Document_get_docid}, 
    {"serialise", _wrap_Document_serialise}, 
    {"__tostring", _wrap_Document___tostring}, 
    {"termlist", _wrap_Document_termlist}, 
    {"values", _wrap_Document_values}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_Document_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_Document_bases[] = {0};
static const char *swig_Xapian_Document_base_names[] = {0};
static swig_lua_class _wrap_class_Xapian_Document = { "Document", &SWIGTYPE_p_Xapian__Document,_wrap_new_Document, swig_delete_Document, swig_Xapian_Document_methods, swig_Xapian_Document_attributes, swig_Xapian_Document_bases, swig_Xapian_Document_base_names };

static int _wrap_PostingSource_get_termfreq_min(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  Xapian::doccount result;
  
  SWIG_check_num_args("Xapian::PostingSource::get_termfreq_min",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PostingSource::get_termfreq_min",1,"Xapian::PostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PostingSource,0))){
    SWIG_fail_ptr("PostingSource_get_termfreq_min",1,SWIGTYPE_p_Xapian__PostingSource);
  }
  
  {
    try {
      result = (Xapian::doccount)((Xapian::PostingSource const *)arg1)->get_termfreq_min();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_PostingSource_get_termfreq_est(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  Xapian::doccount result;
  
  SWIG_check_num_args("Xapian::PostingSource::get_termfreq_est",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PostingSource::get_termfreq_est",1,"Xapian::PostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PostingSource,0))){
    SWIG_fail_ptr("PostingSource_get_termfreq_est",1,SWIGTYPE_p_Xapian__PostingSource);
  }
  
  {
    try {
      result = (Xapian::doccount)((Xapian::PostingSource const *)arg1)->get_termfreq_est();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_PostingSource_get_termfreq_max(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  Xapian::doccount result;
  
  SWIG_check_num_args("Xapian::PostingSource::get_termfreq_max",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PostingSource::get_termfreq_max",1,"Xapian::PostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PostingSource,0))){
    SWIG_fail_ptr("PostingSource_get_termfreq_max",1,SWIGTYPE_p_Xapian__PostingSource);
  }
  
  {
    try {
      result = (Xapian::doccount)((Xapian::PostingSource const *)arg1)->get_termfreq_max();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_PostingSource_get_maxweight(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  Xapian::weight result;
  
  SWIG_check_num_args("Xapian::PostingSource::get_maxweight",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PostingSource::get_maxweight",1,"Xapian::PostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PostingSource,0))){
    SWIG_fail_ptr("PostingSource_get_maxweight",1,SWIGTYPE_p_Xapian__PostingSource);
  }
  
  {
    try {
      result = (Xapian::weight)((Xapian::PostingSource const *)arg1)->get_maxweight();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_PostingSource_get_weight(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  Xapian::weight result;
  
  SWIG_check_num_args("Xapian::PostingSource::get_weight",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PostingSource::get_weight",1,"Xapian::PostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PostingSource,0))){
    SWIG_fail_ptr("PostingSource_get_weight",1,SWIGTYPE_p_Xapian__PostingSource);
  }
  
  {
    try {
      result = (Xapian::weight)((Xapian::PostingSource const *)arg1)->get_weight();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_PostingSource_get_docid(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  Xapian::docid result;
  
  SWIG_check_num_args("Xapian::PostingSource::get_docid",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PostingSource::get_docid",1,"Xapian::PostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PostingSource,0))){
    SWIG_fail_ptr("PostingSource_get_docid",1,SWIGTYPE_p_Xapian__PostingSource);
  }
  
  {
    try {
      result = (Xapian::docid)((Xapian::PostingSource const *)arg1)->get_docid();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_PostingSource_next(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  Xapian::weight arg2 ;
  
  SWIG_check_num_args("Xapian::PostingSource::next",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PostingSource::next",1,"Xapian::PostingSource *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::PostingSource::next",2,"Xapian::weight");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PostingSource,0))){
    SWIG_fail_ptr("PostingSource_next",1,SWIGTYPE_p_Xapian__PostingSource);
  }
  
  arg2 = (Xapian::weight)lua_tonumber(L, 2);
  {
    try {
      (arg1)->next(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_PostingSource_skip_to(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  Xapian::docid arg2 ;
  Xapian::weight arg3 ;
  
  SWIG_check_num_args("Xapian::PostingSource::skip_to",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PostingSource::skip_to",1,"Xapian::PostingSource *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::PostingSource::skip_to",2,"Xapian::docid");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::PostingSource::skip_to",3,"Xapian::weight");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PostingSource,0))){
    SWIG_fail_ptr("PostingSource_skip_to",1,SWIGTYPE_p_Xapian__PostingSource);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::docid)lua_tonumber(L, 2);
  arg3 = (Xapian::weight)lua_tonumber(L, 3);
  {
    try {
      (arg1)->skip_to(arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_PostingSource_check(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  Xapian::docid arg2 ;
  Xapian::weight arg3 ;
  bool result;
  
  SWIG_check_num_args("Xapian::PostingSource::check",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PostingSource::check",1,"Xapian::PostingSource *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::PostingSource::check",2,"Xapian::docid");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::PostingSource::check",3,"Xapian::weight");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PostingSource,0))){
    SWIG_fail_ptr("PostingSource_check",1,SWIGTYPE_p_Xapian__PostingSource);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::docid)lua_tonumber(L, 2);
  arg3 = (Xapian::weight)lua_tonumber(L, 3);
  {
    try {
      result = (bool)(arg1)->check(arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_PostingSource_at_end(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  bool result;
  
  SWIG_check_num_args("Xapian::PostingSource::at_end",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PostingSource::at_end",1,"Xapian::PostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PostingSource,0))){
    SWIG_fail_ptr("PostingSource_at_end",1,SWIGTYPE_p_Xapian__PostingSource);
  }
  
  {
    try {
      result = (bool)((Xapian::PostingSource const *)arg1)->at_end();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_PostingSource_name(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::PostingSource::name",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PostingSource::name",1,"Xapian::PostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PostingSource,0))){
    SWIG_fail_ptr("PostingSource_name",1,SWIGTYPE_p_Xapian__PostingSource);
  }
  
  {
    try {
      result = ((Xapian::PostingSource const *)arg1)->name();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_PostingSource_init(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  Xapian::Database *arg2 = 0 ;
  
  SWIG_check_num_args("Xapian::PostingSource::init",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PostingSource::init",1,"Xapian::PostingSource *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::PostingSource::init",2,"Xapian::Database const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PostingSource,0))){
    SWIG_fail_ptr("PostingSource_init",1,SWIGTYPE_p_Xapian__PostingSource);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("PostingSource_init",2,SWIGTYPE_p_Xapian__Database);
  }
  
  {
    try {
      (arg1)->init((Xapian::Database const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_PostingSource___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::PostingSource::get_description",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PostingSource::get_description",1,"Xapian::PostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PostingSource,0))){
    SWIG_fail_ptr("PostingSource___tostring",1,SWIGTYPE_p_Xapian__PostingSource);
  }
  
  {
    try {
      result = ((Xapian::PostingSource const *)arg1)->get_description();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_PostingSource(void *obj) {
Xapian::PostingSource *arg1 = (Xapian::PostingSource *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_PostingSource_methods[] = {
    {"get_termfreq_min", _wrap_PostingSource_get_termfreq_min}, 
    {"get_termfreq_est", _wrap_PostingSource_get_termfreq_est}, 
    {"get_termfreq_max", _wrap_PostingSource_get_termfreq_max}, 
    {"get_maxweight", _wrap_PostingSource_get_maxweight}, 
    {"get_weight", _wrap_PostingSource_get_weight}, 
    {"get_docid", _wrap_PostingSource_get_docid}, 
    {"next", _wrap_PostingSource_next}, 
    {"skip_to", _wrap_PostingSource_skip_to}, 
    {"check", _wrap_PostingSource_check}, 
    {"at_end", _wrap_PostingSource_at_end}, 
    {"name", _wrap_PostingSource_name}, 
    {"init", _wrap_PostingSource_init}, 
    {"__tostring", _wrap_PostingSource___tostring}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_PostingSource_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_PostingSource_bases[] = {0};
static const char *swig_Xapian_PostingSource_base_names[] = {0};
static swig_lua_class _wrap_class_Xapian_PostingSource = { "PostingSource", &SWIGTYPE_p_Xapian__PostingSource,0, swig_delete_PostingSource, swig_Xapian_PostingSource_methods, swig_Xapian_PostingSource_attributes, swig_Xapian_PostingSource_bases, swig_Xapian_PostingSource_base_names };

static int _wrap_new_ValuePostingSource(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  Xapian::ValuePostingSource *result = 0 ;
  
  SWIG_check_num_args("Xapian::ValuePostingSource::ValuePostingSource",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::ValuePostingSource::ValuePostingSource",1,"Xapian::valueno");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  {
    try {
      result = (Xapian::ValuePostingSource *)new Xapian::ValuePostingSource(arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__ValuePostingSource,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValuePostingSource_get_termfreq_min(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  Xapian::doccount result;
  
  SWIG_check_num_args("Xapian::ValuePostingSource::get_termfreq_min",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValuePostingSource::get_termfreq_min",1,"Xapian::ValuePostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValuePostingSource,0))){
    SWIG_fail_ptr("ValuePostingSource_get_termfreq_min",1,SWIGTYPE_p_Xapian__ValuePostingSource);
  }
  
  {
    try {
      result = (Xapian::doccount)((Xapian::ValuePostingSource const *)arg1)->get_termfreq_min();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValuePostingSource_get_termfreq_est(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  Xapian::doccount result;
  
  SWIG_check_num_args("Xapian::ValuePostingSource::get_termfreq_est",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValuePostingSource::get_termfreq_est",1,"Xapian::ValuePostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValuePostingSource,0))){
    SWIG_fail_ptr("ValuePostingSource_get_termfreq_est",1,SWIGTYPE_p_Xapian__ValuePostingSource);
  }
  
  {
    try {
      result = (Xapian::doccount)((Xapian::ValuePostingSource const *)arg1)->get_termfreq_est();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValuePostingSource_get_termfreq_max(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  Xapian::doccount result;
  
  SWIG_check_num_args("Xapian::ValuePostingSource::get_termfreq_max",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValuePostingSource::get_termfreq_max",1,"Xapian::ValuePostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValuePostingSource,0))){
    SWIG_fail_ptr("ValuePostingSource_get_termfreq_max",1,SWIGTYPE_p_Xapian__ValuePostingSource);
  }
  
  {
    try {
      result = (Xapian::doccount)((Xapian::ValuePostingSource const *)arg1)->get_termfreq_max();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValuePostingSource_next(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  Xapian::weight arg2 ;
  
  SWIG_check_num_args("Xapian::ValuePostingSource::next",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValuePostingSource::next",1,"Xapian::ValuePostingSource *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::ValuePostingSource::next",2,"Xapian::weight");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValuePostingSource,0))){
    SWIG_fail_ptr("ValuePostingSource_next",1,SWIGTYPE_p_Xapian__ValuePostingSource);
  }
  
  arg2 = (Xapian::weight)lua_tonumber(L, 2);
  {
    try {
      (arg1)->next(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValuePostingSource_skip_to(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  Xapian::docid arg2 ;
  Xapian::weight arg3 ;
  
  SWIG_check_num_args("Xapian::ValuePostingSource::skip_to",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValuePostingSource::skip_to",1,"Xapian::ValuePostingSource *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::ValuePostingSource::skip_to",2,"Xapian::docid");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::ValuePostingSource::skip_to",3,"Xapian::weight");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValuePostingSource,0))){
    SWIG_fail_ptr("ValuePostingSource_skip_to",1,SWIGTYPE_p_Xapian__ValuePostingSource);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::docid)lua_tonumber(L, 2);
  arg3 = (Xapian::weight)lua_tonumber(L, 3);
  {
    try {
      (arg1)->skip_to(arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValuePostingSource_check(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  Xapian::docid arg2 ;
  Xapian::weight arg3 ;
  bool result;
  
  SWIG_check_num_args("Xapian::ValuePostingSource::check",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValuePostingSource::check",1,"Xapian::ValuePostingSource *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::ValuePostingSource::check",2,"Xapian::docid");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::ValuePostingSource::check",3,"Xapian::weight");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValuePostingSource,0))){
    SWIG_fail_ptr("ValuePostingSource_check",1,SWIGTYPE_p_Xapian__ValuePostingSource);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::docid)lua_tonumber(L, 2);
  arg3 = (Xapian::weight)lua_tonumber(L, 3);
  {
    try {
      result = (bool)(arg1)->check(arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValuePostingSource_at_end(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  bool result;
  
  SWIG_check_num_args("Xapian::ValuePostingSource::at_end",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValuePostingSource::at_end",1,"Xapian::ValuePostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValuePostingSource,0))){
    SWIG_fail_ptr("ValuePostingSource_at_end",1,SWIGTYPE_p_Xapian__ValuePostingSource);
  }
  
  {
    try {
      result = (bool)((Xapian::ValuePostingSource const *)arg1)->at_end();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValuePostingSource_get_docid(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  Xapian::docid result;
  
  SWIG_check_num_args("Xapian::ValuePostingSource::get_docid",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValuePostingSource::get_docid",1,"Xapian::ValuePostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValuePostingSource,0))){
    SWIG_fail_ptr("ValuePostingSource_get_docid",1,SWIGTYPE_p_Xapian__ValuePostingSource);
  }
  
  {
    try {
      result = (Xapian::docid)((Xapian::ValuePostingSource const *)arg1)->get_docid();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValuePostingSource_init(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  Xapian::Database *arg2 = 0 ;
  
  SWIG_check_num_args("Xapian::ValuePostingSource::init",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValuePostingSource::init",1,"Xapian::ValuePostingSource *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::ValuePostingSource::init",2,"Xapian::Database const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValuePostingSource,0))){
    SWIG_fail_ptr("ValuePostingSource_init",1,SWIGTYPE_p_Xapian__ValuePostingSource);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("ValuePostingSource_init",2,SWIGTYPE_p_Xapian__Database);
  }
  
  {
    try {
      (arg1)->init((Xapian::Database const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValuePostingSource_get_database(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  Xapian::Database result;
  
  SWIG_check_num_args("Xapian::ValuePostingSource::get_database",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValuePostingSource::get_database",1,"Xapian::ValuePostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValuePostingSource,0))){
    SWIG_fail_ptr("ValuePostingSource_get_database",1,SWIGTYPE_p_Xapian__ValuePostingSource);
  }
  
  {
    try {
      result = ((Xapian::ValuePostingSource const *)arg1)->get_database();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::Database * resultptr = new Xapian::Database((const Xapian::Database &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__Database,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValuePostingSource_get_slot(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  Xapian::valueno result;
  
  SWIG_check_num_args("Xapian::ValuePostingSource::get_slot",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValuePostingSource::get_slot",1,"Xapian::ValuePostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValuePostingSource,0))){
    SWIG_fail_ptr("ValuePostingSource_get_slot",1,SWIGTYPE_p_Xapian__ValuePostingSource);
  }
  
  {
    try {
      result = (Xapian::valueno)((Xapian::ValuePostingSource const *)arg1)->get_slot();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValuePostingSource_get_value(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::ValuePostingSource::get_value",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValuePostingSource::get_value",1,"Xapian::ValuePostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValuePostingSource,0))){
    SWIG_fail_ptr("ValuePostingSource_get_value",1,SWIGTYPE_p_Xapian__ValuePostingSource);
  }
  
  {
    try {
      result = ((Xapian::ValuePostingSource const *)arg1)->get_value();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValuePostingSource_done(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  
  SWIG_check_num_args("Xapian::ValuePostingSource::done",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValuePostingSource::done",1,"Xapian::ValuePostingSource *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValuePostingSource,0))){
    SWIG_fail_ptr("ValuePostingSource_done",1,SWIGTYPE_p_Xapian__ValuePostingSource);
  }
  
  {
    try {
      (arg1)->done();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValuePostingSource_get_started(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  bool result;
  
  SWIG_check_num_args("Xapian::ValuePostingSource::get_started",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValuePostingSource::get_started",1,"Xapian::ValuePostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValuePostingSource,0))){
    SWIG_fail_ptr("ValuePostingSource_get_started",1,SWIGTYPE_p_Xapian__ValuePostingSource);
  }
  
  {
    try {
      result = (bool)((Xapian::ValuePostingSource const *)arg1)->get_started();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValuePostingSource_set_termfreq_min(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  Xapian::doccount arg2 ;
  
  SWIG_check_num_args("Xapian::ValuePostingSource::set_termfreq_min",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValuePostingSource::set_termfreq_min",1,"Xapian::ValuePostingSource *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::ValuePostingSource::set_termfreq_min",2,"Xapian::doccount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValuePostingSource,0))){
    SWIG_fail_ptr("ValuePostingSource_set_termfreq_min",1,SWIGTYPE_p_Xapian__ValuePostingSource);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::doccount)lua_tonumber(L, 2);
  {
    try {
      (arg1)->set_termfreq_min(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValuePostingSource_set_termfreq_est(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  Xapian::doccount arg2 ;
  
  SWIG_check_num_args("Xapian::ValuePostingSource::set_termfreq_est",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValuePostingSource::set_termfreq_est",1,"Xapian::ValuePostingSource *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::ValuePostingSource::set_termfreq_est",2,"Xapian::doccount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValuePostingSource,0))){
    SWIG_fail_ptr("ValuePostingSource_set_termfreq_est",1,SWIGTYPE_p_Xapian__ValuePostingSource);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::doccount)lua_tonumber(L, 2);
  {
    try {
      (arg1)->set_termfreq_est(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValuePostingSource_set_termfreq_max(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  Xapian::doccount arg2 ;
  
  SWIG_check_num_args("Xapian::ValuePostingSource::set_termfreq_max",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValuePostingSource::set_termfreq_max",1,"Xapian::ValuePostingSource *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::ValuePostingSource::set_termfreq_max",2,"Xapian::doccount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValuePostingSource,0))){
    SWIG_fail_ptr("ValuePostingSource_set_termfreq_max",1,SWIGTYPE_p_Xapian__ValuePostingSource);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::doccount)lua_tonumber(L, 2);
  {
    try {
      (arg1)->set_termfreq_max(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_ValuePostingSource(void *obj) {
Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_ValuePostingSource_methods[] = {
    {"get_termfreq_min", _wrap_ValuePostingSource_get_termfreq_min}, 
    {"get_termfreq_est", _wrap_ValuePostingSource_get_termfreq_est}, 
    {"get_termfreq_max", _wrap_ValuePostingSource_get_termfreq_max}, 
    {"next", _wrap_ValuePostingSource_next}, 
    {"skip_to", _wrap_ValuePostingSource_skip_to}, 
    {"check", _wrap_ValuePostingSource_check}, 
    {"at_end", _wrap_ValuePostingSource_at_end}, 
    {"get_docid", _wrap_ValuePostingSource_get_docid}, 
    {"init", _wrap_ValuePostingSource_init}, 
    {"get_database", _wrap_ValuePostingSource_get_database}, 
    {"get_slot", _wrap_ValuePostingSource_get_slot}, 
    {"get_value", _wrap_ValuePostingSource_get_value}, 
    {"done", _wrap_ValuePostingSource_done}, 
    {"get_started", _wrap_ValuePostingSource_get_started}, 
    {"set_termfreq_min", _wrap_ValuePostingSource_set_termfreq_min}, 
    {"set_termfreq_est", _wrap_ValuePostingSource_set_termfreq_est}, 
    {"set_termfreq_max", _wrap_ValuePostingSource_set_termfreq_max}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_ValuePostingSource_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_ValuePostingSource_bases[] = {0,0};
static const char *swig_Xapian_ValuePostingSource_base_names[] = {"Xapian::PostingSource *",0};
static swig_lua_class _wrap_class_Xapian_ValuePostingSource = { "ValuePostingSource", &SWIGTYPE_p_Xapian__ValuePostingSource,_wrap_new_ValuePostingSource, swig_delete_ValuePostingSource, swig_Xapian_ValuePostingSource_methods, swig_Xapian_ValuePostingSource_attributes, swig_Xapian_ValuePostingSource_bases, swig_Xapian_ValuePostingSource_base_names };

static int _wrap_new_ValueWeightPostingSource(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  Xapian::ValueWeightPostingSource *result = 0 ;
  
  SWIG_check_num_args("Xapian::ValueWeightPostingSource::ValueWeightPostingSource",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::ValueWeightPostingSource::ValueWeightPostingSource",1,"Xapian::valueno");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  {
    try {
      result = (Xapian::ValueWeightPostingSource *)new Xapian::ValueWeightPostingSource(arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__ValueWeightPostingSource,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValueWeightPostingSource_get_weight(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueWeightPostingSource *arg1 = (Xapian::ValueWeightPostingSource *) 0 ;
  Xapian::weight result;
  
  SWIG_check_num_args("Xapian::ValueWeightPostingSource::get_weight",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueWeightPostingSource::get_weight",1,"Xapian::ValueWeightPostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueWeightPostingSource,0))){
    SWIG_fail_ptr("ValueWeightPostingSource_get_weight",1,SWIGTYPE_p_Xapian__ValueWeightPostingSource);
  }
  
  {
    try {
      result = (Xapian::weight)((Xapian::ValueWeightPostingSource const *)arg1)->get_weight();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValueWeightPostingSource_name(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueWeightPostingSource *arg1 = (Xapian::ValueWeightPostingSource *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::ValueWeightPostingSource::name",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueWeightPostingSource::name",1,"Xapian::ValueWeightPostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueWeightPostingSource,0))){
    SWIG_fail_ptr("ValueWeightPostingSource_name",1,SWIGTYPE_p_Xapian__ValueWeightPostingSource);
  }
  
  {
    try {
      result = ((Xapian::ValueWeightPostingSource const *)arg1)->name();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValueWeightPostingSource_init(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueWeightPostingSource *arg1 = (Xapian::ValueWeightPostingSource *) 0 ;
  Xapian::Database *arg2 = 0 ;
  
  SWIG_check_num_args("Xapian::ValueWeightPostingSource::init",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueWeightPostingSource::init",1,"Xapian::ValueWeightPostingSource *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::ValueWeightPostingSource::init",2,"Xapian::Database const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueWeightPostingSource,0))){
    SWIG_fail_ptr("ValueWeightPostingSource_init",1,SWIGTYPE_p_Xapian__ValueWeightPostingSource);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("ValueWeightPostingSource_init",2,SWIGTYPE_p_Xapian__Database);
  }
  
  {
    try {
      (arg1)->init((Xapian::Database const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValueWeightPostingSource___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueWeightPostingSource *arg1 = (Xapian::ValueWeightPostingSource *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::ValueWeightPostingSource::get_description",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueWeightPostingSource::get_description",1,"Xapian::ValueWeightPostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueWeightPostingSource,0))){
    SWIG_fail_ptr("ValueWeightPostingSource___tostring",1,SWIGTYPE_p_Xapian__ValueWeightPostingSource);
  }
  
  {
    try {
      result = ((Xapian::ValueWeightPostingSource const *)arg1)->get_description();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_ValueWeightPostingSource(void *obj) {
Xapian::ValueWeightPostingSource *arg1 = (Xapian::ValueWeightPostingSource *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_ValueWeightPostingSource_methods[] = {
    {"get_weight", _wrap_ValueWeightPostingSource_get_weight}, 
    {"name", _wrap_ValueWeightPostingSource_name}, 
    {"init", _wrap_ValueWeightPostingSource_init}, 
    {"__tostring", _wrap_ValueWeightPostingSource___tostring}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_ValueWeightPostingSource_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_ValueWeightPostingSource_bases[] = {0,0};
static const char *swig_Xapian_ValueWeightPostingSource_base_names[] = {"Xapian::ValuePostingSource *",0};
static swig_lua_class _wrap_class_Xapian_ValueWeightPostingSource = { "ValueWeightPostingSource", &SWIGTYPE_p_Xapian__ValueWeightPostingSource,_wrap_new_ValueWeightPostingSource, swig_delete_ValueWeightPostingSource, swig_Xapian_ValueWeightPostingSource_methods, swig_Xapian_ValueWeightPostingSource_attributes, swig_Xapian_ValueWeightPostingSource_bases, swig_Xapian_ValueWeightPostingSource_base_names };

static int _wrap_new_DecreasingValueWeightPostingSource__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  Xapian::docid arg2 ;
  Xapian::docid arg3 ;
  Xapian::DecreasingValueWeightPostingSource *result = 0 ;
  
  SWIG_check_num_args("Xapian::DecreasingValueWeightPostingSource::DecreasingValueWeightPostingSource",3,3)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::DecreasingValueWeightPostingSource::DecreasingValueWeightPostingSource",1,"Xapian::valueno");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::DecreasingValueWeightPostingSource::DecreasingValueWeightPostingSource",2,"Xapian::docid");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::DecreasingValueWeightPostingSource::DecreasingValueWeightPostingSource",3,"Xapian::docid");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::docid)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::docid)lua_tonumber(L, 3);
  {
    try {
      result = (Xapian::DecreasingValueWeightPostingSource *)new Xapian::DecreasingValueWeightPostingSource(arg1,arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DecreasingValueWeightPostingSource__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  Xapian::docid arg2 ;
  Xapian::DecreasingValueWeightPostingSource *result = 0 ;
  
  SWIG_check_num_args("Xapian::DecreasingValueWeightPostingSource::DecreasingValueWeightPostingSource",2,2)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::DecreasingValueWeightPostingSource::DecreasingValueWeightPostingSource",1,"Xapian::valueno");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::DecreasingValueWeightPostingSource::DecreasingValueWeightPostingSource",2,"Xapian::docid");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::docid)lua_tonumber(L, 2);
  {
    try {
      result = (Xapian::DecreasingValueWeightPostingSource *)new Xapian::DecreasingValueWeightPostingSource(arg1,arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DecreasingValueWeightPostingSource__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  Xapian::DecreasingValueWeightPostingSource *result = 0 ;
  
  SWIG_check_num_args("Xapian::DecreasingValueWeightPostingSource::DecreasingValueWeightPostingSource",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::DecreasingValueWeightPostingSource::DecreasingValueWeightPostingSource",1,"Xapian::valueno");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  {
    try {
      result = (Xapian::DecreasingValueWeightPostingSource *)new Xapian::DecreasingValueWeightPostingSource(arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DecreasingValueWeightPostingSource(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_DecreasingValueWeightPostingSource__SWIG_2(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_DecreasingValueWeightPostingSource__SWIG_1(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_DecreasingValueWeightPostingSource__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_DecreasingValueWeightPostingSource'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::DecreasingValueWeightPostingSource::DecreasingValueWeightPostingSource(Xapian::valueno,Xapian::docid,Xapian::docid)\n"
    "    Xapian::DecreasingValueWeightPostingSource::DecreasingValueWeightPostingSource(Xapian::valueno,Xapian::docid)\n"
    "    Xapian::DecreasingValueWeightPostingSource::DecreasingValueWeightPostingSource(Xapian::valueno)\n");
  lua_error(L);return 0;
}


static int _wrap_DecreasingValueWeightPostingSource_get_weight(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::DecreasingValueWeightPostingSource *arg1 = (Xapian::DecreasingValueWeightPostingSource *) 0 ;
  Xapian::weight result;
  
  SWIG_check_num_args("Xapian::DecreasingValueWeightPostingSource::get_weight",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::DecreasingValueWeightPostingSource::get_weight",1,"Xapian::DecreasingValueWeightPostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource,0))){
    SWIG_fail_ptr("DecreasingValueWeightPostingSource_get_weight",1,SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource);
  }
  
  {
    try {
      result = (Xapian::weight)((Xapian::DecreasingValueWeightPostingSource const *)arg1)->get_weight();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_DecreasingValueWeightPostingSource_name(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::DecreasingValueWeightPostingSource *arg1 = (Xapian::DecreasingValueWeightPostingSource *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::DecreasingValueWeightPostingSource::name",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::DecreasingValueWeightPostingSource::name",1,"Xapian::DecreasingValueWeightPostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource,0))){
    SWIG_fail_ptr("DecreasingValueWeightPostingSource_name",1,SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource);
  }
  
  {
    try {
      result = ((Xapian::DecreasingValueWeightPostingSource const *)arg1)->name();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_DecreasingValueWeightPostingSource_init(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::DecreasingValueWeightPostingSource *arg1 = (Xapian::DecreasingValueWeightPostingSource *) 0 ;
  Xapian::Database *arg2 = 0 ;
  
  SWIG_check_num_args("Xapian::DecreasingValueWeightPostingSource::init",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::DecreasingValueWeightPostingSource::init",1,"Xapian::DecreasingValueWeightPostingSource *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::DecreasingValueWeightPostingSource::init",2,"Xapian::Database const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource,0))){
    SWIG_fail_ptr("DecreasingValueWeightPostingSource_init",1,SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("DecreasingValueWeightPostingSource_init",2,SWIGTYPE_p_Xapian__Database);
  }
  
  {
    try {
      (arg1)->init((Xapian::Database const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_DecreasingValueWeightPostingSource_next(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::DecreasingValueWeightPostingSource *arg1 = (Xapian::DecreasingValueWeightPostingSource *) 0 ;
  Xapian::weight arg2 ;
  
  SWIG_check_num_args("Xapian::DecreasingValueWeightPostingSource::next",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::DecreasingValueWeightPostingSource::next",1,"Xapian::DecreasingValueWeightPostingSource *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::DecreasingValueWeightPostingSource::next",2,"Xapian::weight");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource,0))){
    SWIG_fail_ptr("DecreasingValueWeightPostingSource_next",1,SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource);
  }
  
  arg2 = (Xapian::weight)lua_tonumber(L, 2);
  {
    try {
      (arg1)->next(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_DecreasingValueWeightPostingSource_skip_to(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::DecreasingValueWeightPostingSource *arg1 = (Xapian::DecreasingValueWeightPostingSource *) 0 ;
  Xapian::docid arg2 ;
  Xapian::weight arg3 ;
  
  SWIG_check_num_args("Xapian::DecreasingValueWeightPostingSource::skip_to",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::DecreasingValueWeightPostingSource::skip_to",1,"Xapian::DecreasingValueWeightPostingSource *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::DecreasingValueWeightPostingSource::skip_to",2,"Xapian::docid");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::DecreasingValueWeightPostingSource::skip_to",3,"Xapian::weight");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource,0))){
    SWIG_fail_ptr("DecreasingValueWeightPostingSource_skip_to",1,SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::docid)lua_tonumber(L, 2);
  arg3 = (Xapian::weight)lua_tonumber(L, 3);
  {
    try {
      (arg1)->skip_to(arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_DecreasingValueWeightPostingSource_check(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::DecreasingValueWeightPostingSource *arg1 = (Xapian::DecreasingValueWeightPostingSource *) 0 ;
  Xapian::docid arg2 ;
  Xapian::weight arg3 ;
  bool result;
  
  SWIG_check_num_args("Xapian::DecreasingValueWeightPostingSource::check",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::DecreasingValueWeightPostingSource::check",1,"Xapian::DecreasingValueWeightPostingSource *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::DecreasingValueWeightPostingSource::check",2,"Xapian::docid");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::DecreasingValueWeightPostingSource::check",3,"Xapian::weight");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource,0))){
    SWIG_fail_ptr("DecreasingValueWeightPostingSource_check",1,SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::docid)lua_tonumber(L, 2);
  arg3 = (Xapian::weight)lua_tonumber(L, 3);
  {
    try {
      result = (bool)(arg1)->check(arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_DecreasingValueWeightPostingSource___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::DecreasingValueWeightPostingSource *arg1 = (Xapian::DecreasingValueWeightPostingSource *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::DecreasingValueWeightPostingSource::get_description",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::DecreasingValueWeightPostingSource::get_description",1,"Xapian::DecreasingValueWeightPostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource,0))){
    SWIG_fail_ptr("DecreasingValueWeightPostingSource___tostring",1,SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource);
  }
  
  {
    try {
      result = ((Xapian::DecreasingValueWeightPostingSource const *)arg1)->get_description();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_DecreasingValueWeightPostingSource(void *obj) {
Xapian::DecreasingValueWeightPostingSource *arg1 = (Xapian::DecreasingValueWeightPostingSource *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_DecreasingValueWeightPostingSource_methods[] = {
    {"get_weight", _wrap_DecreasingValueWeightPostingSource_get_weight}, 
    {"name", _wrap_DecreasingValueWeightPostingSource_name}, 
    {"init", _wrap_DecreasingValueWeightPostingSource_init}, 
    {"next", _wrap_DecreasingValueWeightPostingSource_next}, 
    {"skip_to", _wrap_DecreasingValueWeightPostingSource_skip_to}, 
    {"check", _wrap_DecreasingValueWeightPostingSource_check}, 
    {"__tostring", _wrap_DecreasingValueWeightPostingSource___tostring}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_DecreasingValueWeightPostingSource_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_DecreasingValueWeightPostingSource_bases[] = {0,0};
static const char *swig_Xapian_DecreasingValueWeightPostingSource_base_names[] = {"Xapian::ValueWeightPostingSource *",0};
static swig_lua_class _wrap_class_Xapian_DecreasingValueWeightPostingSource = { "DecreasingValueWeightPostingSource", &SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource,_wrap_new_DecreasingValueWeightPostingSource, swig_delete_DecreasingValueWeightPostingSource, swig_Xapian_DecreasingValueWeightPostingSource_methods, swig_Xapian_DecreasingValueWeightPostingSource_attributes, swig_Xapian_DecreasingValueWeightPostingSource_bases, swig_Xapian_DecreasingValueWeightPostingSource_base_names };

static int _wrap_new_ValueMapPostingSource(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  Xapian::ValueMapPostingSource *result = 0 ;
  
  SWIG_check_num_args("Xapian::ValueMapPostingSource::ValueMapPostingSource",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::ValueMapPostingSource::ValueMapPostingSource",1,"Xapian::valueno");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  {
    try {
      result = (Xapian::ValueMapPostingSource *)new Xapian::ValueMapPostingSource(arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__ValueMapPostingSource,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValueMapPostingSource_add_mapping(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueMapPostingSource *arg1 = (Xapian::ValueMapPostingSource *) 0 ;
  std::string *arg2 = 0 ;
  double arg3 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::ValueMapPostingSource::add_mapping",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueMapPostingSource::add_mapping",1,"Xapian::ValueMapPostingSource *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::ValueMapPostingSource::add_mapping",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::ValueMapPostingSource::add_mapping",3,"double");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueMapPostingSource,0))){
    SWIG_fail_ptr("ValueMapPostingSource_add_mapping",1,SWIGTYPE_p_Xapian__ValueMapPostingSource);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (double)lua_tonumber(L, 3);
  {
    try {
      (arg1)->add_mapping((std::string const &)*arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValueMapPostingSource_clear_mappings(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueMapPostingSource *arg1 = (Xapian::ValueMapPostingSource *) 0 ;
  
  SWIG_check_num_args("Xapian::ValueMapPostingSource::clear_mappings",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueMapPostingSource::clear_mappings",1,"Xapian::ValueMapPostingSource *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueMapPostingSource,0))){
    SWIG_fail_ptr("ValueMapPostingSource_clear_mappings",1,SWIGTYPE_p_Xapian__ValueMapPostingSource);
  }
  
  {
    try {
      (arg1)->clear_mappings();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValueMapPostingSource_set_default_weight(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueMapPostingSource *arg1 = (Xapian::ValueMapPostingSource *) 0 ;
  double arg2 ;
  
  SWIG_check_num_args("Xapian::ValueMapPostingSource::set_default_weight",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueMapPostingSource::set_default_weight",1,"Xapian::ValueMapPostingSource *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::ValueMapPostingSource::set_default_weight",2,"double");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueMapPostingSource,0))){
    SWIG_fail_ptr("ValueMapPostingSource_set_default_weight",1,SWIGTYPE_p_Xapian__ValueMapPostingSource);
  }
  
  arg2 = (double)lua_tonumber(L, 2);
  {
    try {
      (arg1)->set_default_weight(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValueMapPostingSource_get_weight(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueMapPostingSource *arg1 = (Xapian::ValueMapPostingSource *) 0 ;
  Xapian::weight result;
  
  SWIG_check_num_args("Xapian::ValueMapPostingSource::get_weight",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueMapPostingSource::get_weight",1,"Xapian::ValueMapPostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueMapPostingSource,0))){
    SWIG_fail_ptr("ValueMapPostingSource_get_weight",1,SWIGTYPE_p_Xapian__ValueMapPostingSource);
  }
  
  {
    try {
      result = (Xapian::weight)((Xapian::ValueMapPostingSource const *)arg1)->get_weight();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValueMapPostingSource_name(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueMapPostingSource *arg1 = (Xapian::ValueMapPostingSource *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::ValueMapPostingSource::name",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueMapPostingSource::name",1,"Xapian::ValueMapPostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueMapPostingSource,0))){
    SWIG_fail_ptr("ValueMapPostingSource_name",1,SWIGTYPE_p_Xapian__ValueMapPostingSource);
  }
  
  {
    try {
      result = ((Xapian::ValueMapPostingSource const *)arg1)->name();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValueMapPostingSource_init(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueMapPostingSource *arg1 = (Xapian::ValueMapPostingSource *) 0 ;
  Xapian::Database *arg2 = 0 ;
  
  SWIG_check_num_args("Xapian::ValueMapPostingSource::init",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueMapPostingSource::init",1,"Xapian::ValueMapPostingSource *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::ValueMapPostingSource::init",2,"Xapian::Database const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueMapPostingSource,0))){
    SWIG_fail_ptr("ValueMapPostingSource_init",1,SWIGTYPE_p_Xapian__ValueMapPostingSource);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("ValueMapPostingSource_init",2,SWIGTYPE_p_Xapian__Database);
  }
  
  {
    try {
      (arg1)->init((Xapian::Database const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValueMapPostingSource___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueMapPostingSource *arg1 = (Xapian::ValueMapPostingSource *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::ValueMapPostingSource::get_description",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueMapPostingSource::get_description",1,"Xapian::ValueMapPostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueMapPostingSource,0))){
    SWIG_fail_ptr("ValueMapPostingSource___tostring",1,SWIGTYPE_p_Xapian__ValueMapPostingSource);
  }
  
  {
    try {
      result = ((Xapian::ValueMapPostingSource const *)arg1)->get_description();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_ValueMapPostingSource(void *obj) {
Xapian::ValueMapPostingSource *arg1 = (Xapian::ValueMapPostingSource *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_ValueMapPostingSource_methods[] = {
    {"add_mapping", _wrap_ValueMapPostingSource_add_mapping}, 
    {"clear_mappings", _wrap_ValueMapPostingSource_clear_mappings}, 
    {"set_default_weight", _wrap_ValueMapPostingSource_set_default_weight}, 
    {"get_weight", _wrap_ValueMapPostingSource_get_weight}, 
    {"name", _wrap_ValueMapPostingSource_name}, 
    {"init", _wrap_ValueMapPostingSource_init}, 
    {"__tostring", _wrap_ValueMapPostingSource___tostring}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_ValueMapPostingSource_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_ValueMapPostingSource_bases[] = {0,0};
static const char *swig_Xapian_ValueMapPostingSource_base_names[] = {"Xapian::ValuePostingSource *",0};
static swig_lua_class _wrap_class_Xapian_ValueMapPostingSource = { "ValueMapPostingSource", &SWIGTYPE_p_Xapian__ValueMapPostingSource,_wrap_new_ValueMapPostingSource, swig_delete_ValueMapPostingSource, swig_Xapian_ValueMapPostingSource_methods, swig_Xapian_ValueMapPostingSource_attributes, swig_Xapian_ValueMapPostingSource_bases, swig_Xapian_ValueMapPostingSource_base_names };

static int _wrap_new_FixedWeightPostingSource(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::weight arg1 ;
  Xapian::FixedWeightPostingSource *result = 0 ;
  
  SWIG_check_num_args("Xapian::FixedWeightPostingSource::FixedWeightPostingSource",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::FixedWeightPostingSource::FixedWeightPostingSource",1,"Xapian::weight");
  arg1 = (Xapian::weight)lua_tonumber(L, 1);
  {
    try {
      result = (Xapian::FixedWeightPostingSource *)new Xapian::FixedWeightPostingSource(arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__FixedWeightPostingSource,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_FixedWeightPostingSource_get_termfreq_min(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  Xapian::doccount result;
  
  SWIG_check_num_args("Xapian::FixedWeightPostingSource::get_termfreq_min",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::FixedWeightPostingSource::get_termfreq_min",1,"Xapian::FixedWeightPostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__FixedWeightPostingSource,0))){
    SWIG_fail_ptr("FixedWeightPostingSource_get_termfreq_min",1,SWIGTYPE_p_Xapian__FixedWeightPostingSource);
  }
  
  {
    try {
      result = (Xapian::doccount)((Xapian::FixedWeightPostingSource const *)arg1)->get_termfreq_min();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_FixedWeightPostingSource_get_termfreq_est(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  Xapian::doccount result;
  
  SWIG_check_num_args("Xapian::FixedWeightPostingSource::get_termfreq_est",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::FixedWeightPostingSource::get_termfreq_est",1,"Xapian::FixedWeightPostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__FixedWeightPostingSource,0))){
    SWIG_fail_ptr("FixedWeightPostingSource_get_termfreq_est",1,SWIGTYPE_p_Xapian__FixedWeightPostingSource);
  }
  
  {
    try {
      result = (Xapian::doccount)((Xapian::FixedWeightPostingSource const *)arg1)->get_termfreq_est();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_FixedWeightPostingSource_get_termfreq_max(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  Xapian::doccount result;
  
  SWIG_check_num_args("Xapian::FixedWeightPostingSource::get_termfreq_max",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::FixedWeightPostingSource::get_termfreq_max",1,"Xapian::FixedWeightPostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__FixedWeightPostingSource,0))){
    SWIG_fail_ptr("FixedWeightPostingSource_get_termfreq_max",1,SWIGTYPE_p_Xapian__FixedWeightPostingSource);
  }
  
  {
    try {
      result = (Xapian::doccount)((Xapian::FixedWeightPostingSource const *)arg1)->get_termfreq_max();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_FixedWeightPostingSource_get_weight(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  Xapian::weight result;
  
  SWIG_check_num_args("Xapian::FixedWeightPostingSource::get_weight",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::FixedWeightPostingSource::get_weight",1,"Xapian::FixedWeightPostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__FixedWeightPostingSource,0))){
    SWIG_fail_ptr("FixedWeightPostingSource_get_weight",1,SWIGTYPE_p_Xapian__FixedWeightPostingSource);
  }
  
  {
    try {
      result = (Xapian::weight)((Xapian::FixedWeightPostingSource const *)arg1)->get_weight();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_FixedWeightPostingSource_next(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  Xapian::weight arg2 ;
  
  SWIG_check_num_args("Xapian::FixedWeightPostingSource::next",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::FixedWeightPostingSource::next",1,"Xapian::FixedWeightPostingSource *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::FixedWeightPostingSource::next",2,"Xapian::weight");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__FixedWeightPostingSource,0))){
    SWIG_fail_ptr("FixedWeightPostingSource_next",1,SWIGTYPE_p_Xapian__FixedWeightPostingSource);
  }
  
  arg2 = (Xapian::weight)lua_tonumber(L, 2);
  {
    try {
      (arg1)->next(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_FixedWeightPostingSource_skip_to(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  Xapian::docid arg2 ;
  Xapian::weight arg3 ;
  
  SWIG_check_num_args("Xapian::FixedWeightPostingSource::skip_to",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::FixedWeightPostingSource::skip_to",1,"Xapian::FixedWeightPostingSource *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::FixedWeightPostingSource::skip_to",2,"Xapian::docid");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::FixedWeightPostingSource::skip_to",3,"Xapian::weight");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__FixedWeightPostingSource,0))){
    SWIG_fail_ptr("FixedWeightPostingSource_skip_to",1,SWIGTYPE_p_Xapian__FixedWeightPostingSource);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::docid)lua_tonumber(L, 2);
  arg3 = (Xapian::weight)lua_tonumber(L, 3);
  {
    try {
      (arg1)->skip_to(arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_FixedWeightPostingSource_check(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  Xapian::docid arg2 ;
  Xapian::weight arg3 ;
  bool result;
  
  SWIG_check_num_args("Xapian::FixedWeightPostingSource::check",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::FixedWeightPostingSource::check",1,"Xapian::FixedWeightPostingSource *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::FixedWeightPostingSource::check",2,"Xapian::docid");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::FixedWeightPostingSource::check",3,"Xapian::weight");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__FixedWeightPostingSource,0))){
    SWIG_fail_ptr("FixedWeightPostingSource_check",1,SWIGTYPE_p_Xapian__FixedWeightPostingSource);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::docid)lua_tonumber(L, 2);
  arg3 = (Xapian::weight)lua_tonumber(L, 3);
  {
    try {
      result = (bool)(arg1)->check(arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_FixedWeightPostingSource_at_end(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  bool result;
  
  SWIG_check_num_args("Xapian::FixedWeightPostingSource::at_end",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::FixedWeightPostingSource::at_end",1,"Xapian::FixedWeightPostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__FixedWeightPostingSource,0))){
    SWIG_fail_ptr("FixedWeightPostingSource_at_end",1,SWIGTYPE_p_Xapian__FixedWeightPostingSource);
  }
  
  {
    try {
      result = (bool)((Xapian::FixedWeightPostingSource const *)arg1)->at_end();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_FixedWeightPostingSource_get_docid(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  Xapian::docid result;
  
  SWIG_check_num_args("Xapian::FixedWeightPostingSource::get_docid",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::FixedWeightPostingSource::get_docid",1,"Xapian::FixedWeightPostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__FixedWeightPostingSource,0))){
    SWIG_fail_ptr("FixedWeightPostingSource_get_docid",1,SWIGTYPE_p_Xapian__FixedWeightPostingSource);
  }
  
  {
    try {
      result = (Xapian::docid)((Xapian::FixedWeightPostingSource const *)arg1)->get_docid();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_FixedWeightPostingSource_name(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::FixedWeightPostingSource::name",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::FixedWeightPostingSource::name",1,"Xapian::FixedWeightPostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__FixedWeightPostingSource,0))){
    SWIG_fail_ptr("FixedWeightPostingSource_name",1,SWIGTYPE_p_Xapian__FixedWeightPostingSource);
  }
  
  {
    try {
      result = ((Xapian::FixedWeightPostingSource const *)arg1)->name();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_FixedWeightPostingSource_init(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  Xapian::Database *arg2 = 0 ;
  
  SWIG_check_num_args("Xapian::FixedWeightPostingSource::init",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::FixedWeightPostingSource::init",1,"Xapian::FixedWeightPostingSource *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::FixedWeightPostingSource::init",2,"Xapian::Database const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__FixedWeightPostingSource,0))){
    SWIG_fail_ptr("FixedWeightPostingSource_init",1,SWIGTYPE_p_Xapian__FixedWeightPostingSource);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("FixedWeightPostingSource_init",2,SWIGTYPE_p_Xapian__Database);
  }
  
  {
    try {
      (arg1)->init((Xapian::Database const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_FixedWeightPostingSource___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::FixedWeightPostingSource::get_description",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::FixedWeightPostingSource::get_description",1,"Xapian::FixedWeightPostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__FixedWeightPostingSource,0))){
    SWIG_fail_ptr("FixedWeightPostingSource___tostring",1,SWIGTYPE_p_Xapian__FixedWeightPostingSource);
  }
  
  {
    try {
      result = ((Xapian::FixedWeightPostingSource const *)arg1)->get_description();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_FixedWeightPostingSource(void *obj) {
Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_FixedWeightPostingSource_methods[] = {
    {"get_termfreq_min", _wrap_FixedWeightPostingSource_get_termfreq_min}, 
    {"get_termfreq_est", _wrap_FixedWeightPostingSource_get_termfreq_est}, 
    {"get_termfreq_max", _wrap_FixedWeightPostingSource_get_termfreq_max}, 
    {"get_weight", _wrap_FixedWeightPostingSource_get_weight}, 
    {"next", _wrap_FixedWeightPostingSource_next}, 
    {"skip_to", _wrap_FixedWeightPostingSource_skip_to}, 
    {"check", _wrap_FixedWeightPostingSource_check}, 
    {"at_end", _wrap_FixedWeightPostingSource_at_end}, 
    {"get_docid", _wrap_FixedWeightPostingSource_get_docid}, 
    {"name", _wrap_FixedWeightPostingSource_name}, 
    {"init", _wrap_FixedWeightPostingSource_init}, 
    {"__tostring", _wrap_FixedWeightPostingSource___tostring}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_FixedWeightPostingSource_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_FixedWeightPostingSource_bases[] = {0,0};
static const char *swig_Xapian_FixedWeightPostingSource_base_names[] = {"Xapian::PostingSource *",0};
static swig_lua_class _wrap_class_Xapian_FixedWeightPostingSource = { "FixedWeightPostingSource", &SWIGTYPE_p_Xapian__FixedWeightPostingSource,_wrap_new_FixedWeightPostingSource, swig_delete_FixedWeightPostingSource, swig_Xapian_FixedWeightPostingSource_methods, swig_Xapian_FixedWeightPostingSource_attributes, swig_Xapian_FixedWeightPostingSource_bases, swig_Xapian_FixedWeightPostingSource_base_names };

static int _wrap_new_MSet__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *result = 0 ;
  
  SWIG_check_num_args("Xapian::MSet::MSet",0,0)
  {
    try {
      result = (Xapian::MSet *)new Xapian::MSet();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__MSet,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_MSet__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = 0 ;
  Xapian::MSet *result = 0 ;
  
  SWIG_check_num_args("Xapian::MSet::MSet",1,1)
  if(!lua_isuserdata(L,1)) SWIG_fail_arg("Xapian::MSet::MSet",1,"Xapian::MSet const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("new_MSet",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  {
    try {
      result = (Xapian::MSet *)new Xapian::MSet((Xapian::MSet const &)*arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__MSet,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_MSet(lua_State* L) {
  int argc;
  int argv[2]={
    1,2
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_MSet__SWIG_0(L);
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__MSet, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_new_MSet__SWIG_1(L);
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_MSet'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::MSet::MSet()\n"
    "    Xapian::MSet::MSet(Xapian::MSet const &)\n");
  lua_error(L);return 0;
}


static int _wrap_MSet_fetch__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  Xapian::MSetIterator *arg3 = 0 ;
  
  SWIG_check_num_args("Xapian::MSet::fetch",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::fetch",1,"Xapian::MSet const *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::MSet::fetch",2,"Xapian::MSetIterator &");
  if(!lua_isuserdata(L,3)) SWIG_fail_arg("Xapian::MSet::fetch",3,"Xapian::MSetIterator &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet_fetch",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("MSet_fetch",2,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("MSet_fetch",3,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  {
    try {
      ((Xapian::MSet const *)arg1)->fetch(*arg2,*arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSet_fetch__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  
  SWIG_check_num_args("Xapian::MSet::fetch",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::fetch",1,"Xapian::MSet const *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::MSet::fetch",2,"Xapian::MSetIterator &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet_fetch",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("MSet_fetch",2,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  {
    try {
      ((Xapian::MSet const *)arg1)->fetch(*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSet_fetch__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  
  SWIG_check_num_args("Xapian::MSet::fetch",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::fetch",1,"Xapian::MSet const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet_fetch",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  {
    try {
      ((Xapian::MSet const *)arg1)->fetch();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSet_fetch(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__MSet, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_MSet_fetch__SWIG_2(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__MSet, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        void *ptr;
        if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_Xapian__MSetIterator, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        return _wrap_MSet_fetch__SWIG_1(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__MSet, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        void *ptr;
        if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_Xapian__MSetIterator, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        {
          void *ptr;
          if (lua_isuserdata(L,argv[2])==0 || SWIG_ConvertPtr(L,argv[2], (void **) &ptr, SWIGTYPE_p_Xapian__MSetIterator, 0)) {
            _v = 0;
          } else {
            _v = 1;
          }
        }
        if (_v) {
          return _wrap_MSet_fetch__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'MSet_fetch'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::MSet::fetch(Xapian::MSetIterator &,Xapian::MSetIterator &) const\n"
    "    Xapian::MSet::fetch(Xapian::MSetIterator &) const\n"
    "    Xapian::MSet::fetch() const\n");
  lua_error(L);return 0;
}


static int _wrap_MSet_convert_to_percent__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::weight arg2 ;
  Xapian::percent result;
  
  SWIG_check_num_args("Xapian::MSet::convert_to_percent",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::convert_to_percent",1,"Xapian::MSet const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::MSet::convert_to_percent",2,"Xapian::weight");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet_convert_to_percent",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  arg2 = (Xapian::weight)lua_tonumber(L, 2);
  {
    try {
      result = (Xapian::percent)((Xapian::MSet const *)arg1)->convert_to_percent(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSet_convert_to_percent__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  Xapian::percent result;
  
  SWIG_check_num_args("Xapian::MSet::convert_to_percent",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::convert_to_percent",1,"Xapian::MSet const *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::MSet::convert_to_percent",2,"Xapian::MSetIterator const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet_convert_to_percent",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("MSet_convert_to_percent",2,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  {
    try {
      result = (Xapian::percent)((Xapian::MSet const *)arg1)->convert_to_percent((Xapian::MSetIterator const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSet_convert_to_percent(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__MSet, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        void *ptr;
        if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_Xapian__MSetIterator, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        return _wrap_MSet_convert_to_percent__SWIG_1(L);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__MSet, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_MSet_convert_to_percent__SWIG_0(L);
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'MSet_convert_to_percent'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::MSet::convert_to_percent(Xapian::weight) const\n"
    "    Xapian::MSet::convert_to_percent(Xapian::MSetIterator const &) const\n");
  lua_error(L);return 0;
}


static int _wrap_MSet_get_termfreq(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  std::string arg2 ;
  Xapian::doccount result;
  
  SWIG_check_num_args("Xapian::MSet::get_termfreq",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::get_termfreq",1,"Xapian::MSet const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::MSet::get_termfreq",2,"std::string");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet_get_termfreq",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  (&arg2)->assign(lua_tostring(L,2),lua_rawlen(L,2));
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->get_termfreq(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSet_get_termweight(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  std::string arg2 ;
  Xapian::weight result;
  
  SWIG_check_num_args("Xapian::MSet::get_termweight",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::get_termweight",1,"Xapian::MSet const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::MSet::get_termweight",2,"std::string");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet_get_termweight",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  (&arg2)->assign(lua_tostring(L,2),lua_rawlen(L,2));
  {
    try {
      result = (Xapian::weight)((Xapian::MSet const *)arg1)->get_termweight(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSet_get_firstitem(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount result;
  
  SWIG_check_num_args("Xapian::MSet::get_firstitem",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::get_firstitem",1,"Xapian::MSet const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet_get_firstitem",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->get_firstitem();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSet_get_matches_lower_bound(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount result;
  
  SWIG_check_num_args("Xapian::MSet::get_matches_lower_bound",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::get_matches_lower_bound",1,"Xapian::MSet const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet_get_matches_lower_bound",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->get_matches_lower_bound();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSet_get_matches_estimated(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount result;
  
  SWIG_check_num_args("Xapian::MSet::get_matches_estimated",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::get_matches_estimated",1,"Xapian::MSet const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet_get_matches_estimated",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->get_matches_estimated();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSet_get_matches_upper_bound(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount result;
  
  SWIG_check_num_args("Xapian::MSet::get_matches_upper_bound",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::get_matches_upper_bound",1,"Xapian::MSet const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet_get_matches_upper_bound",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->get_matches_upper_bound();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSet_get_uncollapsed_matches_lower_bound(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount result;
  
  SWIG_check_num_args("Xapian::MSet::get_uncollapsed_matches_lower_bound",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::get_uncollapsed_matches_lower_bound",1,"Xapian::MSet const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet_get_uncollapsed_matches_lower_bound",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->get_uncollapsed_matches_lower_bound();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSet_get_uncollapsed_matches_estimated(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount result;
  
  SWIG_check_num_args("Xapian::MSet::get_uncollapsed_matches_estimated",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::get_uncollapsed_matches_estimated",1,"Xapian::MSet const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet_get_uncollapsed_matches_estimated",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->get_uncollapsed_matches_estimated();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSet_get_uncollapsed_matches_upper_bound(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount result;
  
  SWIG_check_num_args("Xapian::MSet::get_uncollapsed_matches_upper_bound",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::get_uncollapsed_matches_upper_bound",1,"Xapian::MSet const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet_get_uncollapsed_matches_upper_bound",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->get_uncollapsed_matches_upper_bound();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSet_get_max_possible(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::weight result;
  
  SWIG_check_num_args("Xapian::MSet::get_max_possible",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::get_max_possible",1,"Xapian::MSet *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet_get_max_possible",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  {
    try {
      result = (Xapian::weight)(arg1)->get_max_possible();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSet_get_max_attained(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::weight result;
  
  SWIG_check_num_args("Xapian::MSet::get_max_attained",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::get_max_attained",1,"Xapian::MSet *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet_get_max_attained",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  {
    try {
      result = (Xapian::weight)(arg1)->get_max_attained();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSet_size(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount result;
  
  SWIG_check_num_args("Xapian::MSet::size",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::size",1,"Xapian::MSet const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet_size",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->size();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSet_empty(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  bool result;
  
  SWIG_check_num_args("Xapian::MSet::empty",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::empty",1,"Xapian::MSet const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet_empty",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  {
    try {
      result = (bool)((Xapian::MSet const *)arg1)->empty();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSet_begin(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::MSetIterator result;
  
  SWIG_check_num_args("Xapian::MSet::begin",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::begin",1,"Xapian::MSet const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet_begin",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  {
    try {
      result = ((Xapian::MSet const *)arg1)->begin();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::MSetIterator * resultptr = new Xapian::MSetIterator((const Xapian::MSetIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__MSetIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSet__end(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::MSetIterator result;
  
  SWIG_check_num_args("Xapian::MSet::end",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::end",1,"Xapian::MSet const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet__end",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  {
    try {
      result = ((Xapian::MSet const *)arg1)->end();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::MSetIterator * resultptr = new Xapian::MSetIterator((const Xapian::MSetIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__MSetIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSet_back(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::MSetIterator result;
  
  SWIG_check_num_args("Xapian::MSet::back",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::back",1,"Xapian::MSet const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet_back",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  {
    try {
      result = ((Xapian::MSet const *)arg1)->back();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::MSetIterator * resultptr = new Xapian::MSetIterator((const Xapian::MSetIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__MSetIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSet_get_hit(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::MSetIterator result;
  
  SWIG_check_num_args("Xapian::MSet::get_hit",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::get_hit",1,"Xapian::MSet const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::MSet::get_hit",2,"Xapian::doccount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet_get_hit",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::doccount)lua_tonumber(L, 2);
  {
    try {
      result = Xapian_MSet_get_hit((Xapian::MSet const *)arg1,arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::MSetIterator * resultptr = new Xapian::MSetIterator((const Xapian::MSetIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__MSetIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSet_get_document_percentage(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount arg2 ;
  int result;
  
  SWIG_check_num_args("Xapian::MSet::get_document_percentage",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::get_document_percentage",1,"Xapian::MSet const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::MSet::get_document_percentage",2,"Xapian::doccount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet_get_document_percentage",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::doccount)lua_tonumber(L, 2);
  {
    try {
      result = (int)Xapian_MSet_get_document_percentage((Xapian::MSet const *)arg1,arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSet_get_document(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::Document result;
  
  SWIG_check_num_args("Xapian::MSet::get_document",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::get_document",1,"Xapian::MSet const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::MSet::get_document",2,"Xapian::doccount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet_get_document",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::doccount)lua_tonumber(L, 2);
  {
    try {
      result = Xapian_MSet_get_document((Xapian::MSet const *)arg1,arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::Document * resultptr = new Xapian::Document((const Xapian::Document &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__Document,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSet_get_docid(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::docid result;
  
  SWIG_check_num_args("Xapian::MSet::get_docid",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::get_docid",1,"Xapian::MSet const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::MSet::get_docid",2,"Xapian::doccount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet_get_docid",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::doccount)lua_tonumber(L, 2);
  {
    try {
      result = (Xapian::docid)Xapian_MSet_get_docid((Xapian::MSet const *)arg1,arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSet___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::MSet::get_description",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::get_description",1,"Xapian::MSet const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet___tostring",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  {
    try {
      result = ((Xapian::MSet const *)arg1)->get_description();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSet_items(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  SwigValueWrapper< std::pair< Xapian::MSetIterator,Xapian::MSetIterator > > result;
  
  SWIG_check_num_args("Xapian::MSet::items",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::items",1,"Xapian::MSet *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet_items",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  result = Xapian_MSet_items(arg1);
  {
    lua_getglobal(L, "xapian");
    lua_pushstring(L, "Iterator");
    lua_gettable(L, -2);
    lua_remove(L, -2);
    
    if (!lua_isfunction(L, -1)) {
      luaL_typerror(L, -1, "function");
    }
    
    Xapian::MSetIterator * begin = new Xapian::MSetIterator((const Xapian::MSetIterator &)(&result)->first);
    SWIG_NewPointerObj(L, (void *) begin, SWIGTYPE_p_Xapian__MSetIterator, 1);
    
    Xapian::MSetIterator * end = new Xapian::MSetIterator((const Xapian::MSetIterator &)(&result)->second);
    SWIG_NewPointerObj(L, (void *) end, SWIGTYPE_p_Xapian__MSetIterator, 1);
    
    if (lua_pcall(L, 2, 1, 0) != 0) {
      luaL_error(L, "error running function: %s", lua_tostring(L, -1));
    }
    
    SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_MSet(void *obj) {
Xapian::MSet *arg1 = (Xapian::MSet *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_MSet_methods[] = {
    {"fetch", _wrap_MSet_fetch}, 
    {"convert_to_percent", _wrap_MSet_convert_to_percent}, 
    {"get_termfreq", _wrap_MSet_get_termfreq}, 
    {"get_termweight", _wrap_MSet_get_termweight}, 
    {"get_firstitem", _wrap_MSet_get_firstitem}, 
    {"get_matches_lower_bound", _wrap_MSet_get_matches_lower_bound}, 
    {"get_matches_estimated", _wrap_MSet_get_matches_estimated}, 
    {"get_matches_upper_bound", _wrap_MSet_get_matches_upper_bound}, 
    {"get_uncollapsed_matches_lower_bound", _wrap_MSet_get_uncollapsed_matches_lower_bound}, 
    {"get_uncollapsed_matches_estimated", _wrap_MSet_get_uncollapsed_matches_estimated}, 
    {"get_uncollapsed_matches_upper_bound", _wrap_MSet_get_uncollapsed_matches_upper_bound}, 
    {"get_max_possible", _wrap_MSet_get_max_possible}, 
    {"get_max_attained", _wrap_MSet_get_max_attained}, 
    {"size", _wrap_MSet_size}, 
    {"empty", _wrap_MSet_empty}, 
    {"begin", _wrap_MSet_begin}, 
    {"_end", _wrap_MSet__end}, 
    {"back", _wrap_MSet_back}, 
    {"get_hit", _wrap_MSet_get_hit}, 
    {"get_document_percentage", _wrap_MSet_get_document_percentage}, 
    {"get_document", _wrap_MSet_get_document}, 
    {"get_docid", _wrap_MSet_get_docid}, 
    {"__tostring", _wrap_MSet___tostring}, 
    {"items", _wrap_MSet_items}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_MSet_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_MSet_bases[] = {0};
static const char *swig_Xapian_MSet_base_names[] = {0};
static swig_lua_class _wrap_class_Xapian_MSet = { "MSet", &SWIGTYPE_p_Xapian__MSet,_wrap_new_MSet, swig_delete_MSet, swig_Xapian_MSet_methods, swig_Xapian_MSet_attributes, swig_Xapian_MSet_bases, swig_Xapian_MSet_base_names };

static int _wrap_new_MSetIterator__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSetIterator *result = 0 ;
  
  SWIG_check_num_args("Xapian::MSetIterator::MSetIterator",0,0)
  {
    try {
      result = (Xapian::MSetIterator *)new Xapian::MSetIterator();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__MSetIterator,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_MSetIterator__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSetIterator *arg1 = 0 ;
  Xapian::MSetIterator *result = 0 ;
  
  SWIG_check_num_args("Xapian::MSetIterator::MSetIterator",1,1)
  if(!lua_isuserdata(L,1)) SWIG_fail_arg("Xapian::MSetIterator::MSetIterator",1,"Xapian::MSetIterator const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("new_MSetIterator",1,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  {
    try {
      result = (Xapian::MSetIterator *)new Xapian::MSetIterator((Xapian::MSetIterator const &)*arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__MSetIterator,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_MSetIterator(lua_State* L) {
  int argc;
  int argv[2]={
    1,2
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_MSetIterator__SWIG_0(L);
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__MSetIterator, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_new_MSetIterator__SWIG_1(L);
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_MSetIterator'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::MSetIterator::MSetIterator()\n"
    "    Xapian::MSetIterator::MSetIterator(Xapian::MSetIterator const &)\n");
  lua_error(L);return 0;
}


static int _wrap_MSetIterator_get_docid(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::docid result;
  
  SWIG_check_num_args("Xapian::MSetIterator::get_docid",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSetIterator::get_docid",1,"Xapian::MSetIterator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("MSetIterator_get_docid",1,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  {
    try {
      result = (Xapian::docid)Xapian_MSetIterator_get_docid((Xapian::MSetIterator const *)arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSetIterator_next(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  
  SWIG_check_num_args("Xapian::MSetIterator::next",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSetIterator::next",1,"Xapian::MSetIterator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("MSetIterator_next",1,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  {
    try {
      Xapian_MSetIterator_next(arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSetIterator_prev(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  
  SWIG_check_num_args("Xapian::MSetIterator::prev",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSetIterator::prev",1,"Xapian::MSetIterator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("MSetIterator_prev",1,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  {
    try {
      Xapian_MSetIterator_prev(arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSetIterator_equals(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("Xapian::MSetIterator::equals",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSetIterator::equals",1,"Xapian::MSetIterator const *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::MSetIterator::equals",2,"Xapian::MSetIterator const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("MSetIterator_equals",1,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("MSetIterator_equals",2,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  {
    try {
      result = (bool)Xapian_MSetIterator_equals((Xapian::MSetIterator const *)arg1,(Xapian::MSetIterator const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSetIterator_get_document(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::Document result;
  
  SWIG_check_num_args("Xapian::MSetIterator::get_document",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSetIterator::get_document",1,"Xapian::MSetIterator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("MSetIterator_get_document",1,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  {
    try {
      result = ((Xapian::MSetIterator const *)arg1)->get_document();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::Document * resultptr = new Xapian::Document((const Xapian::Document &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__Document,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSetIterator_get_rank(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::doccount result;
  
  SWIG_check_num_args("Xapian::MSetIterator::get_rank",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSetIterator::get_rank",1,"Xapian::MSetIterator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("MSetIterator_get_rank",1,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  {
    try {
      result = (Xapian::doccount)((Xapian::MSetIterator const *)arg1)->get_rank();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSetIterator_get_weight(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::weight result;
  
  SWIG_check_num_args("Xapian::MSetIterator::get_weight",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSetIterator::get_weight",1,"Xapian::MSetIterator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("MSetIterator_get_weight",1,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  {
    try {
      result = (Xapian::weight)((Xapian::MSetIterator const *)arg1)->get_weight();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSetIterator_get_collapse_key(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::MSetIterator::get_collapse_key",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSetIterator::get_collapse_key",1,"Xapian::MSetIterator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("MSetIterator_get_collapse_key",1,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  {
    try {
      result = ((Xapian::MSetIterator const *)arg1)->get_collapse_key();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSetIterator_get_collapse_count(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::doccount result;
  
  SWIG_check_num_args("Xapian::MSetIterator::get_collapse_count",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSetIterator::get_collapse_count",1,"Xapian::MSetIterator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("MSetIterator_get_collapse_count",1,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  {
    try {
      result = (Xapian::doccount)((Xapian::MSetIterator const *)arg1)->get_collapse_count();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSetIterator_get_percent(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::percent result;
  
  SWIG_check_num_args("Xapian::MSetIterator::get_percent",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSetIterator::get_percent",1,"Xapian::MSetIterator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("MSetIterator_get_percent",1,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  {
    try {
      result = (Xapian::percent)((Xapian::MSetIterator const *)arg1)->get_percent();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSetIterator___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::MSetIterator::get_description",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSetIterator::get_description",1,"Xapian::MSetIterator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("MSetIterator___tostring",1,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  {
    try {
      result = ((Xapian::MSetIterator const *)arg1)->get_description();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_MSetIterator(void *obj) {
Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_MSetIterator_methods[] = {
    {"get_docid", _wrap_MSetIterator_get_docid}, 
    {"next", _wrap_MSetIterator_next}, 
    {"prev", _wrap_MSetIterator_prev}, 
    {"equals", _wrap_MSetIterator_equals}, 
    {"get_document", _wrap_MSetIterator_get_document}, 
    {"get_rank", _wrap_MSetIterator_get_rank}, 
    {"get_weight", _wrap_MSetIterator_get_weight}, 
    {"get_collapse_key", _wrap_MSetIterator_get_collapse_key}, 
    {"get_collapse_count", _wrap_MSetIterator_get_collapse_count}, 
    {"get_percent", _wrap_MSetIterator_get_percent}, 
    {"__tostring", _wrap_MSetIterator___tostring}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_MSetIterator_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_MSetIterator_bases[] = {0};
static const char *swig_Xapian_MSetIterator_base_names[] = {0};
static swig_lua_class _wrap_class_Xapian_MSetIterator = { "MSetIterator", &SWIGTYPE_p_Xapian__MSetIterator,_wrap_new_MSetIterator, swig_delete_MSetIterator, swig_Xapian_MSetIterator_methods, swig_Xapian_MSetIterator_attributes, swig_Xapian_MSetIterator_bases, swig_Xapian_MSetIterator_base_names };

static int _wrap_new_ESet__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ESet *result = 0 ;
  
  SWIG_check_num_args("Xapian::ESet::ESet",0,0)
  {
    try {
      result = (Xapian::ESet *)new Xapian::ESet();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__ESet,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_ESet__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ESet *arg1 = 0 ;
  Xapian::ESet *result = 0 ;
  
  SWIG_check_num_args("Xapian::ESet::ESet",1,1)
  if(!lua_isuserdata(L,1)) SWIG_fail_arg("Xapian::ESet::ESet",1,"Xapian::ESet const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ESet,0))){
    SWIG_fail_ptr("new_ESet",1,SWIGTYPE_p_Xapian__ESet);
  }
  
  {
    try {
      result = (Xapian::ESet *)new Xapian::ESet((Xapian::ESet const &)*arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__ESet,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_ESet(lua_State* L) {
  int argc;
  int argv[2]={
    1,2
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_ESet__SWIG_0(L);
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__ESet, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_new_ESet__SWIG_1(L);
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_ESet'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::ESet::ESet()\n"
    "    Xapian::ESet::ESet(Xapian::ESet const &)\n");
  lua_error(L);return 0;
}


static int _wrap_ESet_get_ebound(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  Xapian::termcount result;
  
  SWIG_check_num_args("Xapian::ESet::get_ebound",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ESet::get_ebound",1,"Xapian::ESet const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ESet,0))){
    SWIG_fail_ptr("ESet_get_ebound",1,SWIGTYPE_p_Xapian__ESet);
  }
  
  {
    try {
      result = (Xapian::termcount)((Xapian::ESet const *)arg1)->get_ebound();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ESet_size(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  Xapian::termcount result;
  
  SWIG_check_num_args("Xapian::ESet::size",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ESet::size",1,"Xapian::ESet const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ESet,0))){
    SWIG_fail_ptr("ESet_size",1,SWIGTYPE_p_Xapian__ESet);
  }
  
  {
    try {
      result = (Xapian::termcount)((Xapian::ESet const *)arg1)->size();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ESet_empty(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  bool result;
  
  SWIG_check_num_args("Xapian::ESet::empty",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ESet::empty",1,"Xapian::ESet const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ESet,0))){
    SWIG_fail_ptr("ESet_empty",1,SWIGTYPE_p_Xapian__ESet);
  }
  
  {
    try {
      result = (bool)((Xapian::ESet const *)arg1)->empty();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ESet_begin(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  Xapian::ESetIterator result;
  
  SWIG_check_num_args("Xapian::ESet::begin",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ESet::begin",1,"Xapian::ESet const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ESet,0))){
    SWIG_fail_ptr("ESet_begin",1,SWIGTYPE_p_Xapian__ESet);
  }
  
  {
    try {
      result = ((Xapian::ESet const *)arg1)->begin();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::ESetIterator * resultptr = new Xapian::ESetIterator((const Xapian::ESetIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__ESetIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ESet__end(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  Xapian::ESetIterator result;
  
  SWIG_check_num_args("Xapian::ESet::end",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ESet::end",1,"Xapian::ESet const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ESet,0))){
    SWIG_fail_ptr("ESet__end",1,SWIGTYPE_p_Xapian__ESet);
  }
  
  {
    try {
      result = ((Xapian::ESet const *)arg1)->end();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::ESetIterator * resultptr = new Xapian::ESetIterator((const Xapian::ESetIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__ESetIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ESet_back(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  Xapian::ESetIterator result;
  
  SWIG_check_num_args("Xapian::ESet::back",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ESet::back",1,"Xapian::ESet const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ESet,0))){
    SWIG_fail_ptr("ESet_back",1,SWIGTYPE_p_Xapian__ESet);
  }
  
  {
    try {
      result = ((Xapian::ESet const *)arg1)->back();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::ESetIterator * resultptr = new Xapian::ESetIterator((const Xapian::ESetIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__ESetIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ESet___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::ESet::get_description",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ESet::get_description",1,"Xapian::ESet const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ESet,0))){
    SWIG_fail_ptr("ESet___tostring",1,SWIGTYPE_p_Xapian__ESet);
  }
  
  {
    try {
      result = ((Xapian::ESet const *)arg1)->get_description();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ESet_terms(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  SwigValueWrapper< std::pair< Xapian::ESetIterator,Xapian::ESetIterator > > result;
  
  SWIG_check_num_args("Xapian::ESet::terms",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ESet::terms",1,"Xapian::ESet *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ESet,0))){
    SWIG_fail_ptr("ESet_terms",1,SWIGTYPE_p_Xapian__ESet);
  }
  
  result = Xapian_ESet_terms(arg1);
  {
    lua_getglobal(L, "xapian");
    lua_pushstring(L, "Iterator");
    lua_gettable(L, -2);
    lua_remove(L, -2);
    
    if (!lua_isfunction(L, -1)) {
      luaL_typerror(L, -1, "function");
    }
    
    Xapian::ESetIterator * begin = new Xapian::ESetIterator((const Xapian::ESetIterator &)(&result)->first);
    SWIG_NewPointerObj(L, (void *) begin, SWIGTYPE_p_Xapian__ESetIterator, 1);
    
    Xapian::ESetIterator * end = new Xapian::ESetIterator((const Xapian::ESetIterator &)(&result)->second);
    SWIG_NewPointerObj(L, (void *) end, SWIGTYPE_p_Xapian__ESetIterator, 1);
    
    if (lua_pcall(L, 2, 1, 0) != 0) {
      luaL_error(L, "error running function: %s", lua_tostring(L, -1));
    }
    
    SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_ESet(void *obj) {
Xapian::ESet *arg1 = (Xapian::ESet *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_ESet_methods[] = {
    {"get_ebound", _wrap_ESet_get_ebound}, 
    {"size", _wrap_ESet_size}, 
    {"empty", _wrap_ESet_empty}, 
    {"begin", _wrap_ESet_begin}, 
    {"_end", _wrap_ESet__end}, 
    {"back", _wrap_ESet_back}, 
    {"__tostring", _wrap_ESet___tostring}, 
    {"terms", _wrap_ESet_terms}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_ESet_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_ESet_bases[] = {0};
static const char *swig_Xapian_ESet_base_names[] = {0};
static swig_lua_class _wrap_class_Xapian_ESet = { "ESet", &SWIGTYPE_p_Xapian__ESet,_wrap_new_ESet, swig_delete_ESet, swig_Xapian_ESet_methods, swig_Xapian_ESet_attributes, swig_Xapian_ESet_bases, swig_Xapian_ESet_base_names };

static int _wrap_new_ESetIterator__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ESetIterator *result = 0 ;
  
  SWIG_check_num_args("Xapian::ESetIterator::ESetIterator",0,0)
  {
    try {
      result = (Xapian::ESetIterator *)new Xapian::ESetIterator();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__ESetIterator,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_ESetIterator__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ESetIterator *arg1 = 0 ;
  Xapian::ESetIterator *result = 0 ;
  
  SWIG_check_num_args("Xapian::ESetIterator::ESetIterator",1,1)
  if(!lua_isuserdata(L,1)) SWIG_fail_arg("Xapian::ESetIterator::ESetIterator",1,"Xapian::ESetIterator const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ESetIterator,0))){
    SWIG_fail_ptr("new_ESetIterator",1,SWIGTYPE_p_Xapian__ESetIterator);
  }
  
  {
    try {
      result = (Xapian::ESetIterator *)new Xapian::ESetIterator((Xapian::ESetIterator const &)*arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__ESetIterator,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_ESetIterator(lua_State* L) {
  int argc;
  int argv[2]={
    1,2
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_ESetIterator__SWIG_0(L);
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__ESetIterator, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_new_ESetIterator__SWIG_1(L);
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_ESetIterator'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::ESetIterator::ESetIterator()\n"
    "    Xapian::ESetIterator::ESetIterator(Xapian::ESetIterator const &)\n");
  lua_error(L);return 0;
}


static int _wrap_ESetIterator_get_term(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::ESetIterator::get_term",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ESetIterator::get_term",1,"Xapian::ESetIterator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ESetIterator,0))){
    SWIG_fail_ptr("ESetIterator_get_term",1,SWIGTYPE_p_Xapian__ESetIterator);
  }
  
  {
    try {
      result = Xapian_ESetIterator_get_term((Xapian::ESetIterator const *)arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ESetIterator_next(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  
  SWIG_check_num_args("Xapian::ESetIterator::next",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ESetIterator::next",1,"Xapian::ESetIterator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ESetIterator,0))){
    SWIG_fail_ptr("ESetIterator_next",1,SWIGTYPE_p_Xapian__ESetIterator);
  }
  
  {
    try {
      Xapian_ESetIterator_next(arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ESetIterator_prev(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  
  SWIG_check_num_args("Xapian::ESetIterator::prev",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ESetIterator::prev",1,"Xapian::ESetIterator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ESetIterator,0))){
    SWIG_fail_ptr("ESetIterator_prev",1,SWIGTYPE_p_Xapian__ESetIterator);
  }
  
  {
    try {
      Xapian_ESetIterator_prev(arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ESetIterator_equals(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  Xapian::ESetIterator *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("Xapian::ESetIterator::equals",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ESetIterator::equals",1,"Xapian::ESetIterator const *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::ESetIterator::equals",2,"Xapian::ESetIterator const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ESetIterator,0))){
    SWIG_fail_ptr("ESetIterator_equals",1,SWIGTYPE_p_Xapian__ESetIterator);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__ESetIterator,0))){
    SWIG_fail_ptr("ESetIterator_equals",2,SWIGTYPE_p_Xapian__ESetIterator);
  }
  
  {
    try {
      result = (bool)Xapian_ESetIterator_equals((Xapian::ESetIterator const *)arg1,(Xapian::ESetIterator const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ESetIterator_get_weight(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  Xapian::weight result;
  
  SWIG_check_num_args("Xapian::ESetIterator::get_weight",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ESetIterator::get_weight",1,"Xapian::ESetIterator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ESetIterator,0))){
    SWIG_fail_ptr("ESetIterator_get_weight",1,SWIGTYPE_p_Xapian__ESetIterator);
  }
  
  {
    try {
      result = (Xapian::weight)((Xapian::ESetIterator const *)arg1)->get_weight();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ESetIterator___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::ESetIterator::get_description",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ESetIterator::get_description",1,"Xapian::ESetIterator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ESetIterator,0))){
    SWIG_fail_ptr("ESetIterator___tostring",1,SWIGTYPE_p_Xapian__ESetIterator);
  }
  
  {
    try {
      result = ((Xapian::ESetIterator const *)arg1)->get_description();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_ESetIterator(void *obj) {
Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_ESetIterator_methods[] = {
    {"get_term", _wrap_ESetIterator_get_term}, 
    {"next", _wrap_ESetIterator_next}, 
    {"prev", _wrap_ESetIterator_prev}, 
    {"equals", _wrap_ESetIterator_equals}, 
    {"get_weight", _wrap_ESetIterator_get_weight}, 
    {"__tostring", _wrap_ESetIterator___tostring}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_ESetIterator_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_ESetIterator_bases[] = {0};
static const char *swig_Xapian_ESetIterator_base_names[] = {0};
static swig_lua_class _wrap_class_Xapian_ESetIterator = { "ESetIterator", &SWIGTYPE_p_Xapian__ESetIterator,_wrap_new_ESetIterator, swig_delete_ESetIterator, swig_Xapian_ESetIterator_methods, swig_Xapian_ESetIterator_attributes, swig_Xapian_ESetIterator_bases, swig_Xapian_ESetIterator_base_names };

static int _wrap_new_RSet__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::RSet *arg1 = 0 ;
  Xapian::RSet *result = 0 ;
  
  SWIG_check_num_args("Xapian::RSet::RSet",1,1)
  if(!lua_isuserdata(L,1)) SWIG_fail_arg("Xapian::RSet::RSet",1,"Xapian::RSet const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__RSet,0))){
    SWIG_fail_ptr("new_RSet",1,SWIGTYPE_p_Xapian__RSet);
  }
  
  {
    try {
      result = (Xapian::RSet *)new Xapian::RSet((Xapian::RSet const &)*arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__RSet,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_RSet__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::RSet *result = 0 ;
  
  SWIG_check_num_args("Xapian::RSet::RSet",0,0)
  {
    try {
      result = (Xapian::RSet *)new Xapian::RSet();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__RSet,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_RSet(lua_State* L) {
  int argc;
  int argv[2]={
    1,2
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_RSet__SWIG_1(L);
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__RSet, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_new_RSet__SWIG_0(L);
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_RSet'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::RSet::RSet(Xapian::RSet const &)\n"
    "    Xapian::RSet::RSet()\n");
  lua_error(L);return 0;
}


static int _wrap_RSet_size(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::doccount result;
  
  SWIG_check_num_args("Xapian::RSet::size",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::RSet::size",1,"Xapian::RSet const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__RSet,0))){
    SWIG_fail_ptr("RSet_size",1,SWIGTYPE_p_Xapian__RSet);
  }
  
  {
    try {
      result = (Xapian::doccount)((Xapian::RSet const *)arg1)->size();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_RSet_empty(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  bool result;
  
  SWIG_check_num_args("Xapian::RSet::empty",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::RSet::empty",1,"Xapian::RSet const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__RSet,0))){
    SWIG_fail_ptr("RSet_empty",1,SWIGTYPE_p_Xapian__RSet);
  }
  
  {
    try {
      result = (bool)((Xapian::RSet const *)arg1)->empty();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_RSet_add_document__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::docid arg2 ;
  
  SWIG_check_num_args("Xapian::RSet::add_document",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::RSet::add_document",1,"Xapian::RSet *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::RSet::add_document",2,"Xapian::docid");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__RSet,0))){
    SWIG_fail_ptr("RSet_add_document",1,SWIGTYPE_p_Xapian__RSet);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::docid)lua_tonumber(L, 2);
  {
    try {
      (arg1)->add_document(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_RSet_add_document__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  
  SWIG_check_num_args("Xapian::RSet::add_document",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::RSet::add_document",1,"Xapian::RSet *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::RSet::add_document",2,"Xapian::MSetIterator &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__RSet,0))){
    SWIG_fail_ptr("RSet_add_document",1,SWIGTYPE_p_Xapian__RSet);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("RSet_add_document",2,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  {
    try {
      (arg1)->add_document(*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_RSet_add_document(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__RSet, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        void *ptr;
        if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_Xapian__MSetIterator, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        return _wrap_RSet_add_document__SWIG_1(L);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__RSet, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_RSet_add_document__SWIG_0(L);
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'RSet_add_document'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::RSet::add_document(Xapian::docid)\n"
    "    Xapian::RSet::add_document(Xapian::MSetIterator &)\n");
  lua_error(L);return 0;
}


static int _wrap_RSet_remove_document__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::docid arg2 ;
  
  SWIG_check_num_args("Xapian::RSet::remove_document",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::RSet::remove_document",1,"Xapian::RSet *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::RSet::remove_document",2,"Xapian::docid");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__RSet,0))){
    SWIG_fail_ptr("RSet_remove_document",1,SWIGTYPE_p_Xapian__RSet);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::docid)lua_tonumber(L, 2);
  {
    try {
      (arg1)->remove_document(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_RSet_remove_document__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  
  SWIG_check_num_args("Xapian::RSet::remove_document",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::RSet::remove_document",1,"Xapian::RSet *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::RSet::remove_document",2,"Xapian::MSetIterator &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__RSet,0))){
    SWIG_fail_ptr("RSet_remove_document",1,SWIGTYPE_p_Xapian__RSet);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("RSet_remove_document",2,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  {
    try {
      (arg1)->remove_document(*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_RSet_remove_document(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__RSet, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        void *ptr;
        if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_Xapian__MSetIterator, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        return _wrap_RSet_remove_document__SWIG_1(L);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__RSet, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_RSet_remove_document__SWIG_0(L);
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'RSet_remove_document'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::RSet::remove_document(Xapian::docid)\n"
    "    Xapian::RSet::remove_document(Xapian::MSetIterator &)\n");
  lua_error(L);return 0;
}


static int _wrap_RSet_contains__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::docid arg2 ;
  bool result;
  
  SWIG_check_num_args("Xapian::RSet::contains",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::RSet::contains",1,"Xapian::RSet *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::RSet::contains",2,"Xapian::docid");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__RSet,0))){
    SWIG_fail_ptr("RSet_contains",1,SWIGTYPE_p_Xapian__RSet);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::docid)lua_tonumber(L, 2);
  {
    try {
      result = (bool)(arg1)->contains(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_RSet_contains__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("Xapian::RSet::contains",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::RSet::contains",1,"Xapian::RSet *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::RSet::contains",2,"Xapian::MSetIterator &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__RSet,0))){
    SWIG_fail_ptr("RSet_contains",1,SWIGTYPE_p_Xapian__RSet);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("RSet_contains",2,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  {
    try {
      result = (bool)(arg1)->contains(*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_RSet_contains(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__RSet, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        void *ptr;
        if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_Xapian__MSetIterator, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        return _wrap_RSet_contains__SWIG_1(L);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__RSet, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_RSet_contains__SWIG_0(L);
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'RSet_contains'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::RSet::contains(Xapian::docid)\n"
    "    Xapian::RSet::contains(Xapian::MSetIterator &)\n");
  lua_error(L);return 0;
}


static int _wrap_RSet___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::RSet::get_description",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::RSet::get_description",1,"Xapian::RSet const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__RSet,0))){
    SWIG_fail_ptr("RSet___tostring",1,SWIGTYPE_p_Xapian__RSet);
  }
  
  {
    try {
      result = ((Xapian::RSet const *)arg1)->get_description();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_RSet(void *obj) {
Xapian::RSet *arg1 = (Xapian::RSet *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_RSet_methods[] = {
    {"size", _wrap_RSet_size}, 
    {"empty", _wrap_RSet_empty}, 
    {"add_document", _wrap_RSet_add_document}, 
    {"remove_document", _wrap_RSet_remove_document}, 
    {"contains", _wrap_RSet_contains}, 
    {"__tostring", _wrap_RSet___tostring}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_RSet_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_RSet_bases[] = {0};
static const char *swig_Xapian_RSet_base_names[] = {0};
static swig_lua_class _wrap_class_Xapian_RSet = { "RSet", &SWIGTYPE_p_Xapian__RSet,_wrap_new_RSet, swig_delete_RSet, swig_Xapian_RSet_methods, swig_Xapian_RSet_attributes, swig_Xapian_RSet_bases, swig_Xapian_RSet_base_names };

static int _wrap_MatchDecider___call(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MatchDecider *arg1 = (Xapian::MatchDecider *) 0 ;
  Xapian::Document *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("Xapian::MatchDecider::operator ()",2,2)
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::MatchDecider::operator ()",2,"Xapian::Document const &");
  {
    if (lua_isfunction(L, 1)) {
      arg1 = new luaMatchDecider(L);
    }
    else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 1, (void**)&arg1, SWIGTYPE_p_Xapian__MatchDecider, 0))){
        SWIG_fail;
      }
    }
  }
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("MatchDecider___call",2,SWIGTYPE_p_Xapian__Document);
  }
  
  {
    try {
      result = (bool)((Xapian::MatchDecider const *)arg1)->operator ()((Xapian::Document const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_MatchDecider(void *obj) {
Xapian::MatchDecider *arg1 = (Xapian::MatchDecider *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_MatchDecider_methods[] = {
    {"__call", _wrap_MatchDecider___call}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_MatchDecider_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_MatchDecider_bases[] = {0};
static const char *swig_Xapian_MatchDecider_base_names[] = {0};
static swig_lua_class _wrap_class_Xapian_MatchDecider = { "MatchDecider", &SWIGTYPE_p_Xapian__MatchDecider,0, swig_delete_MatchDecider, swig_Xapian_MatchDecider_methods, swig_Xapian_MatchDecider_attributes, swig_Xapian_MatchDecider_bases, swig_Xapian_MatchDecider_base_names };

static int _wrap_ExpandDecider___call(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ExpandDecider *arg1 = (Xapian::ExpandDecider *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  bool result;
  
  SWIG_check_num_args("Xapian::ExpandDecider::operator ()",2,2)
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::ExpandDecider::operator ()",2,"std::string const &");
  {
    if (lua_isfunction(L, 1)) {
      arg1 = new luaExpandDecider(L);
    }
    else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 1, (void**)&arg1, SWIGTYPE_p_Xapian__ExpandDecider, 0))){
        SWIG_fail;
      }
    }
  }
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = (bool)((Xapian::ExpandDecider const *)arg1)->operator ()((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_ExpandDecider(void *obj) {
Xapian::ExpandDecider *arg1 = (Xapian::ExpandDecider *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_ExpandDecider_methods[] = {
    {"__call", _wrap_ExpandDecider___call}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_ExpandDecider_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_ExpandDecider_bases[] = {0};
static const char *swig_Xapian_ExpandDecider_base_names[] = {0};
static swig_lua_class _wrap_class_Xapian_ExpandDecider = { "ExpandDecider", &SWIGTYPE_p_Xapian__ExpandDecider,0, swig_delete_ExpandDecider, swig_Xapian_ExpandDecider_methods, swig_Xapian_ExpandDecider_attributes, swig_Xapian_ExpandDecider_bases, swig_Xapian_ExpandDecider_base_names };

static int _wrap_new_Enquire(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = 0 ;
  Xapian::Enquire *result = 0 ;
  
  SWIG_check_num_args("Xapian::Enquire::Enquire",1,1)
  if(!lua_isuserdata(L,1)) SWIG_fail_arg("Xapian::Enquire::Enquire",1,"Xapian::Database const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("new_Enquire",1,SWIGTYPE_p_Xapian__Database);
  }
  
  {
    try {
      result = (Xapian::Enquire *)new Xapian::Enquire((Xapian::Database const &)*arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__Enquire,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_set_query__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Query *arg2 = 0 ;
  Xapian::termcount arg3 ;
  
  SWIG_check_num_args("Xapian::Enquire::set_query",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::set_query",1,"Xapian::Enquire *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::Enquire::set_query",2,"Xapian::Query const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Enquire::set_query",3,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_set_query",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__Query,0))){
    SWIG_fail_ptr("Enquire_set_query",2,SWIGTYPE_p_Xapian__Query);
  }
  
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::termcount)lua_tonumber(L, 3);
  {
    try {
      (arg1)->set_query((Xapian::Query const &)*arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_set_query__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Query *arg2 = 0 ;
  
  SWIG_check_num_args("Xapian::Enquire::set_query",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::set_query",1,"Xapian::Enquire *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::Enquire::set_query",2,"Xapian::Query const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_set_query",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__Query,0))){
    SWIG_fail_ptr("Enquire_set_query",2,SWIGTYPE_p_Xapian__Query);
  }
  
  {
    try {
      (arg1)->set_query((Xapian::Query const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_set_query(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        void *ptr;
        if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_Xapian__Query, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        return _wrap_Enquire_set_query__SWIG_1(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        void *ptr;
        if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_Xapian__Query, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_Enquire_set_query__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'Enquire_set_query'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Enquire::set_query(Xapian::Query const &,Xapian::termcount)\n"
    "    Xapian::Enquire::set_query(Xapian::Query const &)\n");
  lua_error(L);return 0;
}


static int _wrap_Enquire_get_query(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Query *result = 0 ;
  
  SWIG_check_num_args("Xapian::Enquire::get_query",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::get_query",1,"Xapian::Enquire *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_get_query",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  {
    try {
      result = (Xapian::Query *) &(arg1)->get_query();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__Query,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_add_matchspy(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::MatchSpy *arg2 = (Xapian::MatchSpy *) 0 ;
  
  SWIG_check_num_args("Xapian::Enquire::add_matchspy",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::add_matchspy",1,"Xapian::Enquire *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Xapian::Enquire::add_matchspy",2,"Xapian::MatchSpy *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_add_matchspy",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__MatchSpy,0))){
    SWIG_fail_ptr("Enquire_add_matchspy",2,SWIGTYPE_p_Xapian__MatchSpy);
  }
  
  {
    try {
      (arg1)->add_matchspy(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_clear_matchspies(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  
  SWIG_check_num_args("Xapian::Enquire::clear_matchspies",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::clear_matchspies",1,"Xapian::Enquire *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_clear_matchspies",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  {
    try {
      (arg1)->clear_matchspies();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_set_weighting_scheme(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Weight *arg2 = 0 ;
  
  SWIG_check_num_args("Xapian::Enquire::set_weighting_scheme",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::set_weighting_scheme",1,"Xapian::Enquire *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::Enquire::set_weighting_scheme",2,"Xapian::Weight const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_set_weighting_scheme",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__Weight,0))){
    SWIG_fail_ptr("Enquire_set_weighting_scheme",2,SWIGTYPE_p_Xapian__Weight);
  }
  
  {
    try {
      (arg1)->set_weighting_scheme((Xapian::Weight const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_set_collapse_key__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  Xapian::doccount arg3 ;
  
  SWIG_check_num_args("Xapian::Enquire::set_collapse_key",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::set_collapse_key",1,"Xapian::Enquire *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Enquire::set_collapse_key",2,"Xapian::valueno");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Enquire::set_collapse_key",3,"Xapian::doccount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_set_collapse_key",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::valueno)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::doccount)lua_tonumber(L, 3);
  {
    try {
      (arg1)->set_collapse_key(arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_set_collapse_key__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  
  SWIG_check_num_args("Xapian::Enquire::set_collapse_key",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::set_collapse_key",1,"Xapian::Enquire *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Enquire::set_collapse_key",2,"Xapian::valueno");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_set_collapse_key",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::valueno)lua_tonumber(L, 2);
  {
    try {
      (arg1)->set_collapse_key(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_set_collapse_key(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_Enquire_set_collapse_key__SWIG_1(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_Enquire_set_collapse_key__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'Enquire_set_collapse_key'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Enquire::set_collapse_key(Xapian::valueno,Xapian::doccount)\n"
    "    Xapian::Enquire::set_collapse_key(Xapian::valueno)\n");
  lua_error(L);return 0;
}


static int _wrap_Enquire_set_docid_order(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Enquire::docid_order arg2 ;
  
  SWIG_check_num_args("Xapian::Enquire::set_docid_order",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::set_docid_order",1,"Xapian::Enquire *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Enquire::set_docid_order",2,"Xapian::Enquire::docid_order");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_set_docid_order",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  arg2 = (Xapian::Enquire::docid_order)(int)lua_tonumber(L, 2);
  {
    try {
      (arg1)->set_docid_order(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_set_cutoff__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  int arg2 ;
  Xapian::weight arg3 ;
  
  SWIG_check_num_args("Xapian::Enquire::set_cutoff",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::set_cutoff",1,"Xapian::Enquire *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Enquire::set_cutoff",2,"int");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Enquire::set_cutoff",3,"Xapian::weight");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_set_cutoff",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  arg3 = (Xapian::weight)lua_tonumber(L, 3);
  {
    try {
      (arg1)->set_cutoff(arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_set_cutoff__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  int arg2 ;
  
  SWIG_check_num_args("Xapian::Enquire::set_cutoff",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::set_cutoff",1,"Xapian::Enquire *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Enquire::set_cutoff",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_set_cutoff",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  {
    try {
      (arg1)->set_cutoff(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_set_cutoff(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_Enquire_set_cutoff__SWIG_1(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_Enquire_set_cutoff__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'Enquire_set_cutoff'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Enquire::set_cutoff(int,Xapian::weight)\n"
    "    Xapian::Enquire::set_cutoff(int)\n");
  lua_error(L);return 0;
}


static int _wrap_Enquire_set_sort_by_relevance(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  
  SWIG_check_num_args("Xapian::Enquire::set_sort_by_relevance",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::set_sort_by_relevance",1,"Xapian::Enquire *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_set_sort_by_relevance",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  {
    try {
      (arg1)->set_sort_by_relevance();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_set_sort_by_value__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  bool arg3 ;
  
  SWIG_check_num_args("Xapian::Enquire::set_sort_by_value",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::set_sort_by_value",1,"Xapian::Enquire *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Enquire::set_sort_by_value",2,"Xapian::valueno");
  if(!lua_isboolean(L,3)) SWIG_fail_arg("Xapian::Enquire::set_sort_by_value",3,"bool");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_set_sort_by_value",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::valueno)lua_tonumber(L, 2);
  arg3 = (lua_toboolean(L, 3)!=0);
  {
    try {
      (arg1)->set_sort_by_value(arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_set_sort_by_value__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  
  SWIG_check_num_args("Xapian::Enquire::set_sort_by_value",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::set_sort_by_value",1,"Xapian::Enquire *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Enquire::set_sort_by_value",2,"Xapian::valueno");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_set_sort_by_value",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::valueno)lua_tonumber(L, 2);
  {
    try {
      (arg1)->set_sort_by_value(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_set_sort_by_value(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_Enquire_set_sort_by_value__SWIG_1(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isboolean(L,argv[2]);
        }
        if (_v) {
          return _wrap_Enquire_set_sort_by_value__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'Enquire_set_sort_by_value'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Enquire::set_sort_by_value(Xapian::valueno,bool)\n"
    "    Xapian::Enquire::set_sort_by_value(Xapian::valueno)\n");
  lua_error(L);return 0;
}


static int _wrap_Enquire_set_sort_by_value_then_relevance__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  bool arg3 ;
  
  SWIG_check_num_args("Xapian::Enquire::set_sort_by_value_then_relevance",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::set_sort_by_value_then_relevance",1,"Xapian::Enquire *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Enquire::set_sort_by_value_then_relevance",2,"Xapian::valueno");
  if(!lua_isboolean(L,3)) SWIG_fail_arg("Xapian::Enquire::set_sort_by_value_then_relevance",3,"bool");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_set_sort_by_value_then_relevance",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::valueno)lua_tonumber(L, 2);
  arg3 = (lua_toboolean(L, 3)!=0);
  {
    try {
      (arg1)->set_sort_by_value_then_relevance(arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_set_sort_by_value_then_relevance__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  
  SWIG_check_num_args("Xapian::Enquire::set_sort_by_value_then_relevance",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::set_sort_by_value_then_relevance",1,"Xapian::Enquire *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Enquire::set_sort_by_value_then_relevance",2,"Xapian::valueno");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_set_sort_by_value_then_relevance",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::valueno)lua_tonumber(L, 2);
  {
    try {
      (arg1)->set_sort_by_value_then_relevance(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_set_sort_by_value_then_relevance(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_Enquire_set_sort_by_value_then_relevance__SWIG_1(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isboolean(L,argv[2]);
        }
        if (_v) {
          return _wrap_Enquire_set_sort_by_value_then_relevance__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'Enquire_set_sort_by_value_then_relevance'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Enquire::set_sort_by_value_then_relevance(Xapian::valueno,bool)\n"
    "    Xapian::Enquire::set_sort_by_value_then_relevance(Xapian::valueno)\n");
  lua_error(L);return 0;
}


static int _wrap_Enquire_set_sort_by_relevance_then_value__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  bool arg3 ;
  
  SWIG_check_num_args("Xapian::Enquire::set_sort_by_relevance_then_value",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::set_sort_by_relevance_then_value",1,"Xapian::Enquire *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Enquire::set_sort_by_relevance_then_value",2,"Xapian::valueno");
  if(!lua_isboolean(L,3)) SWIG_fail_arg("Xapian::Enquire::set_sort_by_relevance_then_value",3,"bool");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_set_sort_by_relevance_then_value",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::valueno)lua_tonumber(L, 2);
  arg3 = (lua_toboolean(L, 3)!=0);
  {
    try {
      (arg1)->set_sort_by_relevance_then_value(arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_set_sort_by_relevance_then_value__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  
  SWIG_check_num_args("Xapian::Enquire::set_sort_by_relevance_then_value",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::set_sort_by_relevance_then_value",1,"Xapian::Enquire *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Enquire::set_sort_by_relevance_then_value",2,"Xapian::valueno");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_set_sort_by_relevance_then_value",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::valueno)lua_tonumber(L, 2);
  {
    try {
      (arg1)->set_sort_by_relevance_then_value(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_set_sort_by_relevance_then_value(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_Enquire_set_sort_by_relevance_then_value__SWIG_1(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isboolean(L,argv[2]);
        }
        if (_v) {
          return _wrap_Enquire_set_sort_by_relevance_then_value__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'Enquire_set_sort_by_relevance_then_value'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Enquire::set_sort_by_relevance_then_value(Xapian::valueno,bool)\n"
    "    Xapian::Enquire::set_sort_by_relevance_then_value(Xapian::valueno)\n");
  lua_error(L);return 0;
}


static int _wrap_Enquire_set_sort_by_key__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::KeyMaker *arg2 = (Xapian::KeyMaker *) 0 ;
  bool arg3 ;
  
  SWIG_check_num_args("Xapian::Enquire::set_sort_by_key",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::set_sort_by_key",1,"Xapian::Enquire *");
  if(!lua_isboolean(L,3)) SWIG_fail_arg("Xapian::Enquire::set_sort_by_key",3,"bool");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_set_sort_by_key",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  {
    if (lua_isfunction(L, 2)) {
      arg2 = new luaKeyMaker(L);
    }
    else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 2, (void**)&arg2, SWIGTYPE_p_Xapian__KeyMaker, 0))){
        SWIG_fail;
      }
    }
  }
  arg3 = (lua_toboolean(L, 3)!=0);
  {
    try {
      (arg1)->set_sort_by_key(arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_set_sort_by_key__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Sorter *arg2 = (Xapian::Sorter *) 0 ;
  
  SWIG_check_num_args("Xapian::Enquire::set_sort_by_key",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::set_sort_by_key",1,"Xapian::Enquire *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Xapian::Enquire::set_sort_by_key",2,"Xapian::Sorter *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_set_sort_by_key",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__Sorter,0))){
    SWIG_fail_ptr("Enquire_set_sort_by_key",2,SWIGTYPE_p_Xapian__Sorter);
  }
  
  {
    try {
      (arg1)->set_sort_by_key(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_set_sort_by_key(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        void *ptr;
        if (SWIG_isptrtype(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_Xapian__Sorter, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        return _wrap_Enquire_set_sort_by_key__SWIG_1(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        void *ptr;
        if (lua_isfunction(L, argv[1]) || (SWIG_isptrtype(L, argv[1]) && !SWIG_ConvertPtr(L, argv[1], (void **) &ptr, SWIGTYPE_p_Xapian__KeyMaker, 0))) {
          _v = 1;
        }
        else {
          _v = 0;
        }
      }
      if (_v) {
        {
          _v = lua_isboolean(L,argv[2]);
        }
        if (_v) {
          return _wrap_Enquire_set_sort_by_key__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'Enquire_set_sort_by_key'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Enquire::set_sort_by_key(Xapian::KeyMaker *,bool)\n"
    "    Xapian::Enquire::set_sort_by_key(Xapian::Sorter *)\n");
  lua_error(L);return 0;
}


static int _wrap_Enquire_set_sort_by_key_then_relevance__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::KeyMaker *arg2 = (Xapian::KeyMaker *) 0 ;
  bool arg3 ;
  
  SWIG_check_num_args("Xapian::Enquire::set_sort_by_key_then_relevance",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::set_sort_by_key_then_relevance",1,"Xapian::Enquire *");
  if(!lua_isboolean(L,3)) SWIG_fail_arg("Xapian::Enquire::set_sort_by_key_then_relevance",3,"bool");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_set_sort_by_key_then_relevance",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  {
    if (lua_isfunction(L, 2)) {
      arg2 = new luaKeyMaker(L);
    }
    else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 2, (void**)&arg2, SWIGTYPE_p_Xapian__KeyMaker, 0))){
        SWIG_fail;
      }
    }
  }
  arg3 = (lua_toboolean(L, 3)!=0);
  {
    try {
      (arg1)->set_sort_by_key_then_relevance(arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_set_sort_by_key_then_relevance__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Sorter *arg2 = (Xapian::Sorter *) 0 ;
  
  SWIG_check_num_args("Xapian::Enquire::set_sort_by_key_then_relevance",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::set_sort_by_key_then_relevance",1,"Xapian::Enquire *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Xapian::Enquire::set_sort_by_key_then_relevance",2,"Xapian::Sorter *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_set_sort_by_key_then_relevance",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__Sorter,0))){
    SWIG_fail_ptr("Enquire_set_sort_by_key_then_relevance",2,SWIGTYPE_p_Xapian__Sorter);
  }
  
  {
    try {
      (arg1)->set_sort_by_key_then_relevance(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_set_sort_by_key_then_relevance(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        void *ptr;
        if (SWIG_isptrtype(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_Xapian__Sorter, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        return _wrap_Enquire_set_sort_by_key_then_relevance__SWIG_1(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        void *ptr;
        if (lua_isfunction(L, argv[1]) || (SWIG_isptrtype(L, argv[1]) && !SWIG_ConvertPtr(L, argv[1], (void **) &ptr, SWIGTYPE_p_Xapian__KeyMaker, 0))) {
          _v = 1;
        }
        else {
          _v = 0;
        }
      }
      if (_v) {
        {
          _v = lua_isboolean(L,argv[2]);
        }
        if (_v) {
          return _wrap_Enquire_set_sort_by_key_then_relevance__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'Enquire_set_sort_by_key_then_relevance'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Enquire::set_sort_by_key_then_relevance(Xapian::KeyMaker *,bool)\n"
    "    Xapian::Enquire::set_sort_by_key_then_relevance(Xapian::Sorter *)\n");
  lua_error(L);return 0;
}


static int _wrap_Enquire_set_sort_by_relevance_then_key__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::KeyMaker *arg2 = (Xapian::KeyMaker *) 0 ;
  bool arg3 ;
  
  SWIG_check_num_args("Xapian::Enquire::set_sort_by_relevance_then_key",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::set_sort_by_relevance_then_key",1,"Xapian::Enquire *");
  if(!lua_isboolean(L,3)) SWIG_fail_arg("Xapian::Enquire::set_sort_by_relevance_then_key",3,"bool");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_set_sort_by_relevance_then_key",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  {
    if (lua_isfunction(L, 2)) {
      arg2 = new luaKeyMaker(L);
    }
    else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 2, (void**)&arg2, SWIGTYPE_p_Xapian__KeyMaker, 0))){
        SWIG_fail;
      }
    }
  }
  arg3 = (lua_toboolean(L, 3)!=0);
  {
    try {
      (arg1)->set_sort_by_relevance_then_key(arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_set_sort_by_relevance_then_key__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Sorter *arg2 = (Xapian::Sorter *) 0 ;
  
  SWIG_check_num_args("Xapian::Enquire::set_sort_by_relevance_then_key",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::set_sort_by_relevance_then_key",1,"Xapian::Enquire *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Xapian::Enquire::set_sort_by_relevance_then_key",2,"Xapian::Sorter *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_set_sort_by_relevance_then_key",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__Sorter,0))){
    SWIG_fail_ptr("Enquire_set_sort_by_relevance_then_key",2,SWIGTYPE_p_Xapian__Sorter);
  }
  
  {
    try {
      (arg1)->set_sort_by_relevance_then_key(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_set_sort_by_relevance_then_key(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        void *ptr;
        if (SWIG_isptrtype(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_Xapian__Sorter, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        return _wrap_Enquire_set_sort_by_relevance_then_key__SWIG_1(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        void *ptr;
        if (lua_isfunction(L, argv[1]) || (SWIG_isptrtype(L, argv[1]) && !SWIG_ConvertPtr(L, argv[1], (void **) &ptr, SWIGTYPE_p_Xapian__KeyMaker, 0))) {
          _v = 1;
        }
        else {
          _v = 0;
        }
      }
      if (_v) {
        {
          _v = lua_isboolean(L,argv[2]);
        }
        if (_v) {
          return _wrap_Enquire_set_sort_by_relevance_then_key__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'Enquire_set_sort_by_relevance_then_key'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Enquire::set_sort_by_relevance_then_key(Xapian::KeyMaker *,bool)\n"
    "    Xapian::Enquire::set_sort_by_relevance_then_key(Xapian::Sorter *)\n");
  lua_error(L);return 0;
}


static int _wrap_Enquire_get_mset__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  Xapian::doccount arg4 ;
  Xapian::RSet *arg5 = (Xapian::RSet *) 0 ;
  Xapian::MatchDecider *arg6 = (Xapian::MatchDecider *) 0 ;
  Xapian::MatchDecider *arg7 = (Xapian::MatchDecider *) 0 ;
  Xapian::MSet result;
  
  SWIG_check_num_args("Xapian::Enquire::get_mset",7,7)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::get_mset",1,"Xapian::Enquire const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Enquire::get_mset",2,"Xapian::doccount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Enquire::get_mset",3,"Xapian::doccount");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::Enquire::get_mset",4,"Xapian::doccount");
  if(!SWIG_isptrtype(L,5)) SWIG_fail_arg("Xapian::Enquire::get_mset",5,"Xapian::RSet const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_get_mset",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::doccount)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::doccount)lua_tonumber(L, 3);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (Xapian::doccount)lua_tonumber(L, 4);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,5,(void**)&arg5,SWIGTYPE_p_Xapian__RSet,0))){
    SWIG_fail_ptr("Enquire_get_mset",5,SWIGTYPE_p_Xapian__RSet);
  }
  
  {
    if (lua_isfunction(L, 6)) {
      arg6 = new luaMatchDecider(L);
    }
    else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 6, (void**)&arg6, SWIGTYPE_p_Xapian__MatchDecider, 0))){
        SWIG_fail;
      }
    }
  }
  {
    if (lua_isfunction(L, 7)) {
      arg7 = new luaMatchDecider(L);
    }
    else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 7, (void**)&arg7, SWIGTYPE_p_Xapian__MatchDecider, 0))){
        SWIG_fail;
      }
    }
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_mset(arg2,arg3,arg4,(Xapian::RSet const *)arg5,(Xapian::MatchDecider const *)arg6,(Xapian::MatchDecider const *)arg7);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::MSet * resultptr = new Xapian::MSet((const Xapian::MSet &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__MSet,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_get_mset__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  Xapian::doccount arg4 ;
  Xapian::RSet *arg5 = (Xapian::RSet *) 0 ;
  Xapian::MatchDecider *arg6 = (Xapian::MatchDecider *) 0 ;
  Xapian::MSet result;
  
  SWIG_check_num_args("Xapian::Enquire::get_mset",6,6)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::get_mset",1,"Xapian::Enquire const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Enquire::get_mset",2,"Xapian::doccount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Enquire::get_mset",3,"Xapian::doccount");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::Enquire::get_mset",4,"Xapian::doccount");
  if(!SWIG_isptrtype(L,5)) SWIG_fail_arg("Xapian::Enquire::get_mset",5,"Xapian::RSet const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_get_mset",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::doccount)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::doccount)lua_tonumber(L, 3);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (Xapian::doccount)lua_tonumber(L, 4);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,5,(void**)&arg5,SWIGTYPE_p_Xapian__RSet,0))){
    SWIG_fail_ptr("Enquire_get_mset",5,SWIGTYPE_p_Xapian__RSet);
  }
  
  {
    if (lua_isfunction(L, 6)) {
      arg6 = new luaMatchDecider(L);
    }
    else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 6, (void**)&arg6, SWIGTYPE_p_Xapian__MatchDecider, 0))){
        SWIG_fail;
      }
    }
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_mset(arg2,arg3,arg4,(Xapian::RSet const *)arg5,(Xapian::MatchDecider const *)arg6);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::MSet * resultptr = new Xapian::MSet((const Xapian::MSet &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__MSet,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_get_mset__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  Xapian::doccount arg4 ;
  Xapian::RSet *arg5 = (Xapian::RSet *) 0 ;
  Xapian::MSet result;
  
  SWIG_check_num_args("Xapian::Enquire::get_mset",5,5)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::get_mset",1,"Xapian::Enquire const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Enquire::get_mset",2,"Xapian::doccount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Enquire::get_mset",3,"Xapian::doccount");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::Enquire::get_mset",4,"Xapian::doccount");
  if(!SWIG_isptrtype(L,5)) SWIG_fail_arg("Xapian::Enquire::get_mset",5,"Xapian::RSet const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_get_mset",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::doccount)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::doccount)lua_tonumber(L, 3);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (Xapian::doccount)lua_tonumber(L, 4);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,5,(void**)&arg5,SWIGTYPE_p_Xapian__RSet,0))){
    SWIG_fail_ptr("Enquire_get_mset",5,SWIGTYPE_p_Xapian__RSet);
  }
  
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_mset(arg2,arg3,arg4,(Xapian::RSet const *)arg5);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::MSet * resultptr = new Xapian::MSet((const Xapian::MSet &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__MSet,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_get_mset__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  Xapian::doccount arg4 ;
  Xapian::MSet result;
  
  SWIG_check_num_args("Xapian::Enquire::get_mset",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::get_mset",1,"Xapian::Enquire const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Enquire::get_mset",2,"Xapian::doccount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Enquire::get_mset",3,"Xapian::doccount");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::Enquire::get_mset",4,"Xapian::doccount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_get_mset",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::doccount)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::doccount)lua_tonumber(L, 3);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (Xapian::doccount)lua_tonumber(L, 4);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_mset(arg2,arg3,arg4);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::MSet * resultptr = new Xapian::MSet((const Xapian::MSet &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__MSet,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_get_mset__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  Xapian::MSet result;
  
  SWIG_check_num_args("Xapian::Enquire::get_mset",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::get_mset",1,"Xapian::Enquire const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Enquire::get_mset",2,"Xapian::doccount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Enquire::get_mset",3,"Xapian::doccount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_get_mset",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::doccount)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::doccount)lua_tonumber(L, 3);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_mset(arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::MSet * resultptr = new Xapian::MSet((const Xapian::MSet &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__MSet,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_get_mset__SWIG_5(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  Xapian::RSet *arg4 = (Xapian::RSet *) 0 ;
  Xapian::MatchDecider *arg5 = (Xapian::MatchDecider *) 0 ;
  Xapian::MSet result;
  
  SWIG_check_num_args("Xapian::Enquire::get_mset",5,5)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::get_mset",1,"Xapian::Enquire const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Enquire::get_mset",2,"Xapian::doccount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Enquire::get_mset",3,"Xapian::doccount");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("Xapian::Enquire::get_mset",4,"Xapian::RSet const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_get_mset",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::doccount)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::doccount)lua_tonumber(L, 3);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_Xapian__RSet,0))){
    SWIG_fail_ptr("Enquire_get_mset",4,SWIGTYPE_p_Xapian__RSet);
  }
  
  {
    if (lua_isfunction(L, 5)) {
      arg5 = new luaMatchDecider(L);
    }
    else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 5, (void**)&arg5, SWIGTYPE_p_Xapian__MatchDecider, 0))){
        SWIG_fail;
      }
    }
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_mset(arg2,arg3,(Xapian::RSet const *)arg4,(Xapian::MatchDecider const *)arg5);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::MSet * resultptr = new Xapian::MSet((const Xapian::MSet &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__MSet,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_get_mset__SWIG_6(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  Xapian::RSet *arg4 = (Xapian::RSet *) 0 ;
  Xapian::MSet result;
  
  SWIG_check_num_args("Xapian::Enquire::get_mset",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::get_mset",1,"Xapian::Enquire const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Enquire::get_mset",2,"Xapian::doccount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Enquire::get_mset",3,"Xapian::doccount");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("Xapian::Enquire::get_mset",4,"Xapian::RSet const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_get_mset",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::doccount)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::doccount)lua_tonumber(L, 3);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_Xapian__RSet,0))){
    SWIG_fail_ptr("Enquire_get_mset",4,SWIGTYPE_p_Xapian__RSet);
  }
  
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_mset(arg2,arg3,(Xapian::RSet const *)arg4);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::MSet * resultptr = new Xapian::MSet((const Xapian::MSet &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__MSet,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_get_mset(lua_State* L) {
  int argc;
  int argv[8]={
    1,2,3,4,5,6,7,8
  };
  
  argc = lua_gettop(L);
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_Enquire_get_mset__SWIG_4(L);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          {
            void *ptr;
            if (SWIG_isptrtype(L,argv[3])==0 || SWIG_ConvertPtr(L,argv[3], (void **) &ptr, SWIGTYPE_p_Xapian__RSet, 0)) {
              _v = 0;
            } else {
              _v = 1;
            }
          }
          if (_v) {
            return _wrap_Enquire_get_mset__SWIG_6(L);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          {
            _v = lua_isnumber(L,argv[3]);
          }
          if (_v) {
            return _wrap_Enquire_get_mset__SWIG_3(L);
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          {
            void *ptr;
            if (SWIG_isptrtype(L,argv[3])==0 || SWIG_ConvertPtr(L,argv[3], (void **) &ptr, SWIGTYPE_p_Xapian__RSet, 0)) {
              _v = 0;
            } else {
              _v = 1;
            }
          }
          if (_v) {
            {
              void *ptr;
              if (lua_isfunction(L, argv[4]) || (SWIG_isptrtype(L, argv[4]) && !SWIG_ConvertPtr(L, argv[4], (void **) &ptr, SWIGTYPE_p_Xapian__MatchDecider, 0))) {
                _v = 1;
              }
              else {
                _v = 0;
              }
            }
            if (_v) {
              return _wrap_Enquire_get_mset__SWIG_5(L);
            }
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          {
            _v = lua_isnumber(L,argv[3]);
          }
          if (_v) {
            {
              void *ptr;
              if (SWIG_isptrtype(L,argv[4])==0 || SWIG_ConvertPtr(L,argv[4], (void **) &ptr, SWIGTYPE_p_Xapian__RSet, 0)) {
                _v = 0;
              } else {
                _v = 1;
              }
            }
            if (_v) {
              return _wrap_Enquire_get_mset__SWIG_2(L);
            }
          }
        }
      }
    }
  }
  if (argc == 6) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          {
            _v = lua_isnumber(L,argv[3]);
          }
          if (_v) {
            {
              void *ptr;
              if (SWIG_isptrtype(L,argv[4])==0 || SWIG_ConvertPtr(L,argv[4], (void **) &ptr, SWIGTYPE_p_Xapian__RSet, 0)) {
                _v = 0;
              } else {
                _v = 1;
              }
            }
            if (_v) {
              {
                void *ptr;
                if (lua_isfunction(L, argv[5]) || (SWIG_isptrtype(L, argv[5]) && !SWIG_ConvertPtr(L, argv[5], (void **) &ptr, SWIGTYPE_p_Xapian__MatchDecider, 0))) {
                  _v = 1;
                }
                else {
                  _v = 0;
                }
              }
              if (_v) {
                return _wrap_Enquire_get_mset__SWIG_1(L);
              }
            }
          }
        }
      }
    }
  }
  if (argc == 7) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          {
            _v = lua_isnumber(L,argv[3]);
          }
          if (_v) {
            {
              void *ptr;
              if (SWIG_isptrtype(L,argv[4])==0 || SWIG_ConvertPtr(L,argv[4], (void **) &ptr, SWIGTYPE_p_Xapian__RSet, 0)) {
                _v = 0;
              } else {
                _v = 1;
              }
            }
            if (_v) {
              {
                void *ptr;
                if (lua_isfunction(L, argv[5]) || (SWIG_isptrtype(L, argv[5]) && !SWIG_ConvertPtr(L, argv[5], (void **) &ptr, SWIGTYPE_p_Xapian__MatchDecider, 0))) {
                  _v = 1;
                }
                else {
                  _v = 0;
                }
              }
              if (_v) {
                {
                  void *ptr;
                  if (lua_isfunction(L, argv[6]) || (SWIG_isptrtype(L, argv[6]) && !SWIG_ConvertPtr(L, argv[6], (void **) &ptr, SWIGTYPE_p_Xapian__MatchDecider, 0))) {
                    _v = 1;
                  }
                  else {
                    _v = 0;
                  }
                }
                if (_v) {
                  return _wrap_Enquire_get_mset__SWIG_0(L);
                }
              }
            }
          }
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'Enquire_get_mset'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Enquire::get_mset(Xapian::doccount,Xapian::doccount,Xapian::doccount,Xapian::RSet const *,Xapian::MatchDecider const *,Xapian::MatchDecider const *) const\n"
    "    Xapian::Enquire::get_mset(Xapian::doccount,Xapian::doccount,Xapian::doccount,Xapian::RSet const *,Xapian::MatchDecider const *) const\n"
    "    Xapian::Enquire::get_mset(Xapian::doccount,Xapian::doccount,Xapian::doccount,Xapian::RSet const *) const\n"
    "    Xapian::Enquire::get_mset(Xapian::doccount,Xapian::doccount,Xapian::doccount) const\n"
    "    Xapian::Enquire::get_mset(Xapian::doccount,Xapian::doccount) const\n"
    "    Xapian::Enquire::get_mset(Xapian::doccount,Xapian::doccount,Xapian::RSet const *,Xapian::MatchDecider const *) const\n"
    "    Xapian::Enquire::get_mset(Xapian::doccount,Xapian::doccount,Xapian::RSet const *) const\n");
  lua_error(L);return 0;
}


static int _wrap_Enquire_get_eset__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::RSet *arg3 = 0 ;
  int arg4 ;
  double arg5 ;
  Xapian::ExpandDecider *arg6 = (Xapian::ExpandDecider *) 0 ;
  Xapian::ESet result;
  
  SWIG_check_num_args("Xapian::Enquire::get_eset",6,6)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::get_eset",1,"Xapian::Enquire const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Enquire::get_eset",2,"Xapian::termcount");
  if(!lua_isuserdata(L,3)) SWIG_fail_arg("Xapian::Enquire::get_eset",3,"Xapian::RSet const &");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::Enquire::get_eset",4,"int");
  if(!lua_isnumber(L,5)) SWIG_fail_arg("Xapian::Enquire::get_eset",5,"double");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_get_eset",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::termcount)lua_tonumber(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_Xapian__RSet,0))){
    SWIG_fail_ptr("Enquire_get_eset",3,SWIGTYPE_p_Xapian__RSet);
  }
  
  arg4 = (int)lua_tonumber(L, 4);
  arg5 = (double)lua_tonumber(L, 5);
  {
    if (lua_isfunction(L, 6)) {
      arg6 = new luaExpandDecider(L);
    }
    else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 6, (void**)&arg6, SWIGTYPE_p_Xapian__ExpandDecider, 0))){
        SWIG_fail;
      }
    }
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_eset(arg2,(Xapian::RSet const &)*arg3,arg4,arg5,(Xapian::ExpandDecider const *)arg6);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::ESet * resultptr = new Xapian::ESet((const Xapian::ESet &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__ESet,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_get_eset__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::RSet *arg3 = 0 ;
  int arg4 ;
  double arg5 ;
  Xapian::ESet result;
  
  SWIG_check_num_args("Xapian::Enquire::get_eset",5,5)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::get_eset",1,"Xapian::Enquire const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Enquire::get_eset",2,"Xapian::termcount");
  if(!lua_isuserdata(L,3)) SWIG_fail_arg("Xapian::Enquire::get_eset",3,"Xapian::RSet const &");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::Enquire::get_eset",4,"int");
  if(!lua_isnumber(L,5)) SWIG_fail_arg("Xapian::Enquire::get_eset",5,"double");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_get_eset",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::termcount)lua_tonumber(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_Xapian__RSet,0))){
    SWIG_fail_ptr("Enquire_get_eset",3,SWIGTYPE_p_Xapian__RSet);
  }
  
  arg4 = (int)lua_tonumber(L, 4);
  arg5 = (double)lua_tonumber(L, 5);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_eset(arg2,(Xapian::RSet const &)*arg3,arg4,arg5);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::ESet * resultptr = new Xapian::ESet((const Xapian::ESet &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__ESet,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_get_eset__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::RSet *arg3 = 0 ;
  int arg4 ;
  Xapian::ESet result;
  
  SWIG_check_num_args("Xapian::Enquire::get_eset",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::get_eset",1,"Xapian::Enquire const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Enquire::get_eset",2,"Xapian::termcount");
  if(!lua_isuserdata(L,3)) SWIG_fail_arg("Xapian::Enquire::get_eset",3,"Xapian::RSet const &");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::Enquire::get_eset",4,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_get_eset",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::termcount)lua_tonumber(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_Xapian__RSet,0))){
    SWIG_fail_ptr("Enquire_get_eset",3,SWIGTYPE_p_Xapian__RSet);
  }
  
  arg4 = (int)lua_tonumber(L, 4);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_eset(arg2,(Xapian::RSet const &)*arg3,arg4);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::ESet * resultptr = new Xapian::ESet((const Xapian::ESet &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__ESet,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_get_eset__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::RSet *arg3 = 0 ;
  Xapian::ESet result;
  
  SWIG_check_num_args("Xapian::Enquire::get_eset",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::get_eset",1,"Xapian::Enquire const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Enquire::get_eset",2,"Xapian::termcount");
  if(!lua_isuserdata(L,3)) SWIG_fail_arg("Xapian::Enquire::get_eset",3,"Xapian::RSet const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_get_eset",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::termcount)lua_tonumber(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_Xapian__RSet,0))){
    SWIG_fail_ptr("Enquire_get_eset",3,SWIGTYPE_p_Xapian__RSet);
  }
  
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_eset(arg2,(Xapian::RSet const &)*arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::ESet * resultptr = new Xapian::ESet((const Xapian::ESet &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__ESet,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_get_eset__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::RSet *arg3 = 0 ;
  int arg4 ;
  double arg5 ;
  Xapian::ExpandDecider *arg6 = (Xapian::ExpandDecider *) 0 ;
  Xapian::weight arg7 ;
  Xapian::ESet result;
  
  SWIG_check_num_args("Xapian::Enquire::get_eset",7,7)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::get_eset",1,"Xapian::Enquire const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Enquire::get_eset",2,"Xapian::termcount");
  if(!lua_isuserdata(L,3)) SWIG_fail_arg("Xapian::Enquire::get_eset",3,"Xapian::RSet const &");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::Enquire::get_eset",4,"int");
  if(!lua_isnumber(L,5)) SWIG_fail_arg("Xapian::Enquire::get_eset",5,"double");
  if(!lua_isnumber(L,7)) SWIG_fail_arg("Xapian::Enquire::get_eset",7,"Xapian::weight");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_get_eset",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::termcount)lua_tonumber(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_Xapian__RSet,0))){
    SWIG_fail_ptr("Enquire_get_eset",3,SWIGTYPE_p_Xapian__RSet);
  }
  
  arg4 = (int)lua_tonumber(L, 4);
  arg5 = (double)lua_tonumber(L, 5);
  {
    if (lua_isfunction(L, 6)) {
      arg6 = new luaExpandDecider(L);
    }
    else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 6, (void**)&arg6, SWIGTYPE_p_Xapian__ExpandDecider, 0))){
        SWIG_fail;
      }
    }
  }
  arg7 = (Xapian::weight)lua_tonumber(L, 7);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_eset(arg2,(Xapian::RSet const &)*arg3,arg4,arg5,(Xapian::ExpandDecider const *)arg6,arg7);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::ESet * resultptr = new Xapian::ESet((const Xapian::ESet &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__ESet,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_get_eset__SWIG_5(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::RSet *arg3 = 0 ;
  Xapian::ExpandDecider *arg4 = (Xapian::ExpandDecider *) 0 ;
  Xapian::ESet result;
  
  SWIG_check_num_args("Xapian::Enquire::get_eset",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::get_eset",1,"Xapian::Enquire const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Enquire::get_eset",2,"Xapian::termcount");
  if(!lua_isuserdata(L,3)) SWIG_fail_arg("Xapian::Enquire::get_eset",3,"Xapian::RSet const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_get_eset",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::termcount)lua_tonumber(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_Xapian__RSet,0))){
    SWIG_fail_ptr("Enquire_get_eset",3,SWIGTYPE_p_Xapian__RSet);
  }
  
  {
    if (lua_isfunction(L, 4)) {
      arg4 = new luaExpandDecider(L);
    }
    else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 4, (void**)&arg4, SWIGTYPE_p_Xapian__ExpandDecider, 0))){
        SWIG_fail;
      }
    }
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_eset(arg2,(Xapian::RSet const &)*arg3,(Xapian::ExpandDecider const *)arg4);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::ESet * resultptr = new Xapian::ESet((const Xapian::ESet &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__ESet,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_get_eset(lua_State* L) {
  int argc;
  int argv[8]={
    1,2,3,4,5,6,7,8
  };
  
  argc = lua_gettop(L);
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          void *ptr;
          if (lua_isuserdata(L,argv[2])==0 || SWIG_ConvertPtr(L,argv[2], (void **) &ptr, SWIGTYPE_p_Xapian__RSet, 0)) {
            _v = 0;
          } else {
            _v = 1;
          }
        }
        if (_v) {
          return _wrap_Enquire_get_eset__SWIG_3(L);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          void *ptr;
          if (lua_isuserdata(L,argv[2])==0 || SWIG_ConvertPtr(L,argv[2], (void **) &ptr, SWIGTYPE_p_Xapian__RSet, 0)) {
            _v = 0;
          } else {
            _v = 1;
          }
        }
        if (_v) {
          {
            _v = lua_isnumber(L,argv[3]);
          }
          if (_v) {
            return _wrap_Enquire_get_eset__SWIG_2(L);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          void *ptr;
          if (lua_isuserdata(L,argv[2])==0 || SWIG_ConvertPtr(L,argv[2], (void **) &ptr, SWIGTYPE_p_Xapian__RSet, 0)) {
            _v = 0;
          } else {
            _v = 1;
          }
        }
        if (_v) {
          {
            void *ptr;
            if (lua_isfunction(L, argv[3]) || (SWIG_isptrtype(L, argv[3]) && !SWIG_ConvertPtr(L, argv[3], (void **) &ptr, SWIGTYPE_p_Xapian__ExpandDecider, 0))) {
              _v = 1;
            }
            else {
              _v = 0;
            }
          }
          if (_v) {
            return _wrap_Enquire_get_eset__SWIG_5(L);
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          void *ptr;
          if (lua_isuserdata(L,argv[2])==0 || SWIG_ConvertPtr(L,argv[2], (void **) &ptr, SWIGTYPE_p_Xapian__RSet, 0)) {
            _v = 0;
          } else {
            _v = 1;
          }
        }
        if (_v) {
          {
            _v = lua_isnumber(L,argv[3]);
          }
          if (_v) {
            {
              _v = lua_isnumber(L,argv[4]);
            }
            if (_v) {
              return _wrap_Enquire_get_eset__SWIG_1(L);
            }
          }
        }
      }
    }
  }
  if (argc == 6) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          void *ptr;
          if (lua_isuserdata(L,argv[2])==0 || SWIG_ConvertPtr(L,argv[2], (void **) &ptr, SWIGTYPE_p_Xapian__RSet, 0)) {
            _v = 0;
          } else {
            _v = 1;
          }
        }
        if (_v) {
          {
            _v = lua_isnumber(L,argv[3]);
          }
          if (_v) {
            {
              _v = lua_isnumber(L,argv[4]);
            }
            if (_v) {
              {
                void *ptr;
                if (lua_isfunction(L, argv[5]) || (SWIG_isptrtype(L, argv[5]) && !SWIG_ConvertPtr(L, argv[5], (void **) &ptr, SWIGTYPE_p_Xapian__ExpandDecider, 0))) {
                  _v = 1;
                }
                else {
                  _v = 0;
                }
              }
              if (_v) {
                return _wrap_Enquire_get_eset__SWIG_0(L);
              }
            }
          }
        }
      }
    }
  }
  if (argc == 7) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          void *ptr;
          if (lua_isuserdata(L,argv[2])==0 || SWIG_ConvertPtr(L,argv[2], (void **) &ptr, SWIGTYPE_p_Xapian__RSet, 0)) {
            _v = 0;
          } else {
            _v = 1;
          }
        }
        if (_v) {
          {
            _v = lua_isnumber(L,argv[3]);
          }
          if (_v) {
            {
              _v = lua_isnumber(L,argv[4]);
            }
            if (_v) {
              {
                void *ptr;
                if (lua_isfunction(L, argv[5]) || (SWIG_isptrtype(L, argv[5]) && !SWIG_ConvertPtr(L, argv[5], (void **) &ptr, SWIGTYPE_p_Xapian__ExpandDecider, 0))) {
                  _v = 1;
                }
                else {
                  _v = 0;
                }
              }
              if (_v) {
                {
                  _v = lua_isnumber(L,argv[6]);
                }
                if (_v) {
                  return _wrap_Enquire_get_eset__SWIG_4(L);
                }
              }
            }
          }
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'Enquire_get_eset'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Enquire::get_eset(Xapian::termcount,Xapian::RSet const &,int,double,Xapian::ExpandDecider const *) const\n"
    "    Xapian::Enquire::get_eset(Xapian::termcount,Xapian::RSet const &,int,double) const\n"
    "    Xapian::Enquire::get_eset(Xapian::termcount,Xapian::RSet const &,int) const\n"
    "    Xapian::Enquire::get_eset(Xapian::termcount,Xapian::RSet const &) const\n"
    "    Xapian::Enquire::get_eset(Xapian::termcount,Xapian::RSet const &,int,double,Xapian::ExpandDecider const *,Xapian::weight) const\n"
    "    Xapian::Enquire::get_eset(Xapian::termcount,Xapian::RSet const &,Xapian::ExpandDecider const *) const\n");
  lua_error(L);return 0;
}


static int _wrap_Enquire_get_matching_terms_begin__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::docid arg2 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::Enquire::get_matching_terms_begin",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::get_matching_terms_begin",1,"Xapian::Enquire const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Enquire::get_matching_terms_begin",2,"Xapian::docid");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_get_matching_terms_begin",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::docid)lua_tonumber(L, 2);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_matching_terms_begin(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_get_matching_terms_end__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::docid arg2 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::Enquire::get_matching_terms_end",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::get_matching_terms_end",1,"Xapian::Enquire const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Enquire::get_matching_terms_end",2,"Xapian::docid");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_get_matching_terms_end",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::docid)lua_tonumber(L, 2);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_matching_terms_end(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_get_matching_terms_begin__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::Enquire::get_matching_terms_begin",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::get_matching_terms_begin",1,"Xapian::Enquire const *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::Enquire::get_matching_terms_begin",2,"Xapian::MSetIterator const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_get_matching_terms_begin",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("Enquire_get_matching_terms_begin",2,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_matching_terms_begin((Xapian::MSetIterator const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_get_matching_terms_begin(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        void *ptr;
        if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_Xapian__MSetIterator, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        return _wrap_Enquire_get_matching_terms_begin__SWIG_1(L);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_Enquire_get_matching_terms_begin__SWIG_0(L);
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'Enquire_get_matching_terms_begin'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Enquire::get_matching_terms_begin(Xapian::docid) const\n"
    "    Xapian::Enquire::get_matching_terms_begin(Xapian::MSetIterator const &) const\n");
  lua_error(L);return 0;
}


static int _wrap_Enquire_get_matching_terms_end__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::Enquire::get_matching_terms_end",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::get_matching_terms_end",1,"Xapian::Enquire const *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::Enquire::get_matching_terms_end",2,"Xapian::MSetIterator const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_get_matching_terms_end",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("Enquire_get_matching_terms_end",2,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_matching_terms_end((Xapian::MSetIterator const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_get_matching_terms_end(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        void *ptr;
        if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_Xapian__MSetIterator, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        return _wrap_Enquire_get_matching_terms_end__SWIG_1(L);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_Enquire_get_matching_terms_end__SWIG_0(L);
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'Enquire_get_matching_terms_end'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Enquire::get_matching_terms_end(Xapian::docid) const\n"
    "    Xapian::Enquire::get_matching_terms_end(Xapian::MSetIterator const &) const\n");
  lua_error(L);return 0;
}


static int _wrap_Enquire___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::Enquire::get_description",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::get_description",1,"Xapian::Enquire const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire___tostring",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_description();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_get_matching_terms__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::docid arg2 ;
  std::pair< Xapian::TermIterator,Xapian::TermIterator > result;
  
  SWIG_check_num_args("Xapian::Enquire::get_matching_terms",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::get_matching_terms",1,"Xapian::Enquire *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Enquire::get_matching_terms",2,"Xapian::docid");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_get_matching_terms",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::docid)lua_tonumber(L, 2);
  result = Xapian_Enquire_get_matching_terms__SWIG_0(arg1,arg2);
  {
    lua_getglobal(L, "xapian");
    lua_pushstring(L, "Iterator");
    lua_gettable(L, -2);
    lua_remove(L, -2);
    
    if (!lua_isfunction(L, -1)) {
      luaL_typerror(L, -1, "function");
    }
    
    Xapian::TermIterator * begin = new Xapian::TermIterator((const Xapian::TermIterator &)(&result)->first);
    SWIG_NewPointerObj(L, (void *) begin, SWIGTYPE_p_Xapian__TermIterator, 1);
    
    Xapian::TermIterator * end = new Xapian::TermIterator((const Xapian::TermIterator &)(&result)->second);
    SWIG_NewPointerObj(L, (void *) end, SWIGTYPE_p_Xapian__TermIterator, 1);
    
    if (lua_pcall(L, 2, 1, 0) != 0) {
      luaL_error(L, "error running function: %s", lua_tostring(L, -1));
    }
    
    SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_get_matching_terms__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  std::pair< Xapian::TermIterator,Xapian::TermIterator > result;
  
  SWIG_check_num_args("Xapian::Enquire::get_matching_terms",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::get_matching_terms",1,"Xapian::Enquire *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::Enquire::get_matching_terms",2,"Xapian::MSetIterator const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_get_matching_terms",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("Enquire_get_matching_terms",2,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  result = Xapian_Enquire_get_matching_terms__SWIG_1(arg1,(Xapian::MSetIterator const &)*arg2);
  {
    lua_getglobal(L, "xapian");
    lua_pushstring(L, "Iterator");
    lua_gettable(L, -2);
    lua_remove(L, -2);
    
    if (!lua_isfunction(L, -1)) {
      luaL_typerror(L, -1, "function");
    }
    
    Xapian::TermIterator * begin = new Xapian::TermIterator((const Xapian::TermIterator &)(&result)->first);
    SWIG_NewPointerObj(L, (void *) begin, SWIGTYPE_p_Xapian__TermIterator, 1);
    
    Xapian::TermIterator * end = new Xapian::TermIterator((const Xapian::TermIterator &)(&result)->second);
    SWIG_NewPointerObj(L, (void *) end, SWIGTYPE_p_Xapian__TermIterator, 1);
    
    if (lua_pcall(L, 2, 1, 0) != 0) {
      luaL_error(L, "error running function: %s", lua_tostring(L, -1));
    }
    
    SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Enquire_get_matching_terms(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        void *ptr;
        if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_Xapian__MSetIterator, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        return _wrap_Enquire_get_matching_terms__SWIG_1(L);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Enquire, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_Enquire_get_matching_terms__SWIG_0(L);
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'Enquire_get_matching_terms'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Enquire::get_matching_terms(Xapian::docid)\n"
    "    Xapian::Enquire::get_matching_terms(Xapian::MSetIterator const &)\n");
  lua_error(L);return 0;
}


static void swig_delete_Enquire(void *obj) {
Xapian::Enquire *arg1 = (Xapian::Enquire *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_Enquire_methods[] = {
    {"set_query", _wrap_Enquire_set_query}, 
    {"get_query", _wrap_Enquire_get_query}, 
    {"add_matchspy", _wrap_Enquire_add_matchspy}, 
    {"clear_matchspies", _wrap_Enquire_clear_matchspies}, 
    {"set_weighting_scheme", _wrap_Enquire_set_weighting_scheme}, 
    {"set_collapse_key", _wrap_Enquire_set_collapse_key}, 
    {"set_docid_order", _wrap_Enquire_set_docid_order}, 
    {"set_cutoff", _wrap_Enquire_set_cutoff}, 
    {"set_sort_by_relevance", _wrap_Enquire_set_sort_by_relevance}, 
    {"set_sort_by_value", _wrap_Enquire_set_sort_by_value}, 
    {"set_sort_by_value_then_relevance", _wrap_Enquire_set_sort_by_value_then_relevance}, 
    {"set_sort_by_relevance_then_value", _wrap_Enquire_set_sort_by_relevance_then_value}, 
    {"set_sort_by_key", _wrap_Enquire_set_sort_by_key}, 
    {"set_sort_by_key_then_relevance", _wrap_Enquire_set_sort_by_key_then_relevance}, 
    {"set_sort_by_relevance_then_key", _wrap_Enquire_set_sort_by_relevance_then_key}, 
    {"get_mset", _wrap_Enquire_get_mset}, 
    {"get_eset", _wrap_Enquire_get_eset}, 
    {"get_matching_terms_begin", _wrap_Enquire_get_matching_terms_begin}, 
    {"get_matching_terms_end", _wrap_Enquire_get_matching_terms_end}, 
    {"__tostring", _wrap_Enquire___tostring}, 
    {"get_matching_terms", _wrap_Enquire_get_matching_terms}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_Enquire_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_Enquire_bases[] = {0};
static const char *swig_Xapian_Enquire_base_names[] = {0};
static swig_lua_class _wrap_class_Xapian_Enquire = { "Enquire", &SWIGTYPE_p_Xapian__Enquire,_wrap_new_Enquire, swig_delete_Enquire, swig_Xapian_Enquire_methods, swig_Xapian_Enquire_attributes, swig_Xapian_Enquire_bases, swig_Xapian_Enquire_base_names };

static int _wrap_new_Registry__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Registry *arg1 = 0 ;
  Xapian::Registry *result = 0 ;
  
  SWIG_check_num_args("Xapian::Registry::Registry",1,1)
  if(!lua_isuserdata(L,1)) SWIG_fail_arg("Xapian::Registry::Registry",1,"Xapian::Registry const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Registry,0))){
    SWIG_fail_ptr("new_Registry",1,SWIGTYPE_p_Xapian__Registry);
  }
  
  {
    try {
      result = (Xapian::Registry *)new Xapian::Registry((Xapian::Registry const &)*arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__Registry,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_Registry__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Registry *result = 0 ;
  
  SWIG_check_num_args("Xapian::Registry::Registry",0,0)
  {
    try {
      result = (Xapian::Registry *)new Xapian::Registry();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__Registry,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_Registry(lua_State* L) {
  int argc;
  int argv[2]={
    1,2
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_Registry__SWIG_1(L);
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Registry, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_new_Registry__SWIG_0(L);
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_Registry'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Registry::Registry(Xapian::Registry const &)\n"
    "    Xapian::Registry::Registry()\n");
  lua_error(L);return 0;
}


static int _wrap_Registry_register_weighting_scheme(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Registry *arg1 = (Xapian::Registry *) 0 ;
  Xapian::Weight *arg2 = 0 ;
  
  SWIG_check_num_args("Xapian::Registry::register_weighting_scheme",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Registry::register_weighting_scheme",1,"Xapian::Registry *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::Registry::register_weighting_scheme",2,"Xapian::Weight const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Registry,0))){
    SWIG_fail_ptr("Registry_register_weighting_scheme",1,SWIGTYPE_p_Xapian__Registry);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__Weight,0))){
    SWIG_fail_ptr("Registry_register_weighting_scheme",2,SWIGTYPE_p_Xapian__Weight);
  }
  
  {
    try {
      (arg1)->register_weighting_scheme((Xapian::Weight const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Registry_get_weighting_scheme(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Registry *arg1 = (Xapian::Registry *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  Xapian::Weight *result = 0 ;
  
  SWIG_check_num_args("Xapian::Registry::get_weighting_scheme",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Registry::get_weighting_scheme",1,"Xapian::Registry const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Registry::get_weighting_scheme",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Registry,0))){
    SWIG_fail_ptr("Registry_get_weighting_scheme",1,SWIGTYPE_p_Xapian__Registry);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = (Xapian::Weight *)((Xapian::Registry const *)arg1)->get_weighting_scheme((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__Weight,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Registry_register_posting_source(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Registry *arg1 = (Xapian::Registry *) 0 ;
  Xapian::PostingSource *arg2 = 0 ;
  
  SWIG_check_num_args("Xapian::Registry::register_posting_source",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Registry::register_posting_source",1,"Xapian::Registry *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::Registry::register_posting_source",2,"Xapian::PostingSource const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Registry,0))){
    SWIG_fail_ptr("Registry_register_posting_source",1,SWIGTYPE_p_Xapian__Registry);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__PostingSource,0))){
    SWIG_fail_ptr("Registry_register_posting_source",2,SWIGTYPE_p_Xapian__PostingSource);
  }
  
  {
    try {
      (arg1)->register_posting_source((Xapian::PostingSource const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Registry_get_posting_source(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Registry *arg1 = (Xapian::Registry *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  Xapian::PostingSource *result = 0 ;
  
  SWIG_check_num_args("Xapian::Registry::get_posting_source",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Registry::get_posting_source",1,"Xapian::Registry const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Registry::get_posting_source",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Registry,0))){
    SWIG_fail_ptr("Registry_get_posting_source",1,SWIGTYPE_p_Xapian__Registry);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = (Xapian::PostingSource *)((Xapian::Registry const *)arg1)->get_posting_source((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__PostingSource,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Registry_register_match_spy(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Registry *arg1 = (Xapian::Registry *) 0 ;
  Xapian::MatchSpy *arg2 = 0 ;
  
  SWIG_check_num_args("Xapian::Registry::register_match_spy",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Registry::register_match_spy",1,"Xapian::Registry *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::Registry::register_match_spy",2,"Xapian::MatchSpy const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Registry,0))){
    SWIG_fail_ptr("Registry_register_match_spy",1,SWIGTYPE_p_Xapian__Registry);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__MatchSpy,0))){
    SWIG_fail_ptr("Registry_register_match_spy",2,SWIGTYPE_p_Xapian__MatchSpy);
  }
  
  {
    try {
      (arg1)->register_match_spy((Xapian::MatchSpy const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Registry_get_match_spy(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Registry *arg1 = (Xapian::Registry *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  Xapian::MatchSpy *result = 0 ;
  
  SWIG_check_num_args("Xapian::Registry::get_match_spy",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Registry::get_match_spy",1,"Xapian::Registry const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Registry::get_match_spy",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Registry,0))){
    SWIG_fail_ptr("Registry_get_match_spy",1,SWIGTYPE_p_Xapian__Registry);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = (Xapian::MatchSpy *)((Xapian::Registry const *)arg1)->get_match_spy((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__MatchSpy,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_Registry(void *obj) {
Xapian::Registry *arg1 = (Xapian::Registry *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_Registry_methods[] = {
    {"register_weighting_scheme", _wrap_Registry_register_weighting_scheme}, 
    {"get_weighting_scheme", _wrap_Registry_get_weighting_scheme}, 
    {"register_posting_source", _wrap_Registry_register_posting_source}, 
    {"get_posting_source", _wrap_Registry_get_posting_source}, 
    {"register_match_spy", _wrap_Registry_register_match_spy}, 
    {"get_match_spy", _wrap_Registry_get_match_spy}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_Registry_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_Registry_bases[] = {0};
static const char *swig_Xapian_Registry_base_names[] = {0};
static swig_lua_class _wrap_class_Xapian_Registry = { "Registry", &SWIGTYPE_p_Xapian__Registry,_wrap_new_Registry, swig_delete_Registry, swig_Xapian_Registry_methods, swig_Xapian_Registry_attributes, swig_Xapian_Registry_bases, swig_Xapian_Registry_base_names };

static int _wrap_Weight_name(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::Weight::name",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Weight::name",1,"Xapian::Weight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Weight,0))){
    SWIG_fail_ptr("Weight_name",1,SWIGTYPE_p_Xapian__Weight);
  }
  
  {
    try {
      result = ((Xapian::Weight const *)arg1)->name();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Weight_get_sumpart(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  Xapian::weight result;
  
  SWIG_check_num_args("Xapian::Weight::get_sumpart",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Weight::get_sumpart",1,"Xapian::Weight const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Weight::get_sumpart",2,"Xapian::termcount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Weight::get_sumpart",3,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Weight,0))){
    SWIG_fail_ptr("Weight_get_sumpart",1,SWIGTYPE_p_Xapian__Weight);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::termcount)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::termcount)lua_tonumber(L, 3);
  {
    try {
      result = (Xapian::weight)((Xapian::Weight const *)arg1)->get_sumpart(arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Weight_get_maxpart(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  Xapian::weight result;
  
  SWIG_check_num_args("Xapian::Weight::get_maxpart",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Weight::get_maxpart",1,"Xapian::Weight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Weight,0))){
    SWIG_fail_ptr("Weight_get_maxpart",1,SWIGTYPE_p_Xapian__Weight);
  }
  
  {
    try {
      result = (Xapian::weight)((Xapian::Weight const *)arg1)->get_maxpart();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Weight_get_sumextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::weight result;
  
  SWIG_check_num_args("Xapian::Weight::get_sumextra",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Weight::get_sumextra",1,"Xapian::Weight const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Weight::get_sumextra",2,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Weight,0))){
    SWIG_fail_ptr("Weight_get_sumextra",1,SWIGTYPE_p_Xapian__Weight);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::termcount)lua_tonumber(L, 2);
  {
    try {
      result = (Xapian::weight)((Xapian::Weight const *)arg1)->get_sumextra(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Weight_get_maxextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  Xapian::weight result;
  
  SWIG_check_num_args("Xapian::Weight::get_maxextra",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Weight::get_maxextra",1,"Xapian::Weight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Weight,0))){
    SWIG_fail_ptr("Weight_get_maxextra",1,SWIGTYPE_p_Xapian__Weight);
  }
  
  {
    try {
      result = (Xapian::weight)((Xapian::Weight const *)arg1)->get_maxextra();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_Weight(void *obj) {
Xapian::Weight *arg1 = (Xapian::Weight *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_Weight_methods[] = {
    {"name", _wrap_Weight_name}, 
    {"get_sumpart", _wrap_Weight_get_sumpart}, 
    {"get_maxpart", _wrap_Weight_get_maxpart}, 
    {"get_sumextra", _wrap_Weight_get_sumextra}, 
    {"get_maxextra", _wrap_Weight_get_maxextra}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_Weight_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_Weight_bases[] = {0};
static const char *swig_Xapian_Weight_base_names[] = {0};
static swig_lua_class _wrap_class_Xapian_Weight = { "Weight", &SWIGTYPE_p_Xapian__Weight,0, swig_delete_Weight, swig_Xapian_Weight_methods, swig_Xapian_Weight_attributes, swig_Xapian_Weight_bases, swig_Xapian_Weight_base_names };

static int _wrap_new_BoolWeight(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::BoolWeight *result = 0 ;
  
  SWIG_check_num_args("Xapian::BoolWeight::BoolWeight",0,0)
  {
    try {
      result = (Xapian::BoolWeight *)new Xapian::BoolWeight();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__BoolWeight,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_BoolWeight_name(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::BoolWeight::name",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::BoolWeight::name",1,"Xapian::BoolWeight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__BoolWeight,0))){
    SWIG_fail_ptr("BoolWeight_name",1,SWIGTYPE_p_Xapian__BoolWeight);
  }
  
  {
    try {
      result = ((Xapian::BoolWeight const *)arg1)->name();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_BoolWeight_get_sumpart(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  Xapian::weight result;
  
  SWIG_check_num_args("Xapian::BoolWeight::get_sumpart",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::BoolWeight::get_sumpart",1,"Xapian::BoolWeight const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::BoolWeight::get_sumpart",2,"Xapian::termcount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::BoolWeight::get_sumpart",3,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__BoolWeight,0))){
    SWIG_fail_ptr("BoolWeight_get_sumpart",1,SWIGTYPE_p_Xapian__BoolWeight);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::termcount)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::termcount)lua_tonumber(L, 3);
  {
    try {
      result = (Xapian::weight)((Xapian::BoolWeight const *)arg1)->get_sumpart(arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_BoolWeight_get_maxpart(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  Xapian::weight result;
  
  SWIG_check_num_args("Xapian::BoolWeight::get_maxpart",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::BoolWeight::get_maxpart",1,"Xapian::BoolWeight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__BoolWeight,0))){
    SWIG_fail_ptr("BoolWeight_get_maxpart",1,SWIGTYPE_p_Xapian__BoolWeight);
  }
  
  {
    try {
      result = (Xapian::weight)((Xapian::BoolWeight const *)arg1)->get_maxpart();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_BoolWeight_get_sumextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::weight result;
  
  SWIG_check_num_args("Xapian::BoolWeight::get_sumextra",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::BoolWeight::get_sumextra",1,"Xapian::BoolWeight const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::BoolWeight::get_sumextra",2,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__BoolWeight,0))){
    SWIG_fail_ptr("BoolWeight_get_sumextra",1,SWIGTYPE_p_Xapian__BoolWeight);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::termcount)lua_tonumber(L, 2);
  {
    try {
      result = (Xapian::weight)((Xapian::BoolWeight const *)arg1)->get_sumextra(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_BoolWeight_get_maxextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  Xapian::weight result;
  
  SWIG_check_num_args("Xapian::BoolWeight::get_maxextra",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::BoolWeight::get_maxextra",1,"Xapian::BoolWeight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__BoolWeight,0))){
    SWIG_fail_ptr("BoolWeight_get_maxextra",1,SWIGTYPE_p_Xapian__BoolWeight);
  }
  
  {
    try {
      result = (Xapian::weight)((Xapian::BoolWeight const *)arg1)->get_maxextra();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_BoolWeight(void *obj) {
Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_BoolWeight_methods[] = {
    {"name", _wrap_BoolWeight_name}, 
    {"get_sumpart", _wrap_BoolWeight_get_sumpart}, 
    {"get_maxpart", _wrap_BoolWeight_get_maxpart}, 
    {"get_sumextra", _wrap_BoolWeight_get_sumextra}, 
    {"get_maxextra", _wrap_BoolWeight_get_maxextra}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_BoolWeight_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_BoolWeight_bases[] = {0,0};
static const char *swig_Xapian_BoolWeight_base_names[] = {"Xapian::Weight *",0};
static swig_lua_class _wrap_class_Xapian_BoolWeight = { "BoolWeight", &SWIGTYPE_p_Xapian__BoolWeight,_wrap_new_BoolWeight, swig_delete_BoolWeight, swig_Xapian_BoolWeight_methods, swig_Xapian_BoolWeight_attributes, swig_Xapian_BoolWeight_bases, swig_Xapian_BoolWeight_base_names };

static int _wrap_new_BM25Weight__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  double arg1 ;
  double arg2 ;
  double arg3 ;
  double arg4 ;
  double arg5 ;
  Xapian::BM25Weight *result = 0 ;
  
  SWIG_check_num_args("Xapian::BM25Weight::BM25Weight",5,5)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::BM25Weight::BM25Weight",1,"double");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::BM25Weight::BM25Weight",2,"double");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::BM25Weight::BM25Weight",3,"double");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::BM25Weight::BM25Weight",4,"double");
  if(!lua_isnumber(L,5)) SWIG_fail_arg("Xapian::BM25Weight::BM25Weight",5,"double");
  arg1 = (double)lua_tonumber(L, 1);
  arg2 = (double)lua_tonumber(L, 2);
  arg3 = (double)lua_tonumber(L, 3);
  arg4 = (double)lua_tonumber(L, 4);
  arg5 = (double)lua_tonumber(L, 5);
  {
    try {
      result = (Xapian::BM25Weight *)new Xapian::BM25Weight(arg1,arg2,arg3,arg4,arg5);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__BM25Weight,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_BM25Weight__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::BM25Weight *result = 0 ;
  
  SWIG_check_num_args("Xapian::BM25Weight::BM25Weight",0,0)
  {
    try {
      result = (Xapian::BM25Weight *)new Xapian::BM25Weight();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__BM25Weight,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_BM25Weight(lua_State* L) {
  int argc;
  int argv[6]={
    1,2,3,4,5,6
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_BM25Weight__SWIG_1(L);
  }
  if (argc == 5) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          {
            _v = lua_isnumber(L,argv[3]);
          }
          if (_v) {
            {
              _v = lua_isnumber(L,argv[4]);
            }
            if (_v) {
              return _wrap_new_BM25Weight__SWIG_0(L);
            }
          }
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_BM25Weight'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::BM25Weight::BM25Weight(double,double,double,double,double)\n"
    "    Xapian::BM25Weight::BM25Weight()\n");
  lua_error(L);return 0;
}


static int _wrap_BM25Weight_name(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::BM25Weight::name",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::BM25Weight::name",1,"Xapian::BM25Weight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__BM25Weight,0))){
    SWIG_fail_ptr("BM25Weight_name",1,SWIGTYPE_p_Xapian__BM25Weight);
  }
  
  {
    try {
      result = ((Xapian::BM25Weight const *)arg1)->name();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_BM25Weight_get_sumpart(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  Xapian::weight result;
  
  SWIG_check_num_args("Xapian::BM25Weight::get_sumpart",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::BM25Weight::get_sumpart",1,"Xapian::BM25Weight const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::BM25Weight::get_sumpart",2,"Xapian::termcount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::BM25Weight::get_sumpart",3,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__BM25Weight,0))){
    SWIG_fail_ptr("BM25Weight_get_sumpart",1,SWIGTYPE_p_Xapian__BM25Weight);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::termcount)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::termcount)lua_tonumber(L, 3);
  {
    try {
      result = (Xapian::weight)((Xapian::BM25Weight const *)arg1)->get_sumpart(arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_BM25Weight_get_maxpart(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  Xapian::weight result;
  
  SWIG_check_num_args("Xapian::BM25Weight::get_maxpart",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::BM25Weight::get_maxpart",1,"Xapian::BM25Weight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__BM25Weight,0))){
    SWIG_fail_ptr("BM25Weight_get_maxpart",1,SWIGTYPE_p_Xapian__BM25Weight);
  }
  
  {
    try {
      result = (Xapian::weight)((Xapian::BM25Weight const *)arg1)->get_maxpart();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_BM25Weight_get_sumextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::weight result;
  
  SWIG_check_num_args("Xapian::BM25Weight::get_sumextra",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::BM25Weight::get_sumextra",1,"Xapian::BM25Weight const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::BM25Weight::get_sumextra",2,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__BM25Weight,0))){
    SWIG_fail_ptr("BM25Weight_get_sumextra",1,SWIGTYPE_p_Xapian__BM25Weight);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::termcount)lua_tonumber(L, 2);
  {
    try {
      result = (Xapian::weight)((Xapian::BM25Weight const *)arg1)->get_sumextra(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_BM25Weight_get_maxextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  Xapian::weight result;
  
  SWIG_check_num_args("Xapian::BM25Weight::get_maxextra",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::BM25Weight::get_maxextra",1,"Xapian::BM25Weight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__BM25Weight,0))){
    SWIG_fail_ptr("BM25Weight_get_maxextra",1,SWIGTYPE_p_Xapian__BM25Weight);
  }
  
  {
    try {
      result = (Xapian::weight)((Xapian::BM25Weight const *)arg1)->get_maxextra();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_BM25Weight(void *obj) {
Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_BM25Weight_methods[] = {
    {"name", _wrap_BM25Weight_name}, 
    {"get_sumpart", _wrap_BM25Weight_get_sumpart}, 
    {"get_maxpart", _wrap_BM25Weight_get_maxpart}, 
    {"get_sumextra", _wrap_BM25Weight_get_sumextra}, 
    {"get_maxextra", _wrap_BM25Weight_get_maxextra}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_BM25Weight_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_BM25Weight_bases[] = {0,0};
static const char *swig_Xapian_BM25Weight_base_names[] = {"Xapian::Weight *",0};
static swig_lua_class _wrap_class_Xapian_BM25Weight = { "BM25Weight", &SWIGTYPE_p_Xapian__BM25Weight,_wrap_new_BM25Weight, swig_delete_BM25Weight, swig_Xapian_BM25Weight_methods, swig_Xapian_BM25Weight_attributes, swig_Xapian_BM25Weight_bases, swig_Xapian_BM25Weight_base_names };

static int _wrap_new_TradWeight__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  double arg1 ;
  Xapian::TradWeight *result = 0 ;
  
  SWIG_check_num_args("Xapian::TradWeight::TradWeight",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::TradWeight::TradWeight",1,"double");
  arg1 = (double)lua_tonumber(L, 1);
  {
    try {
      result = (Xapian::TradWeight *)new Xapian::TradWeight(arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__TradWeight,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_TradWeight__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TradWeight *result = 0 ;
  
  SWIG_check_num_args("Xapian::TradWeight::TradWeight",0,0)
  {
    try {
      result = (Xapian::TradWeight *)new Xapian::TradWeight();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__TradWeight,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_TradWeight(lua_State* L) {
  int argc;
  int argv[2]={
    1,2
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_TradWeight__SWIG_1(L);
  }
  if (argc == 1) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_TradWeight__SWIG_0(L);
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_TradWeight'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::TradWeight::TradWeight(double)\n"
    "    Xapian::TradWeight::TradWeight()\n");
  lua_error(L);return 0;
}


static int _wrap_TradWeight_name(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::TradWeight::name",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TradWeight::name",1,"Xapian::TradWeight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TradWeight,0))){
    SWIG_fail_ptr("TradWeight_name",1,SWIGTYPE_p_Xapian__TradWeight);
  }
  
  {
    try {
      result = ((Xapian::TradWeight const *)arg1)->name();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TradWeight_get_sumpart(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  Xapian::weight result;
  
  SWIG_check_num_args("Xapian::TradWeight::get_sumpart",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TradWeight::get_sumpart",1,"Xapian::TradWeight const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::TradWeight::get_sumpart",2,"Xapian::termcount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::TradWeight::get_sumpart",3,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TradWeight,0))){
    SWIG_fail_ptr("TradWeight_get_sumpart",1,SWIGTYPE_p_Xapian__TradWeight);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::termcount)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::termcount)lua_tonumber(L, 3);
  {
    try {
      result = (Xapian::weight)((Xapian::TradWeight const *)arg1)->get_sumpart(arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TradWeight_get_maxpart(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  Xapian::weight result;
  
  SWIG_check_num_args("Xapian::TradWeight::get_maxpart",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TradWeight::get_maxpart",1,"Xapian::TradWeight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TradWeight,0))){
    SWIG_fail_ptr("TradWeight_get_maxpart",1,SWIGTYPE_p_Xapian__TradWeight);
  }
  
  {
    try {
      result = (Xapian::weight)((Xapian::TradWeight const *)arg1)->get_maxpart();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TradWeight_get_sumextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::weight result;
  
  SWIG_check_num_args("Xapian::TradWeight::get_sumextra",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TradWeight::get_sumextra",1,"Xapian::TradWeight const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::TradWeight::get_sumextra",2,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TradWeight,0))){
    SWIG_fail_ptr("TradWeight_get_sumextra",1,SWIGTYPE_p_Xapian__TradWeight);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::termcount)lua_tonumber(L, 2);
  {
    try {
      result = (Xapian::weight)((Xapian::TradWeight const *)arg1)->get_sumextra(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TradWeight_get_maxextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  Xapian::weight result;
  
  SWIG_check_num_args("Xapian::TradWeight::get_maxextra",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TradWeight::get_maxextra",1,"Xapian::TradWeight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TradWeight,0))){
    SWIG_fail_ptr("TradWeight_get_maxextra",1,SWIGTYPE_p_Xapian__TradWeight);
  }
  
  {
    try {
      result = (Xapian::weight)((Xapian::TradWeight const *)arg1)->get_maxextra();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_TradWeight(void *obj) {
Xapian::TradWeight *arg1 = (Xapian::TradWeight *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_TradWeight_methods[] = {
    {"name", _wrap_TradWeight_name}, 
    {"get_sumpart", _wrap_TradWeight_get_sumpart}, 
    {"get_maxpart", _wrap_TradWeight_get_maxpart}, 
    {"get_sumextra", _wrap_TradWeight_get_sumextra}, 
    {"get_maxextra", _wrap_TradWeight_get_maxextra}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_TradWeight_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_TradWeight_bases[] = {0,0};
static const char *swig_Xapian_TradWeight_base_names[] = {"Xapian::Weight *",0};
static swig_lua_class _wrap_class_Xapian_TradWeight = { "TradWeight", &SWIGTYPE_p_Xapian__TradWeight,_wrap_new_TradWeight, swig_delete_TradWeight, swig_Xapian_TradWeight_methods, swig_Xapian_TradWeight_attributes, swig_Xapian_TradWeight_bases, swig_Xapian_TradWeight_base_names };

static int _wrap_MatchSpy___call(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MatchSpy *arg1 = (Xapian::MatchSpy *) 0 ;
  Xapian::Document *arg2 = 0 ;
  Xapian::weight arg3 ;
  
  SWIG_check_num_args("Xapian::MatchSpy::operator ()",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MatchSpy::operator ()",1,"Xapian::MatchSpy *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::MatchSpy::operator ()",2,"Xapian::Document const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::MatchSpy::operator ()",3,"Xapian::weight");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MatchSpy,0))){
    SWIG_fail_ptr("MatchSpy___call",1,SWIGTYPE_p_Xapian__MatchSpy);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("MatchSpy___call",2,SWIGTYPE_p_Xapian__Document);
  }
  
  arg3 = (Xapian::weight)lua_tonumber(L, 3);
  {
    try {
      (arg1)->operator ()((Xapian::Document const &)*arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MatchSpy_name(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MatchSpy *arg1 = (Xapian::MatchSpy *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::MatchSpy::name",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MatchSpy::name",1,"Xapian::MatchSpy const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MatchSpy,0))){
    SWIG_fail_ptr("MatchSpy_name",1,SWIGTYPE_p_Xapian__MatchSpy);
  }
  
  {
    try {
      result = ((Xapian::MatchSpy const *)arg1)->name();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MatchSpy_merge_results(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MatchSpy *arg1 = (Xapian::MatchSpy *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::MatchSpy::merge_results",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MatchSpy::merge_results",1,"Xapian::MatchSpy *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::MatchSpy::merge_results",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MatchSpy,0))){
    SWIG_fail_ptr("MatchSpy_merge_results",1,SWIGTYPE_p_Xapian__MatchSpy);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      (arg1)->merge_results((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MatchSpy___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MatchSpy *arg1 = (Xapian::MatchSpy *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::MatchSpy::get_description",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MatchSpy::get_description",1,"Xapian::MatchSpy const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MatchSpy,0))){
    SWIG_fail_ptr("MatchSpy___tostring",1,SWIGTYPE_p_Xapian__MatchSpy);
  }
  
  {
    try {
      result = ((Xapian::MatchSpy const *)arg1)->get_description();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_MatchSpy(void *obj) {
Xapian::MatchSpy *arg1 = (Xapian::MatchSpy *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_MatchSpy_methods[] = {
    {"__call", _wrap_MatchSpy___call}, 
    {"name", _wrap_MatchSpy_name}, 
    {"merge_results", _wrap_MatchSpy_merge_results}, 
    {"__tostring", _wrap_MatchSpy___tostring}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_MatchSpy_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_MatchSpy_bases[] = {0};
static const char *swig_Xapian_MatchSpy_base_names[] = {0};
static swig_lua_class _wrap_class_Xapian_MatchSpy = { "MatchSpy", &SWIGTYPE_p_Xapian__MatchSpy,0, swig_delete_MatchSpy, swig_Xapian_MatchSpy_methods, swig_Xapian_MatchSpy_attributes, swig_Xapian_MatchSpy_bases, swig_Xapian_MatchSpy_base_names };

static int _wrap_new_ValueCountMatchSpy__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueCountMatchSpy *result = 0 ;
  
  SWIG_check_num_args("Xapian::ValueCountMatchSpy::ValueCountMatchSpy",0,0)
  {
    try {
      result = (Xapian::ValueCountMatchSpy *)new Xapian::ValueCountMatchSpy();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__ValueCountMatchSpy,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_ValueCountMatchSpy__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  Xapian::ValueCountMatchSpy *result = 0 ;
  
  SWIG_check_num_args("Xapian::ValueCountMatchSpy::ValueCountMatchSpy",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::ValueCountMatchSpy::ValueCountMatchSpy",1,"Xapian::valueno");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  {
    try {
      result = (Xapian::ValueCountMatchSpy *)new Xapian::ValueCountMatchSpy(arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__ValueCountMatchSpy,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_ValueCountMatchSpy(lua_State* L) {
  int argc;
  int argv[2]={
    1,2
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_ValueCountMatchSpy__SWIG_0(L);
  }
  if (argc == 1) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_ValueCountMatchSpy__SWIG_1(L);
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_ValueCountMatchSpy'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::ValueCountMatchSpy::ValueCountMatchSpy()\n"
    "    Xapian::ValueCountMatchSpy::ValueCountMatchSpy(Xapian::valueno)\n");
  lua_error(L);return 0;
}


static int _wrap_ValueCountMatchSpy_get_total(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueCountMatchSpy *arg1 = (Xapian::ValueCountMatchSpy *) 0 ;
  size_t result;
  
  SWIG_check_num_args("Xapian::ValueCountMatchSpy::get_total",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueCountMatchSpy::get_total",1,"Xapian::ValueCountMatchSpy const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueCountMatchSpy,0))){
    SWIG_fail_ptr("ValueCountMatchSpy_get_total",1,SWIGTYPE_p_Xapian__ValueCountMatchSpy);
  }
  
  {
    try {
      result = ((Xapian::ValueCountMatchSpy const *)arg1)->get_total();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValueCountMatchSpy_values_begin(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueCountMatchSpy *arg1 = (Xapian::ValueCountMatchSpy *) 0 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::ValueCountMatchSpy::values_begin",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueCountMatchSpy::values_begin",1,"Xapian::ValueCountMatchSpy const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueCountMatchSpy,0))){
    SWIG_fail_ptr("ValueCountMatchSpy_values_begin",1,SWIGTYPE_p_Xapian__ValueCountMatchSpy);
  }
  
  {
    try {
      result = ((Xapian::ValueCountMatchSpy const *)arg1)->values_begin();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValueCountMatchSpy_values_end(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueCountMatchSpy *arg1 = (Xapian::ValueCountMatchSpy *) 0 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::ValueCountMatchSpy::values_end",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueCountMatchSpy::values_end",1,"Xapian::ValueCountMatchSpy const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueCountMatchSpy,0))){
    SWIG_fail_ptr("ValueCountMatchSpy_values_end",1,SWIGTYPE_p_Xapian__ValueCountMatchSpy);
  }
  
  {
    try {
      result = ((Xapian::ValueCountMatchSpy const *)arg1)->values_end();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValueCountMatchSpy_top_values_begin(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueCountMatchSpy *arg1 = (Xapian::ValueCountMatchSpy *) 0 ;
  size_t arg2 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::ValueCountMatchSpy::top_values_begin",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueCountMatchSpy::top_values_begin",1,"Xapian::ValueCountMatchSpy const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::ValueCountMatchSpy::top_values_begin",2,"size_t");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueCountMatchSpy,0))){
    SWIG_fail_ptr("ValueCountMatchSpy_top_values_begin",1,SWIGTYPE_p_Xapian__ValueCountMatchSpy);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (size_t)lua_tonumber(L, 2);
  {
    try {
      result = ((Xapian::ValueCountMatchSpy const *)arg1)->top_values_begin(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValueCountMatchSpy_top_values_end(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueCountMatchSpy *arg1 = (Xapian::ValueCountMatchSpy *) 0 ;
  size_t arg2 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::ValueCountMatchSpy::top_values_end",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueCountMatchSpy::top_values_end",1,"Xapian::ValueCountMatchSpy const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::ValueCountMatchSpy::top_values_end",2,"size_t");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueCountMatchSpy,0))){
    SWIG_fail_ptr("ValueCountMatchSpy_top_values_end",1,SWIGTYPE_p_Xapian__ValueCountMatchSpy);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (size_t)lua_tonumber(L, 2);
  {
    try {
      result = ((Xapian::ValueCountMatchSpy const *)arg1)->top_values_end(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValueCountMatchSpy___call(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueCountMatchSpy *arg1 = (Xapian::ValueCountMatchSpy *) 0 ;
  Xapian::Document *arg2 = 0 ;
  Xapian::weight arg3 ;
  
  SWIG_check_num_args("Xapian::ValueCountMatchSpy::operator ()",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueCountMatchSpy::operator ()",1,"Xapian::ValueCountMatchSpy *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::ValueCountMatchSpy::operator ()",2,"Xapian::Document const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::ValueCountMatchSpy::operator ()",3,"Xapian::weight");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueCountMatchSpy,0))){
    SWIG_fail_ptr("ValueCountMatchSpy___call",1,SWIGTYPE_p_Xapian__ValueCountMatchSpy);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("ValueCountMatchSpy___call",2,SWIGTYPE_p_Xapian__Document);
  }
  
  arg3 = (Xapian::weight)lua_tonumber(L, 3);
  {
    try {
      (arg1)->operator ()((Xapian::Document const &)*arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValueCountMatchSpy_name(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueCountMatchSpy *arg1 = (Xapian::ValueCountMatchSpy *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::ValueCountMatchSpy::name",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueCountMatchSpy::name",1,"Xapian::ValueCountMatchSpy const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueCountMatchSpy,0))){
    SWIG_fail_ptr("ValueCountMatchSpy_name",1,SWIGTYPE_p_Xapian__ValueCountMatchSpy);
  }
  
  {
    try {
      result = ((Xapian::ValueCountMatchSpy const *)arg1)->name();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValueCountMatchSpy_merge_results(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueCountMatchSpy *arg1 = (Xapian::ValueCountMatchSpy *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::ValueCountMatchSpy::merge_results",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueCountMatchSpy::merge_results",1,"Xapian::ValueCountMatchSpy *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::ValueCountMatchSpy::merge_results",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueCountMatchSpy,0))){
    SWIG_fail_ptr("ValueCountMatchSpy_merge_results",1,SWIGTYPE_p_Xapian__ValueCountMatchSpy);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      (arg1)->merge_results((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValueCountMatchSpy___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueCountMatchSpy *arg1 = (Xapian::ValueCountMatchSpy *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::ValueCountMatchSpy::get_description",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueCountMatchSpy::get_description",1,"Xapian::ValueCountMatchSpy const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueCountMatchSpy,0))){
    SWIG_fail_ptr("ValueCountMatchSpy___tostring",1,SWIGTYPE_p_Xapian__ValueCountMatchSpy);
  }
  
  {
    try {
      result = ((Xapian::ValueCountMatchSpy const *)arg1)->get_description();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValueCountMatchSpy_values(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueCountMatchSpy *arg1 = (Xapian::ValueCountMatchSpy *) 0 ;
  std::pair< Xapian::TermIterator,Xapian::TermIterator > result;
  
  SWIG_check_num_args("Xapian::ValueCountMatchSpy::values",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueCountMatchSpy::values",1,"Xapian::ValueCountMatchSpy *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueCountMatchSpy,0))){
    SWIG_fail_ptr("ValueCountMatchSpy_values",1,SWIGTYPE_p_Xapian__ValueCountMatchSpy);
  }
  
  result = Xapian_ValueCountMatchSpy_values(arg1);
  {
    lua_getglobal(L, "xapian");
    lua_pushstring(L, "Iterator");
    lua_gettable(L, -2);
    lua_remove(L, -2);
    
    if (!lua_isfunction(L, -1)) {
      luaL_typerror(L, -1, "function");
    }
    
    Xapian::TermIterator * begin = new Xapian::TermIterator((const Xapian::TermIterator &)(&result)->first);
    SWIG_NewPointerObj(L, (void *) begin, SWIGTYPE_p_Xapian__TermIterator, 1);
    
    Xapian::TermIterator * end = new Xapian::TermIterator((const Xapian::TermIterator &)(&result)->second);
    SWIG_NewPointerObj(L, (void *) end, SWIGTYPE_p_Xapian__TermIterator, 1);
    
    if (lua_pcall(L, 2, 1, 0) != 0) {
      luaL_error(L, "error running function: %s", lua_tostring(L, -1));
    }
    
    SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValueCountMatchSpy_top_values(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueCountMatchSpy *arg1 = (Xapian::ValueCountMatchSpy *) 0 ;
  size_t arg2 ;
  std::pair< Xapian::TermIterator,Xapian::TermIterator > result;
  
  SWIG_check_num_args("Xapian::ValueCountMatchSpy::top_values",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueCountMatchSpy::top_values",1,"Xapian::ValueCountMatchSpy *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::ValueCountMatchSpy::top_values",2,"size_t");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueCountMatchSpy,0))){
    SWIG_fail_ptr("ValueCountMatchSpy_top_values",1,SWIGTYPE_p_Xapian__ValueCountMatchSpy);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (size_t)lua_tonumber(L, 2);
  result = Xapian_ValueCountMatchSpy_top_values(arg1,arg2);
  {
    lua_getglobal(L, "xapian");
    lua_pushstring(L, "Iterator");
    lua_gettable(L, -2);
    lua_remove(L, -2);
    
    if (!lua_isfunction(L, -1)) {
      luaL_typerror(L, -1, "function");
    }
    
    Xapian::TermIterator * begin = new Xapian::TermIterator((const Xapian::TermIterator &)(&result)->first);
    SWIG_NewPointerObj(L, (void *) begin, SWIGTYPE_p_Xapian__TermIterator, 1);
    
    Xapian::TermIterator * end = new Xapian::TermIterator((const Xapian::TermIterator &)(&result)->second);
    SWIG_NewPointerObj(L, (void *) end, SWIGTYPE_p_Xapian__TermIterator, 1);
    
    if (lua_pcall(L, 2, 1, 0) != 0) {
      luaL_error(L, "error running function: %s", lua_tostring(L, -1));
    }
    
    SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_ValueCountMatchSpy(void *obj) {
Xapian::ValueCountMatchSpy *arg1 = (Xapian::ValueCountMatchSpy *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_ValueCountMatchSpy_methods[] = {
    {"get_total", _wrap_ValueCountMatchSpy_get_total}, 
    {"values_begin", _wrap_ValueCountMatchSpy_values_begin}, 
    {"values_end", _wrap_ValueCountMatchSpy_values_end}, 
    {"top_values_begin", _wrap_ValueCountMatchSpy_top_values_begin}, 
    {"top_values_end", _wrap_ValueCountMatchSpy_top_values_end}, 
    {"__call", _wrap_ValueCountMatchSpy___call}, 
    {"name", _wrap_ValueCountMatchSpy_name}, 
    {"merge_results", _wrap_ValueCountMatchSpy_merge_results}, 
    {"__tostring", _wrap_ValueCountMatchSpy___tostring}, 
    {"values", _wrap_ValueCountMatchSpy_values}, 
    {"top_values", _wrap_ValueCountMatchSpy_top_values}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_ValueCountMatchSpy_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_ValueCountMatchSpy_bases[] = {0,0};
static const char *swig_Xapian_ValueCountMatchSpy_base_names[] = {"Xapian::MatchSpy *",0};
static swig_lua_class _wrap_class_Xapian_ValueCountMatchSpy = { "ValueCountMatchSpy", &SWIGTYPE_p_Xapian__ValueCountMatchSpy,_wrap_new_ValueCountMatchSpy, swig_delete_ValueCountMatchSpy, swig_Xapian_ValueCountMatchSpy_methods, swig_Xapian_ValueCountMatchSpy_attributes, swig_Xapian_ValueCountMatchSpy_bases, swig_Xapian_ValueCountMatchSpy_base_names };

static int _wrap_Database_add_database(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::Database *arg2 = 0 ;
  
  SWIG_check_num_args("Xapian::Database::add_database",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::add_database",1,"Xapian::Database *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::Database::add_database",2,"Xapian::Database const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_add_database",1,SWIGTYPE_p_Xapian__Database);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_add_database",2,SWIGTYPE_p_Xapian__Database);
  }
  
  {
    try {
      (arg1)->add_database((Xapian::Database const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_Database__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *result = 0 ;
  
  SWIG_check_num_args("Xapian::Database::Database",0,0)
  {
    try {
      result = (Xapian::Database *)new Xapian::Database();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__Database,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_Database__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string temp1 ;
  Xapian::Database *result = 0 ;
  
  SWIG_check_num_args("Xapian::Database::Database",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::Database::Database",1,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  {
    try {
      result = (Xapian::Database *)new Xapian::Database((std::string const &)*arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__Database,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_Database__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = 0 ;
  Xapian::Database *result = 0 ;
  
  SWIG_check_num_args("Xapian::Database::Database",1,1)
  if(!lua_isuserdata(L,1)) SWIG_fail_arg("Xapian::Database::Database",1,"Xapian::Database const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("new_Database",1,SWIGTYPE_p_Xapian__Database);
  }
  
  {
    try {
      result = (Xapian::Database *)new Xapian::Database((Xapian::Database const &)*arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__Database,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_Database(lua_State* L) {
  int argc;
  int argv[2]={
    1,2
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_Database__SWIG_0(L);
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Database, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_new_Database__SWIG_2(L);
    }
  }
  if (argc == 1) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_Database__SWIG_1(L);
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_Database'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Database::Database()\n"
    "    Xapian::Database::Database(std::string const &)\n"
    "    Xapian::Database::Database(Xapian::Database const &)\n");
  lua_error(L);return 0;
}


static int _wrap_Database_reopen(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  
  SWIG_check_num_args("Xapian::Database::reopen",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::reopen",1,"Xapian::Database *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_reopen",1,SWIGTYPE_p_Xapian__Database);
  }
  
  {
    try {
      (arg1)->reopen();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_close(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  
  SWIG_check_num_args("Xapian::Database::close",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::close",1,"Xapian::Database *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_close",1,SWIGTYPE_p_Xapian__Database);
  }
  
  {
    try {
      (arg1)->close();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::Database::get_description",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::get_description",1,"Xapian::Database const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database___tostring",1,SWIGTYPE_p_Xapian__Database);
  }
  
  {
    try {
      result = ((Xapian::Database const *)arg1)->get_description();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_postlist_begin(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  Xapian::PostingIterator result;
  
  SWIG_check_num_args("Xapian::Database::postlist_begin",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::postlist_begin",1,"Xapian::Database const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Database::postlist_begin",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_postlist_begin",1,SWIGTYPE_p_Xapian__Database);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = ((Xapian::Database const *)arg1)->postlist_begin((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::PostingIterator * resultptr = new Xapian::PostingIterator((const Xapian::PostingIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__PostingIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_postlist_end(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  Xapian::PostingIterator result;
  
  SWIG_check_num_args("Xapian::Database::postlist_end",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::postlist_end",1,"Xapian::Database const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Database::postlist_end",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_postlist_end",1,SWIGTYPE_p_Xapian__Database);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = ((Xapian::Database const *)arg1)->postlist_end((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::PostingIterator * resultptr = new Xapian::PostingIterator((const Xapian::PostingIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__PostingIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_termlist_begin(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::Database::termlist_begin",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::termlist_begin",1,"Xapian::Database const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Database::termlist_begin",2,"Xapian::docid");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_termlist_begin",1,SWIGTYPE_p_Xapian__Database);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::docid)lua_tonumber(L, 2);
  {
    try {
      result = ((Xapian::Database const *)arg1)->termlist_begin(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_termlist_end(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::Database::termlist_end",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::termlist_end",1,"Xapian::Database const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Database::termlist_end",2,"Xapian::docid");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_termlist_end",1,SWIGTYPE_p_Xapian__Database);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::docid)lua_tonumber(L, 2);
  {
    try {
      result = ((Xapian::Database const *)arg1)->termlist_end(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_positionlist_begin(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  std::string *arg3 = 0 ;
  std::string temp3 ;
  Xapian::PositionIterator result;
  
  SWIG_check_num_args("Xapian::Database::positionlist_begin",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::positionlist_begin",1,"Xapian::Database const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Database::positionlist_begin",2,"Xapian::docid");
  if(!lua_isstring(L,3)) SWIG_fail_arg("Xapian::Database::positionlist_begin",3,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_positionlist_begin",1,SWIGTYPE_p_Xapian__Database);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::docid)lua_tonumber(L, 2);
  temp3.assign(lua_tostring(L,3),lua_rawlen(L,3)); arg3=&temp3;
  {
    try {
      result = ((Xapian::Database const *)arg1)->positionlist_begin(arg2,(std::string const &)*arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::PositionIterator * resultptr = new Xapian::PositionIterator((const Xapian::PositionIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__PositionIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_positionlist_end(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  std::string *arg3 = 0 ;
  std::string temp3 ;
  Xapian::PositionIterator result;
  
  SWIG_check_num_args("Xapian::Database::positionlist_end",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::positionlist_end",1,"Xapian::Database const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Database::positionlist_end",2,"Xapian::docid");
  if(!lua_isstring(L,3)) SWIG_fail_arg("Xapian::Database::positionlist_end",3,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_positionlist_end",1,SWIGTYPE_p_Xapian__Database);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::docid)lua_tonumber(L, 2);
  temp3.assign(lua_tostring(L,3),lua_rawlen(L,3)); arg3=&temp3;
  {
    try {
      result = ((Xapian::Database const *)arg1)->positionlist_end(arg2,(std::string const &)*arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::PositionIterator * resultptr = new Xapian::PositionIterator((const Xapian::PositionIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__PositionIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_allterms_begin__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::Database::allterms_begin",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::allterms_begin",1,"Xapian::Database const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_allterms_begin",1,SWIGTYPE_p_Xapian__Database);
  }
  
  {
    try {
      result = ((Xapian::Database const *)arg1)->allterms_begin();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_allterms_end__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::Database::allterms_end",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::allterms_end",1,"Xapian::Database const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_allterms_end",1,SWIGTYPE_p_Xapian__Database);
  }
  
  {
    try {
      result = ((Xapian::Database const *)arg1)->allterms_end();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_allterms_begin__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::Database::allterms_begin",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::allterms_begin",1,"Xapian::Database const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Database::allterms_begin",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_allterms_begin",1,SWIGTYPE_p_Xapian__Database);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = ((Xapian::Database const *)arg1)->allterms_begin((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_allterms_begin(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Database, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_Database_allterms_begin__SWIG_0(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Database, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_Database_allterms_begin__SWIG_1(L);
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'Database_allterms_begin'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Database::allterms_begin() const\n"
    "    Xapian::Database::allterms_begin(std::string const &) const\n");
  lua_error(L);return 0;
}


static int _wrap_Database_allterms_end__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::Database::allterms_end",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::allterms_end",1,"Xapian::Database const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Database::allterms_end",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_allterms_end",1,SWIGTYPE_p_Xapian__Database);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = ((Xapian::Database const *)arg1)->allterms_end((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_allterms_end(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Database, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_Database_allterms_end__SWIG_0(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Database, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_Database_allterms_end__SWIG_1(L);
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'Database_allterms_end'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Database::allterms_end() const\n"
    "    Xapian::Database::allterms_end(std::string const &) const\n");
  lua_error(L);return 0;
}


static int _wrap_Database_get_doccount(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::doccount result;
  
  SWIG_check_num_args("Xapian::Database::get_doccount",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::get_doccount",1,"Xapian::Database const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_get_doccount",1,SWIGTYPE_p_Xapian__Database);
  }
  
  {
    try {
      result = (Xapian::doccount)((Xapian::Database const *)arg1)->get_doccount();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_get_lastdocid(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid result;
  
  SWIG_check_num_args("Xapian::Database::get_lastdocid",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::get_lastdocid",1,"Xapian::Database const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_get_lastdocid",1,SWIGTYPE_p_Xapian__Database);
  }
  
  {
    try {
      result = (Xapian::docid)((Xapian::Database const *)arg1)->get_lastdocid();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_get_avlength(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::doclength result;
  
  SWIG_check_num_args("Xapian::Database::get_avlength",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::get_avlength",1,"Xapian::Database const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_get_avlength",1,SWIGTYPE_p_Xapian__Database);
  }
  
  {
    try {
      result = (Xapian::doclength)((Xapian::Database const *)arg1)->get_avlength();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_get_termfreq(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  Xapian::doccount result;
  
  SWIG_check_num_args("Xapian::Database::get_termfreq",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::get_termfreq",1,"Xapian::Database const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Database::get_termfreq",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_get_termfreq",1,SWIGTYPE_p_Xapian__Database);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = (Xapian::doccount)((Xapian::Database const *)arg1)->get_termfreq((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_term_exists(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  bool result;
  
  SWIG_check_num_args("Xapian::Database::term_exists",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::term_exists",1,"Xapian::Database const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Database::term_exists",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_term_exists",1,SWIGTYPE_p_Xapian__Database);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = (bool)((Xapian::Database const *)arg1)->term_exists((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_get_collection_freq(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  Xapian::termcount result;
  
  SWIG_check_num_args("Xapian::Database::get_collection_freq",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::get_collection_freq",1,"Xapian::Database const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Database::get_collection_freq",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_get_collection_freq",1,SWIGTYPE_p_Xapian__Database);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = (Xapian::termcount)((Xapian::Database const *)arg1)->get_collection_freq((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_get_value_freq(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::valueno arg2 ;
  Xapian::doccount result;
  
  SWIG_check_num_args("Xapian::Database::get_value_freq",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::get_value_freq",1,"Xapian::Database const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Database::get_value_freq",2,"Xapian::valueno");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_get_value_freq",1,SWIGTYPE_p_Xapian__Database);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::valueno)lua_tonumber(L, 2);
  {
    try {
      result = (Xapian::doccount)((Xapian::Database const *)arg1)->get_value_freq(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_get_value_lower_bound(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::valueno arg2 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::Database::get_value_lower_bound",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::get_value_lower_bound",1,"Xapian::Database const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Database::get_value_lower_bound",2,"Xapian::valueno");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_get_value_lower_bound",1,SWIGTYPE_p_Xapian__Database);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::valueno)lua_tonumber(L, 2);
  {
    try {
      result = ((Xapian::Database const *)arg1)->get_value_lower_bound(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_get_value_upper_bound(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::valueno arg2 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::Database::get_value_upper_bound",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::get_value_upper_bound",1,"Xapian::Database const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Database::get_value_upper_bound",2,"Xapian::valueno");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_get_value_upper_bound",1,SWIGTYPE_p_Xapian__Database);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::valueno)lua_tonumber(L, 2);
  {
    try {
      result = ((Xapian::Database const *)arg1)->get_value_upper_bound(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_get_doclength_lower_bound(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::termcount result;
  
  SWIG_check_num_args("Xapian::Database::get_doclength_lower_bound",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::get_doclength_lower_bound",1,"Xapian::Database const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_get_doclength_lower_bound",1,SWIGTYPE_p_Xapian__Database);
  }
  
  {
    try {
      result = (Xapian::termcount)((Xapian::Database const *)arg1)->get_doclength_lower_bound();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_get_doclength_upper_bound(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::termcount result;
  
  SWIG_check_num_args("Xapian::Database::get_doclength_upper_bound",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::get_doclength_upper_bound",1,"Xapian::Database const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_get_doclength_upper_bound",1,SWIGTYPE_p_Xapian__Database);
  }
  
  {
    try {
      result = (Xapian::termcount)((Xapian::Database const *)arg1)->get_doclength_upper_bound();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_get_wdf_upper_bound(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  Xapian::termcount result;
  
  SWIG_check_num_args("Xapian::Database::get_wdf_upper_bound",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::get_wdf_upper_bound",1,"Xapian::Database const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Database::get_wdf_upper_bound",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_get_wdf_upper_bound",1,SWIGTYPE_p_Xapian__Database);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = (Xapian::termcount)((Xapian::Database const *)arg1)->get_wdf_upper_bound((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_valuestream_begin(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::valueno arg2 ;
  Xapian::ValueIterator result;
  
  SWIG_check_num_args("Xapian::Database::valuestream_begin",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::valuestream_begin",1,"Xapian::Database const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Database::valuestream_begin",2,"Xapian::valueno");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_valuestream_begin",1,SWIGTYPE_p_Xapian__Database);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::valueno)lua_tonumber(L, 2);
  {
    try {
      result = ((Xapian::Database const *)arg1)->valuestream_begin(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::ValueIterator * resultptr = new Xapian::ValueIterator((const Xapian::ValueIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__ValueIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_valuestream_end(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::valueno arg2 ;
  Xapian::ValueIterator result;
  
  SWIG_check_num_args("Xapian::Database::valuestream_end",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::valuestream_end",1,"Xapian::Database const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Database::valuestream_end",2,"Xapian::valueno");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_valuestream_end",1,SWIGTYPE_p_Xapian__Database);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::valueno)lua_tonumber(L, 2);
  {
    try {
      result = ((Xapian::Database const *)arg1)->valuestream_end(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::ValueIterator * resultptr = new Xapian::ValueIterator((const Xapian::ValueIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__ValueIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_get_doclength(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  Xapian::termcount result;
  
  SWIG_check_num_args("Xapian::Database::get_doclength",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::get_doclength",1,"Xapian::Database const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Database::get_doclength",2,"Xapian::docid");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_get_doclength",1,SWIGTYPE_p_Xapian__Database);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::docid)lua_tonumber(L, 2);
  {
    try {
      result = (Xapian::termcount)((Xapian::Database const *)arg1)->get_doclength(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_keep_alive(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  
  SWIG_check_num_args("Xapian::Database::keep_alive",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::keep_alive",1,"Xapian::Database *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_keep_alive",1,SWIGTYPE_p_Xapian__Database);
  }
  
  {
    try {
      (arg1)->keep_alive();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_get_document(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  Xapian::Document result;
  
  SWIG_check_num_args("Xapian::Database::get_document",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::get_document",1,"Xapian::Database *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Database::get_document",2,"Xapian::docid");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_get_document",1,SWIGTYPE_p_Xapian__Database);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::docid)lua_tonumber(L, 2);
  {
    try {
      result = (arg1)->get_document(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::Document * resultptr = new Xapian::Document((const Xapian::Document &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__Document,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_get_spelling_suggestion__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  unsigned int arg3 ;
  std::string temp2 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::Database::get_spelling_suggestion",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::get_spelling_suggestion",1,"Xapian::Database const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Database::get_spelling_suggestion",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Database::get_spelling_suggestion",3,"unsigned int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_get_spelling_suggestion",1,SWIGTYPE_p_Xapian__Database);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (unsigned int)lua_tonumber(L, 3);
  {
    try {
      result = ((Xapian::Database const *)arg1)->get_spelling_suggestion((std::string const &)*arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_get_spelling_suggestion__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::Database::get_spelling_suggestion",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::get_spelling_suggestion",1,"Xapian::Database const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Database::get_spelling_suggestion",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_get_spelling_suggestion",1,SWIGTYPE_p_Xapian__Database);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = ((Xapian::Database const *)arg1)->get_spelling_suggestion((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_get_spelling_suggestion(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Database, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_Database_get_spelling_suggestion__SWIG_1(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Database, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_Database_get_spelling_suggestion__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'Database_get_spelling_suggestion'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Database::get_spelling_suggestion(std::string const &,unsigned int) const\n"
    "    Xapian::Database::get_spelling_suggestion(std::string const &) const\n");
  lua_error(L);return 0;
}


static int _wrap_Database_spellings_begin(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::Database::spellings_begin",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::spellings_begin",1,"Xapian::Database const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_spellings_begin",1,SWIGTYPE_p_Xapian__Database);
  }
  
  {
    try {
      result = ((Xapian::Database const *)arg1)->spellings_begin();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_spellings_end(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::Database::spellings_end",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::spellings_end",1,"Xapian::Database const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_spellings_end",1,SWIGTYPE_p_Xapian__Database);
  }
  
  {
    try {
      result = ((Xapian::Database const *)arg1)->spellings_end();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_synonyms_begin(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::Database::synonyms_begin",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::synonyms_begin",1,"Xapian::Database const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Database::synonyms_begin",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_synonyms_begin",1,SWIGTYPE_p_Xapian__Database);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = ((Xapian::Database const *)arg1)->synonyms_begin((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_synonyms_end(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::Database::synonyms_end",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::synonyms_end",1,"Xapian::Database const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Database::synonyms_end",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_synonyms_end",1,SWIGTYPE_p_Xapian__Database);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = ((Xapian::Database const *)arg1)->synonyms_end((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_synonym_keys_begin__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::Database::synonym_keys_begin",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::synonym_keys_begin",1,"Xapian::Database const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Database::synonym_keys_begin",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_synonym_keys_begin",1,SWIGTYPE_p_Xapian__Database);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = ((Xapian::Database const *)arg1)->synonym_keys_begin((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_synonym_keys_begin__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::Database::synonym_keys_begin",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::synonym_keys_begin",1,"Xapian::Database const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_synonym_keys_begin",1,SWIGTYPE_p_Xapian__Database);
  }
  
  {
    try {
      result = ((Xapian::Database const *)arg1)->synonym_keys_begin();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_synonym_keys_begin(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Database, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_Database_synonym_keys_begin__SWIG_1(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Database, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_Database_synonym_keys_begin__SWIG_0(L);
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'Database_synonym_keys_begin'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Database::synonym_keys_begin(std::string const &) const\n"
    "    Xapian::Database::synonym_keys_begin() const\n");
  lua_error(L);return 0;
}


static int _wrap_Database_synonym_keys_end__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::Database::synonym_keys_end",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::synonym_keys_end",1,"Xapian::Database const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Database::synonym_keys_end",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_synonym_keys_end",1,SWIGTYPE_p_Xapian__Database);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = ((Xapian::Database const *)arg1)->synonym_keys_end((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_synonym_keys_end__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::Database::synonym_keys_end",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::synonym_keys_end",1,"Xapian::Database const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_synonym_keys_end",1,SWIGTYPE_p_Xapian__Database);
  }
  
  {
    try {
      result = ((Xapian::Database const *)arg1)->synonym_keys_end();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_synonym_keys_end(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Database, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_Database_synonym_keys_end__SWIG_1(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Database, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_Database_synonym_keys_end__SWIG_0(L);
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'Database_synonym_keys_end'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Database::synonym_keys_end(std::string const &) const\n"
    "    Xapian::Database::synonym_keys_end() const\n");
  lua_error(L);return 0;
}


static int _wrap_Database_get_metadata(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::Database::get_metadata",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::get_metadata",1,"Xapian::Database const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Database::get_metadata",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_get_metadata",1,SWIGTYPE_p_Xapian__Database);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = ((Xapian::Database const *)arg1)->get_metadata((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_metadata_keys_begin__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::Database::metadata_keys_begin",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::metadata_keys_begin",1,"Xapian::Database const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Database::metadata_keys_begin",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_metadata_keys_begin",1,SWIGTYPE_p_Xapian__Database);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = ((Xapian::Database const *)arg1)->metadata_keys_begin((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_metadata_keys_begin__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::Database::metadata_keys_begin",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::metadata_keys_begin",1,"Xapian::Database const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_metadata_keys_begin",1,SWIGTYPE_p_Xapian__Database);
  }
  
  {
    try {
      result = ((Xapian::Database const *)arg1)->metadata_keys_begin();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_metadata_keys_begin(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Database, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_Database_metadata_keys_begin__SWIG_1(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Database, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_Database_metadata_keys_begin__SWIG_0(L);
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'Database_metadata_keys_begin'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Database::metadata_keys_begin(std::string const &) const\n"
    "    Xapian::Database::metadata_keys_begin() const\n");
  lua_error(L);return 0;
}


static int _wrap_Database_metadata_keys_end__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::Database::metadata_keys_end",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::metadata_keys_end",1,"Xapian::Database const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Database::metadata_keys_end",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_metadata_keys_end",1,SWIGTYPE_p_Xapian__Database);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = ((Xapian::Database const *)arg1)->metadata_keys_end((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_metadata_keys_end__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::Database::metadata_keys_end",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::metadata_keys_end",1,"Xapian::Database const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_metadata_keys_end",1,SWIGTYPE_p_Xapian__Database);
  }
  
  {
    try {
      result = ((Xapian::Database const *)arg1)->metadata_keys_end();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_metadata_keys_end(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Database, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_Database_metadata_keys_end__SWIG_1(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Database, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_Database_metadata_keys_end__SWIG_0(L);
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'Database_metadata_keys_end'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Database::metadata_keys_end(std::string const &) const\n"
    "    Xapian::Database::metadata_keys_end() const\n");
  lua_error(L);return 0;
}


static int _wrap_Database_get_uuid(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::Database::get_uuid",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::get_uuid",1,"Xapian::Database const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_get_uuid",1,SWIGTYPE_p_Xapian__Database);
  }
  
  {
    try {
      result = ((Xapian::Database const *)arg1)->get_uuid();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_has_positions(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  bool result;
  
  SWIG_check_num_args("Xapian::Database::has_positions",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::has_positions",1,"Xapian::Database const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_has_positions",1,SWIGTYPE_p_Xapian__Database);
  }
  
  {
    try {
      result = (bool)((Xapian::Database const *)arg1)->has_positions();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_allterms__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::pair< Xapian::TermIterator,Xapian::TermIterator > result;
  
  SWIG_check_num_args("Xapian::Database::allterms",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::allterms",1,"Xapian::Database *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_allterms",1,SWIGTYPE_p_Xapian__Database);
  }
  
  result = Xapian_Database_allterms__SWIG_0(arg1);
  {
    lua_getglobal(L, "xapian");
    lua_pushstring(L, "Iterator");
    lua_gettable(L, -2);
    lua_remove(L, -2);
    
    if (!lua_isfunction(L, -1)) {
      luaL_typerror(L, -1, "function");
    }
    
    Xapian::TermIterator * begin = new Xapian::TermIterator((const Xapian::TermIterator &)(&result)->first);
    SWIG_NewPointerObj(L, (void *) begin, SWIGTYPE_p_Xapian__TermIterator, 1);
    
    Xapian::TermIterator * end = new Xapian::TermIterator((const Xapian::TermIterator &)(&result)->second);
    SWIG_NewPointerObj(L, (void *) end, SWIGTYPE_p_Xapian__TermIterator, 1);
    
    if (lua_pcall(L, 2, 1, 0) != 0) {
      luaL_error(L, "error running function: %s", lua_tostring(L, -1));
    }
    
    SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_spellings(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::pair< Xapian::TermIterator,Xapian::TermIterator > result;
  
  SWIG_check_num_args("Xapian::Database::spellings",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::spellings",1,"Xapian::Database *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_spellings",1,SWIGTYPE_p_Xapian__Database);
  }
  
  result = Xapian_Database_spellings(arg1);
  {
    lua_getglobal(L, "xapian");
    lua_pushstring(L, "Iterator");
    lua_gettable(L, -2);
    lua_remove(L, -2);
    
    if (!lua_isfunction(L, -1)) {
      luaL_typerror(L, -1, "function");
    }
    
    Xapian::TermIterator * begin = new Xapian::TermIterator((const Xapian::TermIterator &)(&result)->first);
    SWIG_NewPointerObj(L, (void *) begin, SWIGTYPE_p_Xapian__TermIterator, 1);
    
    Xapian::TermIterator * end = new Xapian::TermIterator((const Xapian::TermIterator &)(&result)->second);
    SWIG_NewPointerObj(L, (void *) end, SWIGTYPE_p_Xapian__TermIterator, 1);
    
    if (lua_pcall(L, 2, 1, 0) != 0) {
      luaL_error(L, "error running function: %s", lua_tostring(L, -1));
    }
    
    SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_postlist(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  SwigValueWrapper< std::pair< Xapian::PostingIterator,Xapian::PostingIterator > > result;
  
  SWIG_check_num_args("Xapian::Database::postlist",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::postlist",1,"Xapian::Database *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Database::postlist",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_postlist",1,SWIGTYPE_p_Xapian__Database);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  result = Xapian_Database_postlist(arg1,(std::string const &)*arg2);
  {
    lua_getglobal(L, "xapian");
    lua_pushstring(L, "Iterator");
    lua_gettable(L, -2);
    lua_remove(L, -2);
    
    if (!lua_isfunction(L, -1)) {
      luaL_typerror(L, -1, "function");
    }
    
    Xapian::PostingIterator * begin = new Xapian::PostingIterator((const Xapian::PostingIterator &)(&result)->first);
    SWIG_NewPointerObj(L, (void *) begin, SWIGTYPE_p_Xapian__PostingIterator, 1);
    
    Xapian::PostingIterator * end = new Xapian::PostingIterator((const Xapian::PostingIterator &)(&result)->second);
    SWIG_NewPointerObj(L, (void *) end, SWIGTYPE_p_Xapian__PostingIterator, 1);
    
    if (lua_pcall(L, 2, 1, 0) != 0) {
      luaL_error(L, "error running function: %s", lua_tostring(L, -1));
    }
    
    SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_termlist(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  std::pair< Xapian::TermIterator,Xapian::TermIterator > result;
  
  SWIG_check_num_args("Xapian::Database::termlist",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::termlist",1,"Xapian::Database *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Database::termlist",2,"Xapian::docid");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_termlist",1,SWIGTYPE_p_Xapian__Database);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::docid)lua_tonumber(L, 2);
  result = Xapian_Database_termlist(arg1,arg2);
  {
    lua_getglobal(L, "xapian");
    lua_pushstring(L, "Iterator");
    lua_gettable(L, -2);
    lua_remove(L, -2);
    
    if (!lua_isfunction(L, -1)) {
      luaL_typerror(L, -1, "function");
    }
    
    Xapian::TermIterator * begin = new Xapian::TermIterator((const Xapian::TermIterator &)(&result)->first);
    SWIG_NewPointerObj(L, (void *) begin, SWIGTYPE_p_Xapian__TermIterator, 1);
    
    Xapian::TermIterator * end = new Xapian::TermIterator((const Xapian::TermIterator &)(&result)->second);
    SWIG_NewPointerObj(L, (void *) end, SWIGTYPE_p_Xapian__TermIterator, 1);
    
    if (lua_pcall(L, 2, 1, 0) != 0) {
      luaL_error(L, "error running function: %s", lua_tostring(L, -1));
    }
    
    SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_valuestream(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::valueno arg2 ;
  SwigValueWrapper< std::pair< Xapian::ValueIterator,Xapian::ValueIterator > > result;
  
  SWIG_check_num_args("Xapian::Database::valuestream",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::valuestream",1,"Xapian::Database *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Database::valuestream",2,"Xapian::valueno");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_valuestream",1,SWIGTYPE_p_Xapian__Database);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::valueno)lua_tonumber(L, 2);
  result = Xapian_Database_valuestream(arg1,arg2);
  {
    lua_getglobal(L, "xapian");
    lua_pushstring(L, "Iterator");
    lua_gettable(L, -2);
    lua_remove(L, -2);
    
    if (!lua_isfunction(L, -1)) {
      luaL_typerror(L, -1, "function");
    }
    
    Xapian::ValueIterator * begin = new Xapian::ValueIterator((const Xapian::ValueIterator &)(&result)->first);
    SWIG_NewPointerObj(L, (void *) begin, SWIGTYPE_p_Xapian__ValueIterator, 1);
    
    Xapian::ValueIterator * end = new Xapian::ValueIterator((const Xapian::ValueIterator &)(&result)->second);
    SWIG_NewPointerObj(L, (void *) end, SWIGTYPE_p_Xapian__ValueIterator, 1);
    
    if (lua_pcall(L, 2, 1, 0) != 0) {
      luaL_error(L, "error running function: %s", lua_tostring(L, -1));
    }
    
    SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_allterms__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  std::pair< Xapian::TermIterator,Xapian::TermIterator > result;
  
  SWIG_check_num_args("Xapian::Database::allterms",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::allterms",1,"Xapian::Database *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Database::allterms",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_allterms",1,SWIGTYPE_p_Xapian__Database);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  result = Xapian_Database_allterms__SWIG_1(arg1,(std::string const &)*arg2);
  {
    lua_getglobal(L, "xapian");
    lua_pushstring(L, "Iterator");
    lua_gettable(L, -2);
    lua_remove(L, -2);
    
    if (!lua_isfunction(L, -1)) {
      luaL_typerror(L, -1, "function");
    }
    
    Xapian::TermIterator * begin = new Xapian::TermIterator((const Xapian::TermIterator &)(&result)->first);
    SWIG_NewPointerObj(L, (void *) begin, SWIGTYPE_p_Xapian__TermIterator, 1);
    
    Xapian::TermIterator * end = new Xapian::TermIterator((const Xapian::TermIterator &)(&result)->second);
    SWIG_NewPointerObj(L, (void *) end, SWIGTYPE_p_Xapian__TermIterator, 1);
    
    if (lua_pcall(L, 2, 1, 0) != 0) {
      luaL_error(L, "error running function: %s", lua_tostring(L, -1));
    }
    
    SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_allterms(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Database, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_Database_allterms__SWIG_0(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Database, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_Database_allterms__SWIG_1(L);
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'Database_allterms'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Database::allterms(void)\n"
    "    Xapian::Database::allterms(std::string const &)\n");
  lua_error(L);return 0;
}


static int _wrap_Database_synonyms(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  std::pair< Xapian::TermIterator,Xapian::TermIterator > result;
  
  SWIG_check_num_args("Xapian::Database::synonyms",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::synonyms",1,"Xapian::Database *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Database::synonyms",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_synonyms",1,SWIGTYPE_p_Xapian__Database);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  result = Xapian_Database_synonyms(arg1,(std::string const &)*arg2);
  {
    lua_getglobal(L, "xapian");
    lua_pushstring(L, "Iterator");
    lua_gettable(L, -2);
    lua_remove(L, -2);
    
    if (!lua_isfunction(L, -1)) {
      luaL_typerror(L, -1, "function");
    }
    
    Xapian::TermIterator * begin = new Xapian::TermIterator((const Xapian::TermIterator &)(&result)->first);
    SWIG_NewPointerObj(L, (void *) begin, SWIGTYPE_p_Xapian__TermIterator, 1);
    
    Xapian::TermIterator * end = new Xapian::TermIterator((const Xapian::TermIterator &)(&result)->second);
    SWIG_NewPointerObj(L, (void *) end, SWIGTYPE_p_Xapian__TermIterator, 1);
    
    if (lua_pcall(L, 2, 1, 0) != 0) {
      luaL_error(L, "error running function: %s", lua_tostring(L, -1));
    }
    
    SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_synonym_keys(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  std::pair< Xapian::TermIterator,Xapian::TermIterator > result;
  
  SWIG_check_num_args("Xapian::Database::synonym_keys",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::synonym_keys",1,"Xapian::Database *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Database::synonym_keys",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_synonym_keys",1,SWIGTYPE_p_Xapian__Database);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  result = Xapian_Database_synonym_keys(arg1,(std::string const &)*arg2);
  {
    lua_getglobal(L, "xapian");
    lua_pushstring(L, "Iterator");
    lua_gettable(L, -2);
    lua_remove(L, -2);
    
    if (!lua_isfunction(L, -1)) {
      luaL_typerror(L, -1, "function");
    }
    
    Xapian::TermIterator * begin = new Xapian::TermIterator((const Xapian::TermIterator &)(&result)->first);
    SWIG_NewPointerObj(L, (void *) begin, SWIGTYPE_p_Xapian__TermIterator, 1);
    
    Xapian::TermIterator * end = new Xapian::TermIterator((const Xapian::TermIterator &)(&result)->second);
    SWIG_NewPointerObj(L, (void *) end, SWIGTYPE_p_Xapian__TermIterator, 1);
    
    if (lua_pcall(L, 2, 1, 0) != 0) {
      luaL_error(L, "error running function: %s", lua_tostring(L, -1));
    }
    
    SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_metadata_keys(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  std::pair< Xapian::TermIterator,Xapian::TermIterator > result;
  
  SWIG_check_num_args("Xapian::Database::metadata_keys",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::metadata_keys",1,"Xapian::Database *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Database::metadata_keys",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_metadata_keys",1,SWIGTYPE_p_Xapian__Database);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  result = Xapian_Database_metadata_keys(arg1,(std::string const &)*arg2);
  {
    lua_getglobal(L, "xapian");
    lua_pushstring(L, "Iterator");
    lua_gettable(L, -2);
    lua_remove(L, -2);
    
    if (!lua_isfunction(L, -1)) {
      luaL_typerror(L, -1, "function");
    }
    
    Xapian::TermIterator * begin = new Xapian::TermIterator((const Xapian::TermIterator &)(&result)->first);
    SWIG_NewPointerObj(L, (void *) begin, SWIGTYPE_p_Xapian__TermIterator, 1);
    
    Xapian::TermIterator * end = new Xapian::TermIterator((const Xapian::TermIterator &)(&result)->second);
    SWIG_NewPointerObj(L, (void *) end, SWIGTYPE_p_Xapian__TermIterator, 1);
    
    if (lua_pcall(L, 2, 1, 0) != 0) {
      luaL_error(L, "error running function: %s", lua_tostring(L, -1));
    }
    
    SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Database_positionlist(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  std::string *arg3 = 0 ;
  std::string temp3 ;
  SwigValueWrapper< std::pair< Xapian::PositionIterator,Xapian::PositionIterator > > result;
  
  SWIG_check_num_args("Xapian::Database::positionlist",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::positionlist",1,"Xapian::Database *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Database::positionlist",2,"Xapian::docid");
  if(!lua_isstring(L,3)) SWIG_fail_arg("Xapian::Database::positionlist",3,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_positionlist",1,SWIGTYPE_p_Xapian__Database);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::docid)lua_tonumber(L, 2);
  temp3.assign(lua_tostring(L,3),lua_rawlen(L,3)); arg3=&temp3;
  result = Xapian_Database_positionlist(arg1,arg2,(std::string const &)*arg3);
  {
    lua_getglobal(L, "xapian");
    lua_pushstring(L, "Iterator");
    lua_gettable(L, -2);
    lua_remove(L, -2);
    
    if (!lua_isfunction(L, -1)) {
      luaL_typerror(L, -1, "function");
    }
    
    Xapian::PositionIterator * begin = new Xapian::PositionIterator((const Xapian::PositionIterator &)(&result)->first);
    SWIG_NewPointerObj(L, (void *) begin, SWIGTYPE_p_Xapian__PositionIterator, 1);
    
    Xapian::PositionIterator * end = new Xapian::PositionIterator((const Xapian::PositionIterator &)(&result)->second);
    SWIG_NewPointerObj(L, (void *) end, SWIGTYPE_p_Xapian__PositionIterator, 1);
    
    if (lua_pcall(L, 2, 1, 0) != 0) {
      luaL_error(L, "error running function: %s", lua_tostring(L, -1));
    }
    
    SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_Database(void *obj) {
Xapian::Database *arg1 = (Xapian::Database *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_Database_methods[] = {
    {"add_database", _wrap_Database_add_database}, 
    {"reopen", _wrap_Database_reopen}, 
    {"close", _wrap_Database_close}, 
    {"__tostring", _wrap_Database___tostring}, 
    {"postlist_begin", _wrap_Database_postlist_begin}, 
    {"postlist_end", _wrap_Database_postlist_end}, 
    {"termlist_begin", _wrap_Database_termlist_begin}, 
    {"termlist_end", _wrap_Database_termlist_end}, 
    {"positionlist_begin", _wrap_Database_positionlist_begin}, 
    {"positionlist_end", _wrap_Database_positionlist_end}, 
    {"allterms_begin", _wrap_Database_allterms_begin}, 
    {"allterms_end", _wrap_Database_allterms_end}, 
    {"get_doccount", _wrap_Database_get_doccount}, 
    {"get_lastdocid", _wrap_Database_get_lastdocid}, 
    {"get_avlength", _wrap_Database_get_avlength}, 
    {"get_termfreq", _wrap_Database_get_termfreq}, 
    {"term_exists", _wrap_Database_term_exists}, 
    {"get_collection_freq", _wrap_Database_get_collection_freq}, 
    {"get_value_freq", _wrap_Database_get_value_freq}, 
    {"get_value_lower_bound", _wrap_Database_get_value_lower_bound}, 
    {"get_value_upper_bound", _wrap_Database_get_value_upper_bound}, 
    {"get_doclength_lower_bound", _wrap_Database_get_doclength_lower_bound}, 
    {"get_doclength_upper_bound", _wrap_Database_get_doclength_upper_bound}, 
    {"get_wdf_upper_bound", _wrap_Database_get_wdf_upper_bound}, 
    {"valuestream_begin", _wrap_Database_valuestream_begin}, 
    {"valuestream_end", _wrap_Database_valuestream_end}, 
    {"get_doclength", _wrap_Database_get_doclength}, 
    {"keep_alive", _wrap_Database_keep_alive}, 
    {"get_document", _wrap_Database_get_document}, 
    {"get_spelling_suggestion", _wrap_Database_get_spelling_suggestion}, 
    {"spellings_begin", _wrap_Database_spellings_begin}, 
    {"spellings_end", _wrap_Database_spellings_end}, 
    {"synonyms_begin", _wrap_Database_synonyms_begin}, 
    {"synonyms_end", _wrap_Database_synonyms_end}, 
    {"synonym_keys_begin", _wrap_Database_synonym_keys_begin}, 
    {"synonym_keys_end", _wrap_Database_synonym_keys_end}, 
    {"get_metadata", _wrap_Database_get_metadata}, 
    {"metadata_keys_begin", _wrap_Database_metadata_keys_begin}, 
    {"metadata_keys_end", _wrap_Database_metadata_keys_end}, 
    {"get_uuid", _wrap_Database_get_uuid}, 
    {"has_positions", _wrap_Database_has_positions}, 
    {"spellings", _wrap_Database_spellings}, 
    {"postlist", _wrap_Database_postlist}, 
    {"termlist", _wrap_Database_termlist}, 
    {"valuestream", _wrap_Database_valuestream}, 
    {"allterms", _wrap_Database_allterms}, 
    {"synonyms", _wrap_Database_synonyms}, 
    {"synonym_keys", _wrap_Database_synonym_keys}, 
    {"metadata_keys", _wrap_Database_metadata_keys}, 
    {"positionlist", _wrap_Database_positionlist}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_Database_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_Database_bases[] = {0};
static const char *swig_Xapian_Database_base_names[] = {0};
static swig_lua_class _wrap_class_Xapian_Database = { "Database", &SWIGTYPE_p_Xapian__Database,_wrap_new_Database, swig_delete_Database, swig_Xapian_Database_methods, swig_Xapian_Database_attributes, swig_Xapian_Database_bases, swig_Xapian_Database_base_names };

static int _wrap_new_WritableDatabase__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::WritableDatabase *result = 0 ;
  
  SWIG_check_num_args("Xapian::WritableDatabase::WritableDatabase",0,0)
  {
    try {
      result = (Xapian::WritableDatabase *)new Xapian::WritableDatabase();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__WritableDatabase,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_WritableDatabase__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  int arg2 ;
  std::string temp1 ;
  Xapian::WritableDatabase *result = 0 ;
  
  SWIG_check_num_args("Xapian::WritableDatabase::WritableDatabase",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::WritableDatabase::WritableDatabase",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::WritableDatabase::WritableDatabase",2,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  arg2 = (int)lua_tonumber(L, 2);
  {
    try {
      result = (Xapian::WritableDatabase *)new Xapian::WritableDatabase((std::string const &)*arg1,arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__WritableDatabase,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_WritableDatabase__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::WritableDatabase *arg1 = 0 ;
  Xapian::WritableDatabase *result = 0 ;
  
  SWIG_check_num_args("Xapian::WritableDatabase::WritableDatabase",1,1)
  if(!lua_isuserdata(L,1)) SWIG_fail_arg("Xapian::WritableDatabase::WritableDatabase",1,"Xapian::WritableDatabase const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__WritableDatabase,0))){
    SWIG_fail_ptr("new_WritableDatabase",1,SWIGTYPE_p_Xapian__WritableDatabase);
  }
  
  {
    try {
      result = (Xapian::WritableDatabase *)new Xapian::WritableDatabase((Xapian::WritableDatabase const &)*arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__WritableDatabase,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_WritableDatabase(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_WritableDatabase__SWIG_0(L);
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__WritableDatabase, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_new_WritableDatabase__SWIG_2(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_WritableDatabase__SWIG_1(L);
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_WritableDatabase'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::WritableDatabase::WritableDatabase()\n"
    "    Xapian::WritableDatabase::WritableDatabase(std::string const &,int)\n"
    "    Xapian::WritableDatabase::WritableDatabase(Xapian::WritableDatabase const &)\n");
  lua_error(L);return 0;
}


static int _wrap_WritableDatabase_commit(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  
  SWIG_check_num_args("Xapian::WritableDatabase::commit",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::WritableDatabase::commit",1,"Xapian::WritableDatabase *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__WritableDatabase,0))){
    SWIG_fail_ptr("WritableDatabase_commit",1,SWIGTYPE_p_Xapian__WritableDatabase);
  }
  
  {
    try {
      (arg1)->commit();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_WritableDatabase_flush(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  
  SWIG_check_num_args("Xapian::WritableDatabase::flush",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::WritableDatabase::flush",1,"Xapian::WritableDatabase *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__WritableDatabase,0))){
    SWIG_fail_ptr("WritableDatabase_flush",1,SWIGTYPE_p_Xapian__WritableDatabase);
  }
  
  {
    try {
      (arg1)->flush();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_WritableDatabase_begin_transaction__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  bool arg2 ;
  
  SWIG_check_num_args("Xapian::WritableDatabase::begin_transaction",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::WritableDatabase::begin_transaction",1,"Xapian::WritableDatabase *");
  if(!lua_isboolean(L,2)) SWIG_fail_arg("Xapian::WritableDatabase::begin_transaction",2,"bool");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__WritableDatabase,0))){
    SWIG_fail_ptr("WritableDatabase_begin_transaction",1,SWIGTYPE_p_Xapian__WritableDatabase);
  }
  
  arg2 = (lua_toboolean(L, 2)!=0);
  {
    try {
      (arg1)->begin_transaction(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_WritableDatabase_begin_transaction__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  
  SWIG_check_num_args("Xapian::WritableDatabase::begin_transaction",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::WritableDatabase::begin_transaction",1,"Xapian::WritableDatabase *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__WritableDatabase,0))){
    SWIG_fail_ptr("WritableDatabase_begin_transaction",1,SWIGTYPE_p_Xapian__WritableDatabase);
  }
  
  {
    try {
      (arg1)->begin_transaction();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_WritableDatabase_begin_transaction(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__WritableDatabase, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_WritableDatabase_begin_transaction__SWIG_1(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__WritableDatabase, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isboolean(L,argv[1]);
      }
      if (_v) {
        return _wrap_WritableDatabase_begin_transaction__SWIG_0(L);
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'WritableDatabase_begin_transaction'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::WritableDatabase::begin_transaction(bool)\n"
    "    Xapian::WritableDatabase::begin_transaction()\n");
  lua_error(L);return 0;
}


static int _wrap_WritableDatabase_commit_transaction(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  
  SWIG_check_num_args("Xapian::WritableDatabase::commit_transaction",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::WritableDatabase::commit_transaction",1,"Xapian::WritableDatabase *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__WritableDatabase,0))){
    SWIG_fail_ptr("WritableDatabase_commit_transaction",1,SWIGTYPE_p_Xapian__WritableDatabase);
  }
  
  {
    try {
      (arg1)->commit_transaction();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_WritableDatabase_cancel_transaction(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  
  SWIG_check_num_args("Xapian::WritableDatabase::cancel_transaction",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::WritableDatabase::cancel_transaction",1,"Xapian::WritableDatabase *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__WritableDatabase,0))){
    SWIG_fail_ptr("WritableDatabase_cancel_transaction",1,SWIGTYPE_p_Xapian__WritableDatabase);
  }
  
  {
    try {
      (arg1)->cancel_transaction();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_WritableDatabase_add_document(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  Xapian::Document *arg2 = 0 ;
  Xapian::docid result;
  
  SWIG_check_num_args("Xapian::WritableDatabase::add_document",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::WritableDatabase::add_document",1,"Xapian::WritableDatabase *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::WritableDatabase::add_document",2,"Xapian::Document const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__WritableDatabase,0))){
    SWIG_fail_ptr("WritableDatabase_add_document",1,SWIGTYPE_p_Xapian__WritableDatabase);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("WritableDatabase_add_document",2,SWIGTYPE_p_Xapian__Document);
  }
  
  {
    try {
      result = (Xapian::docid)(arg1)->add_document((Xapian::Document const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_WritableDatabase_delete_document__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  Xapian::docid arg2 ;
  
  SWIG_check_num_args("Xapian::WritableDatabase::delete_document",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::WritableDatabase::delete_document",1,"Xapian::WritableDatabase *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::WritableDatabase::delete_document",2,"Xapian::docid");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__WritableDatabase,0))){
    SWIG_fail_ptr("WritableDatabase_delete_document",1,SWIGTYPE_p_Xapian__WritableDatabase);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::docid)lua_tonumber(L, 2);
  {
    try {
      (arg1)->delete_document(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_WritableDatabase_replace_document__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  Xapian::docid arg2 ;
  Xapian::Document *arg3 = 0 ;
  
  SWIG_check_num_args("Xapian::WritableDatabase::replace_document",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::WritableDatabase::replace_document",1,"Xapian::WritableDatabase *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::WritableDatabase::replace_document",2,"Xapian::docid");
  if(!lua_isuserdata(L,3)) SWIG_fail_arg("Xapian::WritableDatabase::replace_document",3,"Xapian::Document const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__WritableDatabase,0))){
    SWIG_fail_ptr("WritableDatabase_replace_document",1,SWIGTYPE_p_Xapian__WritableDatabase);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::docid)lua_tonumber(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("WritableDatabase_replace_document",3,SWIGTYPE_p_Xapian__Document);
  }
  
  {
    try {
      (arg1)->replace_document(arg2,(Xapian::Document const &)*arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_WritableDatabase_delete_document__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::WritableDatabase::delete_document",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::WritableDatabase::delete_document",1,"Xapian::WritableDatabase *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::WritableDatabase::delete_document",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__WritableDatabase,0))){
    SWIG_fail_ptr("WritableDatabase_delete_document",1,SWIGTYPE_p_Xapian__WritableDatabase);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      (arg1)->delete_document((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_WritableDatabase_delete_document(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__WritableDatabase, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_WritableDatabase_delete_document__SWIG_0(L);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__WritableDatabase, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_WritableDatabase_delete_document__SWIG_1(L);
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'WritableDatabase_delete_document'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::WritableDatabase::delete_document(Xapian::docid)\n"
    "    Xapian::WritableDatabase::delete_document(std::string const &)\n");
  lua_error(L);return 0;
}


static int _wrap_WritableDatabase_replace_document__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::Document *arg3 = 0 ;
  std::string temp2 ;
  Xapian::docid result;
  
  SWIG_check_num_args("Xapian::WritableDatabase::replace_document",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::WritableDatabase::replace_document",1,"Xapian::WritableDatabase *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::WritableDatabase::replace_document",2,"std::string const &");
  if(!lua_isuserdata(L,3)) SWIG_fail_arg("Xapian::WritableDatabase::replace_document",3,"Xapian::Document const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__WritableDatabase,0))){
    SWIG_fail_ptr("WritableDatabase_replace_document",1,SWIGTYPE_p_Xapian__WritableDatabase);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("WritableDatabase_replace_document",3,SWIGTYPE_p_Xapian__Document);
  }
  
  {
    try {
      result = (Xapian::docid)(arg1)->replace_document((std::string const &)*arg2,(Xapian::Document const &)*arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_WritableDatabase_replace_document(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__WritableDatabase, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          void *ptr;
          if (lua_isuserdata(L,argv[2])==0 || SWIG_ConvertPtr(L,argv[2], (void **) &ptr, SWIGTYPE_p_Xapian__Document, 0)) {
            _v = 0;
          } else {
            _v = 1;
          }
        }
        if (_v) {
          return _wrap_WritableDatabase_replace_document__SWIG_0(L);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__WritableDatabase, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          void *ptr;
          if (lua_isuserdata(L,argv[2])==0 || SWIG_ConvertPtr(L,argv[2], (void **) &ptr, SWIGTYPE_p_Xapian__Document, 0)) {
            _v = 0;
          } else {
            _v = 1;
          }
        }
        if (_v) {
          return _wrap_WritableDatabase_replace_document__SWIG_1(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'WritableDatabase_replace_document'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::WritableDatabase::replace_document(Xapian::docid,Xapian::Document const &)\n"
    "    Xapian::WritableDatabase::replace_document(std::string const &,Xapian::Document const &)\n");
  lua_error(L);return 0;
}


static int _wrap_WritableDatabase_add_spelling__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termcount arg3 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::WritableDatabase::add_spelling",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::WritableDatabase::add_spelling",1,"Xapian::WritableDatabase const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::WritableDatabase::add_spelling",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::WritableDatabase::add_spelling",3,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__WritableDatabase,0))){
    SWIG_fail_ptr("WritableDatabase_add_spelling",1,SWIGTYPE_p_Xapian__WritableDatabase);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::termcount)lua_tonumber(L, 3);
  {
    try {
      ((Xapian::WritableDatabase const *)arg1)->add_spelling((std::string const &)*arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_WritableDatabase_add_spelling__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::WritableDatabase::add_spelling",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::WritableDatabase::add_spelling",1,"Xapian::WritableDatabase const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::WritableDatabase::add_spelling",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__WritableDatabase,0))){
    SWIG_fail_ptr("WritableDatabase_add_spelling",1,SWIGTYPE_p_Xapian__WritableDatabase);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      ((Xapian::WritableDatabase const *)arg1)->add_spelling((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_WritableDatabase_add_spelling(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__WritableDatabase, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_WritableDatabase_add_spelling__SWIG_1(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__WritableDatabase, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_WritableDatabase_add_spelling__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'WritableDatabase_add_spelling'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::WritableDatabase::add_spelling(std::string const &,Xapian::termcount) const\n"
    "    Xapian::WritableDatabase::add_spelling(std::string const &) const\n");
  lua_error(L);return 0;
}


static int _wrap_WritableDatabase_remove_spelling__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termcount arg3 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::WritableDatabase::remove_spelling",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::WritableDatabase::remove_spelling",1,"Xapian::WritableDatabase const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::WritableDatabase::remove_spelling",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::WritableDatabase::remove_spelling",3,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__WritableDatabase,0))){
    SWIG_fail_ptr("WritableDatabase_remove_spelling",1,SWIGTYPE_p_Xapian__WritableDatabase);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::termcount)lua_tonumber(L, 3);
  {
    try {
      ((Xapian::WritableDatabase const *)arg1)->remove_spelling((std::string const &)*arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_WritableDatabase_remove_spelling__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::WritableDatabase::remove_spelling",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::WritableDatabase::remove_spelling",1,"Xapian::WritableDatabase const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::WritableDatabase::remove_spelling",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__WritableDatabase,0))){
    SWIG_fail_ptr("WritableDatabase_remove_spelling",1,SWIGTYPE_p_Xapian__WritableDatabase);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      ((Xapian::WritableDatabase const *)arg1)->remove_spelling((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_WritableDatabase_remove_spelling(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__WritableDatabase, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_WritableDatabase_remove_spelling__SWIG_1(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__WritableDatabase, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_WritableDatabase_remove_spelling__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'WritableDatabase_remove_spelling'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::WritableDatabase::remove_spelling(std::string const &,Xapian::termcount) const\n"
    "    Xapian::WritableDatabase::remove_spelling(std::string const &) const\n");
  lua_error(L);return 0;
}


static int _wrap_WritableDatabase_add_synonym(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  std::string temp2 ;
  std::string temp3 ;
  
  SWIG_check_num_args("Xapian::WritableDatabase::add_synonym",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::WritableDatabase::add_synonym",1,"Xapian::WritableDatabase const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::WritableDatabase::add_synonym",2,"std::string const &");
  if(!lua_isstring(L,3)) SWIG_fail_arg("Xapian::WritableDatabase::add_synonym",3,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__WritableDatabase,0))){
    SWIG_fail_ptr("WritableDatabase_add_synonym",1,SWIGTYPE_p_Xapian__WritableDatabase);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  temp3.assign(lua_tostring(L,3),lua_rawlen(L,3)); arg3=&temp3;
  {
    try {
      ((Xapian::WritableDatabase const *)arg1)->add_synonym((std::string const &)*arg2,(std::string const &)*arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_WritableDatabase_remove_synonym(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  std::string temp2 ;
  std::string temp3 ;
  
  SWIG_check_num_args("Xapian::WritableDatabase::remove_synonym",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::WritableDatabase::remove_synonym",1,"Xapian::WritableDatabase const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::WritableDatabase::remove_synonym",2,"std::string const &");
  if(!lua_isstring(L,3)) SWIG_fail_arg("Xapian::WritableDatabase::remove_synonym",3,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__WritableDatabase,0))){
    SWIG_fail_ptr("WritableDatabase_remove_synonym",1,SWIGTYPE_p_Xapian__WritableDatabase);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  temp3.assign(lua_tostring(L,3),lua_rawlen(L,3)); arg3=&temp3;
  {
    try {
      ((Xapian::WritableDatabase const *)arg1)->remove_synonym((std::string const &)*arg2,(std::string const &)*arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_WritableDatabase_clear_synonyms(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::WritableDatabase::clear_synonyms",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::WritableDatabase::clear_synonyms",1,"Xapian::WritableDatabase const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::WritableDatabase::clear_synonyms",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__WritableDatabase,0))){
    SWIG_fail_ptr("WritableDatabase_clear_synonyms",1,SWIGTYPE_p_Xapian__WritableDatabase);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      ((Xapian::WritableDatabase const *)arg1)->clear_synonyms((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_WritableDatabase_set_metadata(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  std::string temp2 ;
  std::string temp3 ;
  
  SWIG_check_num_args("Xapian::WritableDatabase::set_metadata",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::WritableDatabase::set_metadata",1,"Xapian::WritableDatabase *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::WritableDatabase::set_metadata",2,"std::string const &");
  if(!lua_isstring(L,3)) SWIG_fail_arg("Xapian::WritableDatabase::set_metadata",3,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__WritableDatabase,0))){
    SWIG_fail_ptr("WritableDatabase_set_metadata",1,SWIGTYPE_p_Xapian__WritableDatabase);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  temp3.assign(lua_tostring(L,3),lua_rawlen(L,3)); arg3=&temp3;
  {
    try {
      (arg1)->set_metadata((std::string const &)*arg2,(std::string const &)*arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_WritableDatabase___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::WritableDatabase::get_description",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::WritableDatabase::get_description",1,"Xapian::WritableDatabase const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__WritableDatabase,0))){
    SWIG_fail_ptr("WritableDatabase___tostring",1,SWIGTYPE_p_Xapian__WritableDatabase);
  }
  
  {
    try {
      result = ((Xapian::WritableDatabase const *)arg1)->get_description();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_WritableDatabase(void *obj) {
Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_WritableDatabase_methods[] = {
    {"commit", _wrap_WritableDatabase_commit}, 
    {"flush", _wrap_WritableDatabase_flush}, 
    {"begin_transaction", _wrap_WritableDatabase_begin_transaction}, 
    {"commit_transaction", _wrap_WritableDatabase_commit_transaction}, 
    {"cancel_transaction", _wrap_WritableDatabase_cancel_transaction}, 
    {"add_document", _wrap_WritableDatabase_add_document}, 
    {"delete_document", _wrap_WritableDatabase_delete_document}, 
    {"replace_document", _wrap_WritableDatabase_replace_document}, 
    {"add_spelling", _wrap_WritableDatabase_add_spelling}, 
    {"remove_spelling", _wrap_WritableDatabase_remove_spelling}, 
    {"add_synonym", _wrap_WritableDatabase_add_synonym}, 
    {"remove_synonym", _wrap_WritableDatabase_remove_synonym}, 
    {"clear_synonyms", _wrap_WritableDatabase_clear_synonyms}, 
    {"set_metadata", _wrap_WritableDatabase_set_metadata}, 
    {"__tostring", _wrap_WritableDatabase___tostring}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_WritableDatabase_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_WritableDatabase_bases[] = {0,0};
static const char *swig_Xapian_WritableDatabase_base_names[] = {"Xapian::Database *",0};
static swig_lua_class _wrap_class_Xapian_WritableDatabase = { "WritableDatabase", &SWIGTYPE_p_Xapian__WritableDatabase,_wrap_new_WritableDatabase, swig_delete_WritableDatabase, swig_Xapian_WritableDatabase_methods, swig_Xapian_WritableDatabase_attributes, swig_Xapian_WritableDatabase_bases, swig_Xapian_WritableDatabase_base_names };

static int _wrap_open_stub(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string temp1 ;
  Xapian::Database result;
  
  SWIG_check_num_args("Xapian::Auto::open_stub",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::Auto::open_stub",1,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  {
    try {
      result = Xapian::Auto::open_stub((std::string const &)*arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::Database * resultptr = new Xapian::Database((const Xapian::Database &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__Database,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_brass_open__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string temp1 ;
  Xapian::Database result;
  
  SWIG_check_num_args("Xapian::Brass::open",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::Brass::open",1,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  {
    try {
      result = Xapian::Brass::open((std::string const &)*arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::Database * resultptr = new Xapian::Database((const Xapian::Database &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__Database,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_brass_open__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  int arg2 ;
  int arg3 ;
  std::string temp1 ;
  Xapian::WritableDatabase result;
  
  SWIG_check_num_args("Xapian::Brass::open",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::Brass::open",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Brass::open",2,"int");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Brass::open",3,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  arg2 = (int)lua_tonumber(L, 2);
  arg3 = (int)lua_tonumber(L, 3);
  {
    try {
      result = Xapian::Brass::open((std::string const &)*arg1,arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::WritableDatabase * resultptr = new Xapian::WritableDatabase((const Xapian::WritableDatabase &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__WritableDatabase,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_brass_open__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  int arg2 ;
  std::string temp1 ;
  Xapian::WritableDatabase result;
  
  SWIG_check_num_args("Xapian::Brass::open",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::Brass::open",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Brass::open",2,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  arg2 = (int)lua_tonumber(L, 2);
  {
    try {
      result = Xapian::Brass::open((std::string const &)*arg1,arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::WritableDatabase * resultptr = new Xapian::WritableDatabase((const Xapian::WritableDatabase &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__WritableDatabase,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_brass_open(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_brass_open__SWIG_0(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_brass_open__SWIG_2(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_brass_open__SWIG_1(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'brass_open'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Brass::open(std::string const &)\n"
    "    Xapian::Brass::open(std::string const &,int,int)\n"
    "    Xapian::Brass::open(std::string const &,int)\n");
  lua_error(L);return 0;
}


static int _wrap_chert_open__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string temp1 ;
  Xapian::Database result;
  
  SWIG_check_num_args("Xapian::Chert::open",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::Chert::open",1,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  {
    try {
      result = Xapian::Chert::open((std::string const &)*arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::Database * resultptr = new Xapian::Database((const Xapian::Database &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__Database,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_chert_open__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  int arg2 ;
  int arg3 ;
  std::string temp1 ;
  Xapian::WritableDatabase result;
  
  SWIG_check_num_args("Xapian::Chert::open",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::Chert::open",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Chert::open",2,"int");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Chert::open",3,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  arg2 = (int)lua_tonumber(L, 2);
  arg3 = (int)lua_tonumber(L, 3);
  {
    try {
      result = Xapian::Chert::open((std::string const &)*arg1,arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::WritableDatabase * resultptr = new Xapian::WritableDatabase((const Xapian::WritableDatabase &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__WritableDatabase,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_chert_open__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  int arg2 ;
  std::string temp1 ;
  Xapian::WritableDatabase result;
  
  SWIG_check_num_args("Xapian::Chert::open",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::Chert::open",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Chert::open",2,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  arg2 = (int)lua_tonumber(L, 2);
  {
    try {
      result = Xapian::Chert::open((std::string const &)*arg1,arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::WritableDatabase * resultptr = new Xapian::WritableDatabase((const Xapian::WritableDatabase &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__WritableDatabase,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_chert_open(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_chert_open__SWIG_0(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_chert_open__SWIG_2(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_chert_open__SWIG_1(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'chert_open'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Chert::open(std::string const &)\n"
    "    Xapian::Chert::open(std::string const &,int,int)\n"
    "    Xapian::Chert::open(std::string const &,int)\n");
  lua_error(L);return 0;
}


static int _wrap_flint_open__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string temp1 ;
  Xapian::Database result;
  
  SWIG_check_num_args("Xapian::Flint::open",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::Flint::open",1,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  {
    try {
      result = Xapian::Flint::open((std::string const &)*arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::Database * resultptr = new Xapian::Database((const Xapian::Database &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__Database,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_flint_open__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  int arg2 ;
  int arg3 ;
  std::string temp1 ;
  Xapian::WritableDatabase result;
  
  SWIG_check_num_args("Xapian::Flint::open",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::Flint::open",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Flint::open",2,"int");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Flint::open",3,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  arg2 = (int)lua_tonumber(L, 2);
  arg3 = (int)lua_tonumber(L, 3);
  {
    try {
      result = Xapian::Flint::open((std::string const &)*arg1,arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::WritableDatabase * resultptr = new Xapian::WritableDatabase((const Xapian::WritableDatabase &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__WritableDatabase,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_flint_open__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  int arg2 ;
  std::string temp1 ;
  Xapian::WritableDatabase result;
  
  SWIG_check_num_args("Xapian::Flint::open",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::Flint::open",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Flint::open",2,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  arg2 = (int)lua_tonumber(L, 2);
  {
    try {
      result = Xapian::Flint::open((std::string const &)*arg1,arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::WritableDatabase * resultptr = new Xapian::WritableDatabase((const Xapian::WritableDatabase &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__WritableDatabase,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_flint_open(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_flint_open__SWIG_0(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_flint_open__SWIG_2(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_flint_open__SWIG_1(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'flint_open'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Flint::open(std::string const &)\n"
    "    Xapian::Flint::open(std::string const &,int,int)\n"
    "    Xapian::Flint::open(std::string const &,int)\n");
  lua_error(L);return 0;
}


static int _wrap_inmemory_open(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::WritableDatabase result;
  
  SWIG_check_num_args("Xapian::InMemory::open",0,0)
  {
    try {
      result = Xapian::InMemory::open();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::WritableDatabase * resultptr = new Xapian::WritableDatabase((const Xapian::WritableDatabase &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__WritableDatabase,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_remote_open__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  unsigned int arg2 ;
  Xapian::timeout arg3 ;
  Xapian::timeout arg4 ;
  std::string temp1 ;
  Xapian::Database result;
  
  SWIG_check_num_args("Xapian::Remote::open",4,4)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::Remote::open",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Remote::open",2,"unsigned int");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Remote::open",3,"Xapian::timeout");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::Remote::open",4,"Xapian::timeout");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (unsigned int)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::timeout)lua_tonumber(L, 3);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (Xapian::timeout)lua_tonumber(L, 4);
  {
    try {
      result = Xapian::Remote::open((std::string const &)*arg1,arg2,arg3,arg4);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::Database * resultptr = new Xapian::Database((const Xapian::Database &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__Database,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_remote_open__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  unsigned int arg2 ;
  Xapian::timeout arg3 ;
  std::string temp1 ;
  Xapian::Database result;
  
  SWIG_check_num_args("Xapian::Remote::open",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::Remote::open",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Remote::open",2,"unsigned int");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Remote::open",3,"Xapian::timeout");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (unsigned int)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::timeout)lua_tonumber(L, 3);
  {
    try {
      result = Xapian::Remote::open((std::string const &)*arg1,arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::Database * resultptr = new Xapian::Database((const Xapian::Database &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__Database,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_remote_open__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  unsigned int arg2 ;
  std::string temp1 ;
  Xapian::Database result;
  
  SWIG_check_num_args("Xapian::Remote::open",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::Remote::open",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Remote::open",2,"unsigned int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (unsigned int)lua_tonumber(L, 2);
  {
    try {
      result = Xapian::Remote::open((std::string const &)*arg1,arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::Database * resultptr = new Xapian::Database((const Xapian::Database &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__Database,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_remote_open_writable__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  unsigned int arg2 ;
  Xapian::timeout arg3 ;
  Xapian::timeout arg4 ;
  std::string temp1 ;
  Xapian::WritableDatabase result;
  
  SWIG_check_num_args("Xapian::Remote::open_writable",4,4)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::Remote::open_writable",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Remote::open_writable",2,"unsigned int");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Remote::open_writable",3,"Xapian::timeout");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::Remote::open_writable",4,"Xapian::timeout");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (unsigned int)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::timeout)lua_tonumber(L, 3);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (Xapian::timeout)lua_tonumber(L, 4);
  {
    try {
      result = Xapian::Remote::open_writable((std::string const &)*arg1,arg2,arg3,arg4);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::WritableDatabase * resultptr = new Xapian::WritableDatabase((const Xapian::WritableDatabase &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__WritableDatabase,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_remote_open_writable__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  unsigned int arg2 ;
  Xapian::timeout arg3 ;
  std::string temp1 ;
  Xapian::WritableDatabase result;
  
  SWIG_check_num_args("Xapian::Remote::open_writable",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::Remote::open_writable",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Remote::open_writable",2,"unsigned int");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Remote::open_writable",3,"Xapian::timeout");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (unsigned int)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::timeout)lua_tonumber(L, 3);
  {
    try {
      result = Xapian::Remote::open_writable((std::string const &)*arg1,arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::WritableDatabase * resultptr = new Xapian::WritableDatabase((const Xapian::WritableDatabase &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__WritableDatabase,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_remote_open_writable__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  unsigned int arg2 ;
  std::string temp1 ;
  Xapian::WritableDatabase result;
  
  SWIG_check_num_args("Xapian::Remote::open_writable",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::Remote::open_writable",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Remote::open_writable",2,"unsigned int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (unsigned int)lua_tonumber(L, 2);
  {
    try {
      result = Xapian::Remote::open_writable((std::string const &)*arg1,arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::WritableDatabase * resultptr = new Xapian::WritableDatabase((const Xapian::WritableDatabase &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__WritableDatabase,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_remote_open__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  Xapian::timeout arg3 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::Database result;
  
  SWIG_check_num_args("Xapian::Remote::open",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::Remote::open",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Remote::open",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Remote::open",3,"Xapian::timeout");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::timeout)lua_tonumber(L, 3);
  {
    try {
      result = Xapian::Remote::open((std::string const &)*arg1,(std::string const &)*arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::Database * resultptr = new Xapian::Database((const Xapian::Database &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__Database,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_remote_open__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::Database result;
  
  SWIG_check_num_args("Xapian::Remote::open",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::Remote::open",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Remote::open",2,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = Xapian::Remote::open((std::string const &)*arg1,(std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::Database * resultptr = new Xapian::Database((const Xapian::Database &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__Database,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_remote_open(lua_State* L) {
  int argc;
  int argv[5]={
    1,2,3,4,5
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_remote_open__SWIG_2(L);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_remote_open__SWIG_4(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_remote_open__SWIG_1(L);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_remote_open__SWIG_3(L);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          {
            _v = lua_isnumber(L,argv[3]);
          }
          if (_v) {
            return _wrap_remote_open__SWIG_0(L);
          }
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'remote_open'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Remote::open(std::string const &,unsigned int,Xapian::timeout,Xapian::timeout)\n"
    "    Xapian::Remote::open(std::string const &,unsigned int,Xapian::timeout)\n"
    "    Xapian::Remote::open(std::string const &,unsigned int)\n"
    "    Xapian::Remote::open(std::string const &,std::string const &,Xapian::timeout)\n"
    "    Xapian::Remote::open(std::string const &,std::string const &)\n");
  lua_error(L);return 0;
}


static int _wrap_remote_open_writable__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  Xapian::timeout arg3 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::WritableDatabase result;
  
  SWIG_check_num_args("Xapian::Remote::open_writable",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::Remote::open_writable",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Remote::open_writable",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Remote::open_writable",3,"Xapian::timeout");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::timeout)lua_tonumber(L, 3);
  {
    try {
      result = Xapian::Remote::open_writable((std::string const &)*arg1,(std::string const &)*arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::WritableDatabase * resultptr = new Xapian::WritableDatabase((const Xapian::WritableDatabase &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__WritableDatabase,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_remote_open_writable__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::WritableDatabase result;
  
  SWIG_check_num_args("Xapian::Remote::open_writable",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::Remote::open_writable",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Remote::open_writable",2,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = Xapian::Remote::open_writable((std::string const &)*arg1,(std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::WritableDatabase * resultptr = new Xapian::WritableDatabase((const Xapian::WritableDatabase &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__WritableDatabase,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_remote_open_writable(lua_State* L) {
  int argc;
  int argv[5]={
    1,2,3,4,5
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_remote_open_writable__SWIG_2(L);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_remote_open_writable__SWIG_4(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_remote_open_writable__SWIG_1(L);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_remote_open_writable__SWIG_3(L);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          {
            _v = lua_isnumber(L,argv[3]);
          }
          if (_v) {
            return _wrap_remote_open_writable__SWIG_0(L);
          }
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'remote_open_writable'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Remote::open_writable(std::string const &,unsigned int,Xapian::timeout,Xapian::timeout)\n"
    "    Xapian::Remote::open_writable(std::string const &,unsigned int,Xapian::timeout)\n"
    "    Xapian::Remote::open_writable(std::string const &,unsigned int)\n"
    "    Xapian::Remote::open_writable(std::string const &,std::string const &,Xapian::timeout)\n"
    "    Xapian::Remote::open_writable(std::string const &,std::string const &)\n");
  lua_error(L);return 0;
}


static int _wrap_new_Query__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Query *arg1 = 0 ;
  Xapian::Query *result = 0 ;
  
  SWIG_check_num_args("Xapian::Query::Query",1,1)
  if(!lua_isuserdata(L,1)) SWIG_fail_arg("Xapian::Query::Query",1,"Xapian::Query const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Query,0))){
    SWIG_fail_ptr("new_Query",1,SWIGTYPE_p_Xapian__Query);
  }
  
  {
    try {
      result = (Xapian::Query *)new Xapian::Query((Xapian::Query const &)*arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__Query,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_Query__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Query *result = 0 ;
  
  SWIG_check_num_args("Xapian::Query::Query",0,0)
  {
    try {
      result = (Xapian::Query *)new Xapian::Query();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__Query,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_Query__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  Xapian::termcount arg2 ;
  Xapian::termpos arg3 ;
  std::string temp1 ;
  Xapian::Query *result = 0 ;
  
  SWIG_check_num_args("Xapian::Query::Query",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::Query::Query",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Query::Query",2,"Xapian::termcount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Query::Query",3,"Xapian::termpos");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::termcount)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::termpos)lua_tonumber(L, 3);
  {
    try {
      result = (Xapian::Query *)new Xapian::Query((std::string const &)*arg1,arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__Query,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_Query__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  Xapian::termcount arg2 ;
  std::string temp1 ;
  Xapian::Query *result = 0 ;
  
  SWIG_check_num_args("Xapian::Query::Query",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::Query::Query",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Query::Query",2,"Xapian::termcount");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::termcount)lua_tonumber(L, 2);
  {
    try {
      result = (Xapian::Query *)new Xapian::Query((std::string const &)*arg1,arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__Query,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_Query__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string temp1 ;
  Xapian::Query *result = 0 ;
  
  SWIG_check_num_args("Xapian::Query::Query",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::Query::Query",1,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  {
    try {
      result = (Xapian::Query *)new Xapian::Query((std::string const &)*arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__Query,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_Query__SWIG_5(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Query::op arg1 ;
  Xapian::Query *arg2 = 0 ;
  Xapian::Query *arg3 = 0 ;
  Xapian::Query *result = 0 ;
  
  SWIG_check_num_args("Xapian::Query::Query",3,3)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::Query::Query",1,"Xapian::Query::op");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::Query::Query",2,"Xapian::Query const &");
  if(!lua_isuserdata(L,3)) SWIG_fail_arg("Xapian::Query::Query",3,"Xapian::Query const &");
  arg1 = (Xapian::Query::op)(int)lua_tonumber(L, 1);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__Query,0))){
    SWIG_fail_ptr("new_Query",2,SWIGTYPE_p_Xapian__Query);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_Xapian__Query,0))){
    SWIG_fail_ptr("new_Query",3,SWIGTYPE_p_Xapian__Query);
  }
  
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1,(Xapian::Query const &)*arg2,(Xapian::Query const &)*arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__Query,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_Query__SWIG_6(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Query::op arg1 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  std::string temp2 ;
  std::string temp3 ;
  Xapian::Query *result = 0 ;
  
  SWIG_check_num_args("Xapian::Query::Query",3,3)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::Query::Query",1,"Xapian::Query::op");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Query::Query",2,"std::string const &");
  if(!lua_isstring(L,3)) SWIG_fail_arg("Xapian::Query::Query",3,"std::string const &");
  arg1 = (Xapian::Query::op)(int)lua_tonumber(L, 1);
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  temp3.assign(lua_tostring(L,3),lua_rawlen(L,3)); arg3=&temp3;
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1,(std::string const &)*arg2,(std::string const &)*arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__Query,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_Query__SWIG_9(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Query::op arg1 ;
  Xapian::Query arg2 ;
  double arg3 ;
  Xapian::Query *argp2 ;
  Xapian::Query *result = 0 ;
  
  SWIG_check_num_args("Xapian::Query::Query",3,3)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::Query::Query",1,"Xapian::Query::op");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::Query::Query",2,"Xapian::Query");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Query::Query",3,"double");
  arg1 = (Xapian::Query::op)(int)lua_tonumber(L, 1);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&argp2,SWIGTYPE_p_Xapian__Query,0))){
    SWIG_fail_ptr("new_Query",2,SWIGTYPE_p_Xapian__Query);
  }
  arg2 = *argp2;
  
  arg3 = (double)lua_tonumber(L, 3);
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1,arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__Query,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_Query__SWIG_10(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Query::op arg1 ;
  Xapian::valueno arg2 ;
  std::string *arg3 = 0 ;
  std::string *arg4 = 0 ;
  std::string temp3 ;
  std::string temp4 ;
  Xapian::Query *result = 0 ;
  
  SWIG_check_num_args("Xapian::Query::Query",4,4)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::Query::Query",1,"Xapian::Query::op");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Query::Query",2,"Xapian::valueno");
  if(!lua_isstring(L,3)) SWIG_fail_arg("Xapian::Query::Query",3,"std::string const &");
  if(!lua_isstring(L,4)) SWIG_fail_arg("Xapian::Query::Query",4,"std::string const &");
  arg1 = (Xapian::Query::op)(int)lua_tonumber(L, 1);
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::valueno)lua_tonumber(L, 2);
  temp3.assign(lua_tostring(L,3),lua_rawlen(L,3)); arg3=&temp3;
  temp4.assign(lua_tostring(L,4),lua_rawlen(L,4)); arg4=&temp4;
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1,arg2,(std::string const &)*arg3,(std::string const &)*arg4);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__Query,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_Query__SWIG_11(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Query::op arg1 ;
  Xapian::valueno arg2 ;
  std::string *arg3 = 0 ;
  std::string temp3 ;
  Xapian::Query *result = 0 ;
  
  SWIG_check_num_args("Xapian::Query::Query",3,3)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::Query::Query",1,"Xapian::Query::op");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Query::Query",2,"Xapian::valueno");
  if(!lua_isstring(L,3)) SWIG_fail_arg("Xapian::Query::Query",3,"std::string const &");
  arg1 = (Xapian::Query::op)(int)lua_tonumber(L, 1);
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::valueno)lua_tonumber(L, 2);
  temp3.assign(lua_tostring(L,3),lua_rawlen(L,3)); arg3=&temp3;
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1,arg2,(std::string const &)*arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__Query,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_Query__SWIG_12(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  Xapian::Query *result = 0 ;
  
  SWIG_check_num_args("Xapian::Query::Query",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Query::Query",1,"Xapian::PostingSource *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PostingSource,0))){
    SWIG_fail_ptr("new_Query",1,SWIGTYPE_p_Xapian__PostingSource);
  }
  
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__Query,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Query_MatchAll_get(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Query *result = 0 ;
  
  SWIG_check_num_args("Xapian::Query::MatchAll",0,0)
  result = (Xapian::Query *)&Xapian::Query::MatchAll;
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__Query,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Query_MatchNothing_get(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Query *result = 0 ;
  
  SWIG_check_num_args("Xapian::Query::MatchNothing",0,0)
  result = (Xapian::Query *)&Xapian::Query::MatchNothing;
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__Query,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Query_get_length(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  Xapian::termcount result;
  
  SWIG_check_num_args("Xapian::Query::get_length",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Query::get_length",1,"Xapian::Query const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Query,0))){
    SWIG_fail_ptr("Query_get_length",1,SWIGTYPE_p_Xapian__Query);
  }
  
  {
    try {
      result = (Xapian::termcount)((Xapian::Query const *)arg1)->get_length();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Query_get_terms_begin(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::Query::get_terms_begin",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Query::get_terms_begin",1,"Xapian::Query const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Query,0))){
    SWIG_fail_ptr("Query_get_terms_begin",1,SWIGTYPE_p_Xapian__Query);
  }
  
  {
    try {
      result = ((Xapian::Query const *)arg1)->get_terms_begin();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Query_get_terms_end(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::Query::get_terms_end",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Query::get_terms_end",1,"Xapian::Query const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Query,0))){
    SWIG_fail_ptr("Query_get_terms_end",1,SWIGTYPE_p_Xapian__Query);
  }
  
  {
    try {
      result = ((Xapian::Query const *)arg1)->get_terms_end();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Query_empty(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  bool result;
  
  SWIG_check_num_args("Xapian::Query::empty",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Query::empty",1,"Xapian::Query const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Query,0))){
    SWIG_fail_ptr("Query_empty",1,SWIGTYPE_p_Xapian__Query);
  }
  
  {
    try {
      result = (bool)((Xapian::Query const *)arg1)->empty();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Query_serialise(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::Query::serialise",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Query::serialise",1,"Xapian::Query const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Query,0))){
    SWIG_fail_ptr("Query_serialise",1,SWIGTYPE_p_Xapian__Query);
  }
  
  {
    try {
      result = ((Xapian::Query const *)arg1)->serialise();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Query_unserialise__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string temp1 ;
  Xapian::Query result;
  
  SWIG_check_num_args("Xapian::Query::unserialise",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::Query::unserialise",1,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  {
    try {
      result = Xapian::Query::unserialise((std::string const &)*arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::Query * resultptr = new Xapian::Query((const Xapian::Query &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__Query,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Query_unserialise__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  Xapian::Registry *arg2 = 0 ;
  std::string temp1 ;
  Xapian::Query result;
  
  SWIG_check_num_args("Xapian::Query::unserialise",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::Query::unserialise",1,"std::string const &");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::Query::unserialise",2,"Xapian::Registry const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__Registry,0))){
    SWIG_fail_ptr("Query_unserialise",2,SWIGTYPE_p_Xapian__Registry);
  }
  
  {
    try {
      result = Xapian::Query::unserialise((std::string const &)*arg1,(Xapian::Registry const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::Query * resultptr = new Xapian::Query((const Xapian::Query &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__Query,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Query_unserialise(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_Query_unserialise__SWIG_0(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        void *ptr;
        if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_Xapian__Registry, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        return _wrap_Query_unserialise__SWIG_1(L);
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'Query_unserialise'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Query::unserialise(std::string const &)\n"
    "    Xapian::Query::unserialise(std::string const &,Xapian::Registry const &)\n");
  lua_error(L);return 0;
}


static int _wrap_Query___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::Query::get_description",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Query::get_description",1,"Xapian::Query const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Query,0))){
    SWIG_fail_ptr("Query___tostring",1,SWIGTYPE_p_Xapian__Query);
  }
  
  {
    try {
      result = ((Xapian::Query const *)arg1)->get_description();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Query_get_terms(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  std::pair< Xapian::TermIterator,Xapian::TermIterator > result;
  
  SWIG_check_num_args("Xapian::Query::get_terms",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Query::get_terms",1,"Xapian::Query *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Query,0))){
    SWIG_fail_ptr("Query_get_terms",1,SWIGTYPE_p_Xapian__Query);
  }
  
  result = Xapian_Query_get_terms(arg1);
  {
    lua_getglobal(L, "xapian");
    lua_pushstring(L, "Iterator");
    lua_gettable(L, -2);
    lua_remove(L, -2);
    
    if (!lua_isfunction(L, -1)) {
      luaL_typerror(L, -1, "function");
    }
    
    Xapian::TermIterator * begin = new Xapian::TermIterator((const Xapian::TermIterator &)(&result)->first);
    SWIG_NewPointerObj(L, (void *) begin, SWIGTYPE_p_Xapian__TermIterator, 1);
    
    Xapian::TermIterator * end = new Xapian::TermIterator((const Xapian::TermIterator &)(&result)->second);
    SWIG_NewPointerObj(L, (void *) end, SWIGTYPE_p_Xapian__TermIterator, 1);
    
    if (lua_pcall(L, 2, 1, 0) != 0) {
      luaL_error(L, "error running function: %s", lua_tostring(L, -1));
    }
    
    SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_Query__SWIG_13(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Query::op arg1 ;
  std::vector< Xapian::Query > *arg2 = 0 ;
  Xapian::termcount arg3 ;
  vector< Xapian::Query > v2 ;
  Xapian::Query *result = 0 ;
  
  SWIG_check_num_args("Xapian::Query::Query",3,3)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::Query::Query",1,"Xapian::Query::op");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Query::Query",3,"Xapian::termcount");
  arg1 = (Xapian::Query::op)(int)lua_tonumber(L, 1);
  {
    int numitems = lua_rawlen(L, 2);;
    v2.reserve(numitems);
    for (int i = 0; i < numitems; ++i) {
      lua_rawgeti(L, 2, i+1);
      if (lua_isstring(L, -1)) {
        size_t len = 0;
        const char *p = lua_tolstring(L, -1, &len);
        v2.push_back(Xapian::Query(string(p, len)));
      } else {
        Xapian::Query *subq = 0;
        if(!lua_isuserdata(L, -1) || SWIG_ConvertPtr(L, -1, (void **)&subq, SWIGTYPE_p_Xapian__Query, 0) == -1){
          lua_pop(L, 1);
          luaL_argerror(L, 2, "elements of Tables passed to Query must be either Strings or other Queries");
        }
        
        v2.push_back(*subq);
      }
      lua_pop(L, 1);
    }
    arg2 = &v2;
  }
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::termcount)lua_tonumber(L, 3);
  {
    try {
      result = (Xapian::Query *)new_Xapian_Query__SWIG_13(arg1,(std::vector< Xapian::Query > const &)*arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__Query,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_Query__SWIG_14(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Query::op arg1 ;
  std::vector< Xapian::Query > *arg2 = 0 ;
  vector< Xapian::Query > v2 ;
  Xapian::Query *result = 0 ;
  
  SWIG_check_num_args("Xapian::Query::Query",2,2)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::Query::Query",1,"Xapian::Query::op");
  arg1 = (Xapian::Query::op)(int)lua_tonumber(L, 1);
  {
    int numitems = lua_rawlen(L, 2);;
    v2.reserve(numitems);
    for (int i = 0; i < numitems; ++i) {
      lua_rawgeti(L, 2, i+1);
      if (lua_isstring(L, -1)) {
        size_t len = 0;
        const char *p = lua_tolstring(L, -1, &len);
        v2.push_back(Xapian::Query(string(p, len)));
      } else {
        Xapian::Query *subq = 0;
        if(!lua_isuserdata(L, -1) || SWIG_ConvertPtr(L, -1, (void **)&subq, SWIGTYPE_p_Xapian__Query, 0) == -1){
          lua_pop(L, 1);
          luaL_argerror(L, 2, "elements of Tables passed to Query must be either Strings or other Queries");
        }
        
        v2.push_back(*subq);
      }
      lua_pop(L, 1);
    }
    arg2 = &v2;
  }
  {
    try {
      result = (Xapian::Query *)new_Xapian_Query__SWIG_13(arg1,(std::vector< Xapian::Query > const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__Query,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_Query(lua_State* L) {
  int argc;
  int argv[5]={
    1,2,3,4,5
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_Query__SWIG_1(L);
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__Query, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_new_Query__SWIG_0(L);
    }
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__PostingSource, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_new_Query__SWIG_12(L);
    }
  }
  if (argc == 1) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_Query__SWIG_4(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_istable(L, argv[1]);
        /* FIXME: if we add more array typemaps, we'll need to check the elements
             * of the array here to disambiguate. */
      }
      if (_v) {
        return _wrap_new_Query__SWIG_14(L);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_Query__SWIG_3(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      {
        void *ptr;
        if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_Xapian__Query, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        {
          void *ptr;
          if (lua_isuserdata(L,argv[2])==0 || SWIG_ConvertPtr(L,argv[2], (void **) &ptr, SWIGTYPE_p_Xapian__Query, 0)) {
            _v = 0;
          } else {
            _v = 1;
          }
        }
        if (_v) {
          return _wrap_new_Query__SWIG_5(L);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      {
        void *ptr;
        if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_Xapian__Query, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_Query__SWIG_9(L);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isstring(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_Query__SWIG_11(L);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isstring(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_Query__SWIG_6(L);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_istable(L, argv[1]);
        /* FIXME: if we add more array typemaps, we'll need to check the elements
             * of the array here to disambiguate. */
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_Query__SWIG_13(L);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_Query__SWIG_2(L);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isstring(L,argv[2]);
        }
        if (_v) {
          {
            _v = lua_isstring(L,argv[3]);
          }
          if (_v) {
            return _wrap_new_Query__SWIG_10(L);
          }
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_Query'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Query::Query(Xapian::Query const &)\n"
    "    Xapian::Query::Query()\n"
    "    Xapian::Query::Query(std::string const &,Xapian::termcount,Xapian::termpos)\n"
    "    Xapian::Query::Query(std::string const &,Xapian::termcount)\n"
    "    Xapian::Query::Query(std::string const &)\n"
    "    Xapian::Query::Query(Xapian::Query::op,Xapian::Query const &,Xapian::Query const &)\n"
    "    Xapian::Query::Query(Xapian::Query::op,std::string const &,std::string const &)\n"
    "    Xapian::Query::Query(Xapian::Query::op,Xapian::Query,double)\n"
    "    Xapian::Query::Query(Xapian::Query::op,Xapian::valueno,std::string const &,std::string const &)\n"
    "    Xapian::Query::Query(Xapian::Query::op,Xapian::valueno,std::string const &)\n"
    "    Xapian::Query::Query(Xapian::PostingSource *)\n"
    "    Xapian::Query::Query(Xapian::Query::op,std::vector< Xapian::Query > const &,Xapian::termcount)\n"
    "    Xapian::Query::Query(Xapian::Query::op,std::vector< Xapian::Query > const &)\n");
  lua_error(L);return 0;
}


static void swig_delete_Query(void *obj) {
Xapian::Query *arg1 = (Xapian::Query *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_Query_methods[] = {
    {"get_length", _wrap_Query_get_length}, 
    {"get_terms_begin", _wrap_Query_get_terms_begin}, 
    {"get_terms_end", _wrap_Query_get_terms_end}, 
    {"empty", _wrap_Query_empty}, 
    {"serialise", _wrap_Query_serialise}, 
    {"__tostring", _wrap_Query___tostring}, 
    {"get_terms", _wrap_Query_get_terms}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_Query_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_Query_bases[] = {0};
static const char *swig_Xapian_Query_base_names[] = {0};
static swig_lua_class _wrap_class_Xapian_Query = { "Query", &SWIGTYPE_p_Xapian__Query,_wrap_new_Query, swig_delete_Query, swig_Xapian_Query_methods, swig_Xapian_Query_attributes, swig_Xapian_Query_bases, swig_Xapian_Query_base_names };

static int _wrap_Stopper___call(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Stopper *arg1 = (Xapian::Stopper *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  bool result;
  
  SWIG_check_num_args("Xapian::Stopper::operator ()",2,2)
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Stopper::operator ()",2,"std::string const &");
  {
    if (lua_isfunction(L, 1)) {
      arg1 = new luaStopper(L);
    }
    else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 1, (void**)&arg1, SWIGTYPE_p_Xapian__Stopper, 0))){
        SWIG_fail;
      }
    }
  }
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = (bool)((Xapian::Stopper const *)arg1)->operator ()((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Stopper___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Stopper *arg1 = (Xapian::Stopper *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::Stopper::get_description",1,1)
  {
    if (lua_isfunction(L, 1)) {
      arg1 = new luaStopper(L);
    }
    else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 1, (void**)&arg1, SWIGTYPE_p_Xapian__Stopper, 0))){
        SWIG_fail;
      }
    }
  }
  {
    try {
      result = ((Xapian::Stopper const *)arg1)->get_description();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_Stopper(void *obj) {
Xapian::Stopper *arg1 = (Xapian::Stopper *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_Stopper_methods[] = {
    {"__call", _wrap_Stopper___call}, 
    {"__tostring", _wrap_Stopper___tostring}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_Stopper_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_Stopper_bases[] = {0};
static const char *swig_Xapian_Stopper_base_names[] = {0};
static swig_lua_class _wrap_class_Xapian_Stopper = { "Stopper", &SWIGTYPE_p_Xapian__Stopper,0, swig_delete_Stopper, swig_Xapian_Stopper_methods, swig_Xapian_Stopper_attributes, swig_Xapian_Stopper_bases, swig_Xapian_Stopper_base_names };

static int _wrap_new_SimpleStopper(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::SimpleStopper *result = 0 ;
  
  SWIG_check_num_args("Xapian::SimpleStopper::SimpleStopper",0,0)
  {
    try {
      result = (Xapian::SimpleStopper *)new Xapian::SimpleStopper();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__SimpleStopper,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_SimpleStopper_add(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::SimpleStopper *arg1 = (Xapian::SimpleStopper *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::SimpleStopper::add",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::SimpleStopper::add",1,"Xapian::SimpleStopper *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::SimpleStopper::add",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__SimpleStopper,0))){
    SWIG_fail_ptr("SimpleStopper_add",1,SWIGTYPE_p_Xapian__SimpleStopper);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      (arg1)->add((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_SimpleStopper___call(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::SimpleStopper *arg1 = (Xapian::SimpleStopper *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  bool result;
  
  SWIG_check_num_args("Xapian::SimpleStopper::operator ()",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::SimpleStopper::operator ()",1,"Xapian::SimpleStopper const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::SimpleStopper::operator ()",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__SimpleStopper,0))){
    SWIG_fail_ptr("SimpleStopper___call",1,SWIGTYPE_p_Xapian__SimpleStopper);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = (bool)((Xapian::SimpleStopper const *)arg1)->operator ()((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_SimpleStopper___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::SimpleStopper *arg1 = (Xapian::SimpleStopper *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::SimpleStopper::get_description",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::SimpleStopper::get_description",1,"Xapian::SimpleStopper const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__SimpleStopper,0))){
    SWIG_fail_ptr("SimpleStopper___tostring",1,SWIGTYPE_p_Xapian__SimpleStopper);
  }
  
  {
    try {
      result = ((Xapian::SimpleStopper const *)arg1)->get_description();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_SimpleStopper(void *obj) {
Xapian::SimpleStopper *arg1 = (Xapian::SimpleStopper *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_SimpleStopper_methods[] = {
    {"add", _wrap_SimpleStopper_add}, 
    {"__call", _wrap_SimpleStopper___call}, 
    {"__tostring", _wrap_SimpleStopper___tostring}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_SimpleStopper_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_SimpleStopper_bases[] = {0,0};
static const char *swig_Xapian_SimpleStopper_base_names[] = {"Xapian::Stopper *",0};
static swig_lua_class _wrap_class_Xapian_SimpleStopper = { "SimpleStopper", &SWIGTYPE_p_Xapian__SimpleStopper,_wrap_new_SimpleStopper, swig_delete_SimpleStopper, swig_Xapian_SimpleStopper_methods, swig_Xapian_SimpleStopper_attributes, swig_Xapian_SimpleStopper_bases, swig_Xapian_SimpleStopper_base_names };

static int _wrap_ValueRangeProcessor___call(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueRangeProcessor *arg1 = (Xapian::ValueRangeProcessor *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  Xapian::valueno result;
  
  SWIG_check_num_args("Xapian::ValueRangeProcessor::operator ()",3,3)
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::ValueRangeProcessor::operator ()",2,"std::string &");
  if(!lua_isuserdata(L,3)) SWIG_fail_arg("Xapian::ValueRangeProcessor::operator ()",3,"std::string &");
  {
    if (lua_isfunction(L, 1)) {
      arg1 = new luaValueRangeProcessor(L);
    }
    else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 1, (void**)&arg1, SWIGTYPE_p_Xapian__ValueRangeProcessor, 0))){
        SWIG_fail;
      }
    }
  }
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_std__string,0))){
    SWIG_fail_ptr("ValueRangeProcessor___call",2,SWIGTYPE_p_std__string);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_std__string,0))){
    SWIG_fail_ptr("ValueRangeProcessor___call",3,SWIGTYPE_p_std__string);
  }
  
  {
    try {
      result = (Xapian::valueno)(arg1)->operator ()(*arg2,*arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_ValueRangeProcessor(void *obj) {
Xapian::ValueRangeProcessor *arg1 = (Xapian::ValueRangeProcessor *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_ValueRangeProcessor_methods[] = {
    {"__call", _wrap_ValueRangeProcessor___call}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_ValueRangeProcessor_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_ValueRangeProcessor_bases[] = {0};
static const char *swig_Xapian_ValueRangeProcessor_base_names[] = {0};
static swig_lua_class _wrap_class_Xapian_ValueRangeProcessor = { "ValueRangeProcessor", &SWIGTYPE_p_Xapian__ValueRangeProcessor,0, swig_delete_ValueRangeProcessor, swig_Xapian_ValueRangeProcessor_methods, swig_Xapian_ValueRangeProcessor_attributes, swig_Xapian_ValueRangeProcessor_bases, swig_Xapian_ValueRangeProcessor_base_names };

static int _wrap_new_StringValueRangeProcessor__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  Xapian::StringValueRangeProcessor *result = 0 ;
  
  SWIG_check_num_args("Xapian::StringValueRangeProcessor::StringValueRangeProcessor",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::StringValueRangeProcessor::StringValueRangeProcessor",1,"Xapian::valueno");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  {
    try {
      result = (Xapian::StringValueRangeProcessor *)new Xapian::StringValueRangeProcessor(arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__StringValueRangeProcessor,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_StringValueRangeProcessor__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  bool arg3 ;
  std::string temp2 ;
  Xapian::StringValueRangeProcessor *result = 0 ;
  
  SWIG_check_num_args("Xapian::StringValueRangeProcessor::StringValueRangeProcessor",3,3)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::StringValueRangeProcessor::StringValueRangeProcessor",1,"Xapian::valueno");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::StringValueRangeProcessor::StringValueRangeProcessor",2,"std::string const &");
  if(!lua_isboolean(L,3)) SWIG_fail_arg("Xapian::StringValueRangeProcessor::StringValueRangeProcessor",3,"bool");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (lua_toboolean(L, 3)!=0);
  {
    try {
      result = (Xapian::StringValueRangeProcessor *)new Xapian::StringValueRangeProcessor(arg1,(std::string const &)*arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__StringValueRangeProcessor,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_StringValueRangeProcessor__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  Xapian::StringValueRangeProcessor *result = 0 ;
  
  SWIG_check_num_args("Xapian::StringValueRangeProcessor::StringValueRangeProcessor",2,2)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::StringValueRangeProcessor::StringValueRangeProcessor",1,"Xapian::valueno");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::StringValueRangeProcessor::StringValueRangeProcessor",2,"std::string const &");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = (Xapian::StringValueRangeProcessor *)new Xapian::StringValueRangeProcessor(arg1,(std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__StringValueRangeProcessor,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_StringValueRangeProcessor(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_StringValueRangeProcessor__SWIG_0(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_StringValueRangeProcessor__SWIG_2(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isboolean(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_StringValueRangeProcessor__SWIG_1(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_StringValueRangeProcessor'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::StringValueRangeProcessor::StringValueRangeProcessor(Xapian::valueno)\n"
    "    Xapian::StringValueRangeProcessor::StringValueRangeProcessor(Xapian::valueno,std::string const &,bool)\n"
    "    Xapian::StringValueRangeProcessor::StringValueRangeProcessor(Xapian::valueno,std::string const &)\n");
  lua_error(L);return 0;
}


static int _wrap_StringValueRangeProcessor___call(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::StringValueRangeProcessor *arg1 = (Xapian::StringValueRangeProcessor *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  Xapian::valueno result;
  
  SWIG_check_num_args("Xapian::StringValueRangeProcessor::operator ()",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::StringValueRangeProcessor::operator ()",1,"Xapian::StringValueRangeProcessor *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::StringValueRangeProcessor::operator ()",2,"std::string &");
  if(!lua_isuserdata(L,3)) SWIG_fail_arg("Xapian::StringValueRangeProcessor::operator ()",3,"std::string &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__StringValueRangeProcessor,0))){
    SWIG_fail_ptr("StringValueRangeProcessor___call",1,SWIGTYPE_p_Xapian__StringValueRangeProcessor);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_std__string,0))){
    SWIG_fail_ptr("StringValueRangeProcessor___call",2,SWIGTYPE_p_std__string);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_std__string,0))){
    SWIG_fail_ptr("StringValueRangeProcessor___call",3,SWIGTYPE_p_std__string);
  }
  
  {
    try {
      result = (Xapian::valueno)(arg1)->operator ()(*arg2,*arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_StringValueRangeProcessor(void *obj) {
Xapian::StringValueRangeProcessor *arg1 = (Xapian::StringValueRangeProcessor *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_StringValueRangeProcessor_methods[] = {
    {"__call", _wrap_StringValueRangeProcessor___call}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_StringValueRangeProcessor_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_StringValueRangeProcessor_bases[] = {0,0};
static const char *swig_Xapian_StringValueRangeProcessor_base_names[] = {"Xapian::ValueRangeProcessor *",0};
static swig_lua_class _wrap_class_Xapian_StringValueRangeProcessor = { "StringValueRangeProcessor", &SWIGTYPE_p_Xapian__StringValueRangeProcessor,_wrap_new_StringValueRangeProcessor, swig_delete_StringValueRangeProcessor, swig_Xapian_StringValueRangeProcessor_methods, swig_Xapian_StringValueRangeProcessor_attributes, swig_Xapian_StringValueRangeProcessor_bases, swig_Xapian_StringValueRangeProcessor_base_names };

static int _wrap_new_DateValueRangeProcessor__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  bool arg2 ;
  int arg3 ;
  Xapian::DateValueRangeProcessor *result = 0 ;
  
  SWIG_check_num_args("Xapian::DateValueRangeProcessor::DateValueRangeProcessor",3,3)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::DateValueRangeProcessor::DateValueRangeProcessor",1,"Xapian::valueno");
  if(!lua_isboolean(L,2)) SWIG_fail_arg("Xapian::DateValueRangeProcessor::DateValueRangeProcessor",2,"bool");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::DateValueRangeProcessor::DateValueRangeProcessor",3,"int");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  arg2 = (lua_toboolean(L, 2)!=0);
  arg3 = (int)lua_tonumber(L, 3);
  {
    try {
      result = (Xapian::DateValueRangeProcessor *)new Xapian::DateValueRangeProcessor(arg1,arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DateValueRangeProcessor,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DateValueRangeProcessor__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  bool arg2 ;
  Xapian::DateValueRangeProcessor *result = 0 ;
  
  SWIG_check_num_args("Xapian::DateValueRangeProcessor::DateValueRangeProcessor",2,2)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::DateValueRangeProcessor::DateValueRangeProcessor",1,"Xapian::valueno");
  if(!lua_isboolean(L,2)) SWIG_fail_arg("Xapian::DateValueRangeProcessor::DateValueRangeProcessor",2,"bool");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  arg2 = (lua_toboolean(L, 2)!=0);
  {
    try {
      result = (Xapian::DateValueRangeProcessor *)new Xapian::DateValueRangeProcessor(arg1,arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DateValueRangeProcessor,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DateValueRangeProcessor__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  Xapian::DateValueRangeProcessor *result = 0 ;
  
  SWIG_check_num_args("Xapian::DateValueRangeProcessor::DateValueRangeProcessor",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::DateValueRangeProcessor::DateValueRangeProcessor",1,"Xapian::valueno");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  {
    try {
      result = (Xapian::DateValueRangeProcessor *)new Xapian::DateValueRangeProcessor(arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DateValueRangeProcessor,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DateValueRangeProcessor__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  bool arg3 ;
  bool arg4 ;
  int arg5 ;
  std::string temp2 ;
  Xapian::DateValueRangeProcessor *result = 0 ;
  
  SWIG_check_num_args("Xapian::DateValueRangeProcessor::DateValueRangeProcessor",5,5)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::DateValueRangeProcessor::DateValueRangeProcessor",1,"Xapian::valueno");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DateValueRangeProcessor::DateValueRangeProcessor",2,"std::string const &");
  if(!lua_isboolean(L,3)) SWIG_fail_arg("Xapian::DateValueRangeProcessor::DateValueRangeProcessor",3,"bool");
  if(!lua_isboolean(L,4)) SWIG_fail_arg("Xapian::DateValueRangeProcessor::DateValueRangeProcessor",4,"bool");
  if(!lua_isnumber(L,5)) SWIG_fail_arg("Xapian::DateValueRangeProcessor::DateValueRangeProcessor",5,"int");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (lua_toboolean(L, 3)!=0);
  arg4 = (lua_toboolean(L, 4)!=0);
  arg5 = (int)lua_tonumber(L, 5);
  {
    try {
      result = (Xapian::DateValueRangeProcessor *)new Xapian::DateValueRangeProcessor(arg1,(std::string const &)*arg2,arg3,arg4,arg5);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DateValueRangeProcessor,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DateValueRangeProcessor__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  bool arg3 ;
  bool arg4 ;
  std::string temp2 ;
  Xapian::DateValueRangeProcessor *result = 0 ;
  
  SWIG_check_num_args("Xapian::DateValueRangeProcessor::DateValueRangeProcessor",4,4)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::DateValueRangeProcessor::DateValueRangeProcessor",1,"Xapian::valueno");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DateValueRangeProcessor::DateValueRangeProcessor",2,"std::string const &");
  if(!lua_isboolean(L,3)) SWIG_fail_arg("Xapian::DateValueRangeProcessor::DateValueRangeProcessor",3,"bool");
  if(!lua_isboolean(L,4)) SWIG_fail_arg("Xapian::DateValueRangeProcessor::DateValueRangeProcessor",4,"bool");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (lua_toboolean(L, 3)!=0);
  arg4 = (lua_toboolean(L, 4)!=0);
  {
    try {
      result = (Xapian::DateValueRangeProcessor *)new Xapian::DateValueRangeProcessor(arg1,(std::string const &)*arg2,arg3,arg4);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DateValueRangeProcessor,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DateValueRangeProcessor__SWIG_5(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  bool arg3 ;
  std::string temp2 ;
  Xapian::DateValueRangeProcessor *result = 0 ;
  
  SWIG_check_num_args("Xapian::DateValueRangeProcessor::DateValueRangeProcessor",3,3)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::DateValueRangeProcessor::DateValueRangeProcessor",1,"Xapian::valueno");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DateValueRangeProcessor::DateValueRangeProcessor",2,"std::string const &");
  if(!lua_isboolean(L,3)) SWIG_fail_arg("Xapian::DateValueRangeProcessor::DateValueRangeProcessor",3,"bool");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (lua_toboolean(L, 3)!=0);
  {
    try {
      result = (Xapian::DateValueRangeProcessor *)new Xapian::DateValueRangeProcessor(arg1,(std::string const &)*arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DateValueRangeProcessor,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DateValueRangeProcessor__SWIG_6(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  Xapian::DateValueRangeProcessor *result = 0 ;
  
  SWIG_check_num_args("Xapian::DateValueRangeProcessor::DateValueRangeProcessor",2,2)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::DateValueRangeProcessor::DateValueRangeProcessor",1,"Xapian::valueno");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DateValueRangeProcessor::DateValueRangeProcessor",2,"std::string const &");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = (Xapian::DateValueRangeProcessor *)new Xapian::DateValueRangeProcessor(arg1,(std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DateValueRangeProcessor,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DateValueRangeProcessor(lua_State* L) {
  int argc;
  int argv[6]={
    1,2,3,4,5,6
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_DateValueRangeProcessor__SWIG_2(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isboolean(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_DateValueRangeProcessor__SWIG_1(L);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_DateValueRangeProcessor__SWIG_6(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isboolean(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_DateValueRangeProcessor__SWIG_0(L);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isboolean(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_DateValueRangeProcessor__SWIG_5(L);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isboolean(L,argv[2]);
        }
        if (_v) {
          {
            _v = lua_isboolean(L,argv[3]);
          }
          if (_v) {
            return _wrap_new_DateValueRangeProcessor__SWIG_4(L);
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isboolean(L,argv[2]);
        }
        if (_v) {
          {
            _v = lua_isboolean(L,argv[3]);
          }
          if (_v) {
            {
              _v = lua_isnumber(L,argv[4]);
            }
            if (_v) {
              return _wrap_new_DateValueRangeProcessor__SWIG_3(L);
            }
          }
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_DateValueRangeProcessor'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::DateValueRangeProcessor::DateValueRangeProcessor(Xapian::valueno,bool,int)\n"
    "    Xapian::DateValueRangeProcessor::DateValueRangeProcessor(Xapian::valueno,bool)\n"
    "    Xapian::DateValueRangeProcessor::DateValueRangeProcessor(Xapian::valueno)\n"
    "    Xapian::DateValueRangeProcessor::DateValueRangeProcessor(Xapian::valueno,std::string const &,bool,bool,int)\n"
    "    Xapian::DateValueRangeProcessor::DateValueRangeProcessor(Xapian::valueno,std::string const &,bool,bool)\n"
    "    Xapian::DateValueRangeProcessor::DateValueRangeProcessor(Xapian::valueno,std::string const &,bool)\n"
    "    Xapian::DateValueRangeProcessor::DateValueRangeProcessor(Xapian::valueno,std::string const &)\n");
  lua_error(L);return 0;
}


static int _wrap_DateValueRangeProcessor___call(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::DateValueRangeProcessor *arg1 = (Xapian::DateValueRangeProcessor *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  Xapian::valueno result;
  
  SWIG_check_num_args("Xapian::DateValueRangeProcessor::operator ()",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::DateValueRangeProcessor::operator ()",1,"Xapian::DateValueRangeProcessor *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::DateValueRangeProcessor::operator ()",2,"std::string &");
  if(!lua_isuserdata(L,3)) SWIG_fail_arg("Xapian::DateValueRangeProcessor::operator ()",3,"std::string &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__DateValueRangeProcessor,0))){
    SWIG_fail_ptr("DateValueRangeProcessor___call",1,SWIGTYPE_p_Xapian__DateValueRangeProcessor);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_std__string,0))){
    SWIG_fail_ptr("DateValueRangeProcessor___call",2,SWIGTYPE_p_std__string);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_std__string,0))){
    SWIG_fail_ptr("DateValueRangeProcessor___call",3,SWIGTYPE_p_std__string);
  }
  
  {
    try {
      result = (Xapian::valueno)(arg1)->operator ()(*arg2,*arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_DateValueRangeProcessor(void *obj) {
Xapian::DateValueRangeProcessor *arg1 = (Xapian::DateValueRangeProcessor *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_DateValueRangeProcessor_methods[] = {
    {"__call", _wrap_DateValueRangeProcessor___call}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_DateValueRangeProcessor_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_DateValueRangeProcessor_bases[] = {0,0};
static const char *swig_Xapian_DateValueRangeProcessor_base_names[] = {"Xapian::StringValueRangeProcessor *",0};
static swig_lua_class _wrap_class_Xapian_DateValueRangeProcessor = { "DateValueRangeProcessor", &SWIGTYPE_p_Xapian__DateValueRangeProcessor,_wrap_new_DateValueRangeProcessor, swig_delete_DateValueRangeProcessor, swig_Xapian_DateValueRangeProcessor_methods, swig_Xapian_DateValueRangeProcessor_attributes, swig_Xapian_DateValueRangeProcessor_bases, swig_Xapian_DateValueRangeProcessor_base_names };

static int _wrap_new_NumberValueRangeProcessor__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  Xapian::NumberValueRangeProcessor *result = 0 ;
  
  SWIG_check_num_args("Xapian::NumberValueRangeProcessor::NumberValueRangeProcessor",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::NumberValueRangeProcessor::NumberValueRangeProcessor",1,"Xapian::valueno");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  {
    try {
      result = (Xapian::NumberValueRangeProcessor *)new Xapian::NumberValueRangeProcessor(arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__NumberValueRangeProcessor,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_NumberValueRangeProcessor__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  bool arg3 ;
  std::string temp2 ;
  Xapian::NumberValueRangeProcessor *result = 0 ;
  
  SWIG_check_num_args("Xapian::NumberValueRangeProcessor::NumberValueRangeProcessor",3,3)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::NumberValueRangeProcessor::NumberValueRangeProcessor",1,"Xapian::valueno");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::NumberValueRangeProcessor::NumberValueRangeProcessor",2,"std::string const &");
  if(!lua_isboolean(L,3)) SWIG_fail_arg("Xapian::NumberValueRangeProcessor::NumberValueRangeProcessor",3,"bool");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (lua_toboolean(L, 3)!=0);
  {
    try {
      result = (Xapian::NumberValueRangeProcessor *)new Xapian::NumberValueRangeProcessor(arg1,(std::string const &)*arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__NumberValueRangeProcessor,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_NumberValueRangeProcessor__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  Xapian::NumberValueRangeProcessor *result = 0 ;
  
  SWIG_check_num_args("Xapian::NumberValueRangeProcessor::NumberValueRangeProcessor",2,2)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::NumberValueRangeProcessor::NumberValueRangeProcessor",1,"Xapian::valueno");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::NumberValueRangeProcessor::NumberValueRangeProcessor",2,"std::string const &");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = (Xapian::NumberValueRangeProcessor *)new Xapian::NumberValueRangeProcessor(arg1,(std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__NumberValueRangeProcessor,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_NumberValueRangeProcessor(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_NumberValueRangeProcessor__SWIG_0(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_NumberValueRangeProcessor__SWIG_2(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isboolean(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_NumberValueRangeProcessor__SWIG_1(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_NumberValueRangeProcessor'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::NumberValueRangeProcessor::NumberValueRangeProcessor(Xapian::valueno)\n"
    "    Xapian::NumberValueRangeProcessor::NumberValueRangeProcessor(Xapian::valueno,std::string const &,bool)\n"
    "    Xapian::NumberValueRangeProcessor::NumberValueRangeProcessor(Xapian::valueno,std::string const &)\n");
  lua_error(L);return 0;
}


static int _wrap_NumberValueRangeProcessor___call(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::NumberValueRangeProcessor *arg1 = (Xapian::NumberValueRangeProcessor *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  Xapian::valueno result;
  
  SWIG_check_num_args("Xapian::NumberValueRangeProcessor::operator ()",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::NumberValueRangeProcessor::operator ()",1,"Xapian::NumberValueRangeProcessor *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::NumberValueRangeProcessor::operator ()",2,"std::string &");
  if(!lua_isuserdata(L,3)) SWIG_fail_arg("Xapian::NumberValueRangeProcessor::operator ()",3,"std::string &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__NumberValueRangeProcessor,0))){
    SWIG_fail_ptr("NumberValueRangeProcessor___call",1,SWIGTYPE_p_Xapian__NumberValueRangeProcessor);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_std__string,0))){
    SWIG_fail_ptr("NumberValueRangeProcessor___call",2,SWIGTYPE_p_std__string);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_std__string,0))){
    SWIG_fail_ptr("NumberValueRangeProcessor___call",3,SWIGTYPE_p_std__string);
  }
  
  {
    try {
      result = (Xapian::valueno)(arg1)->operator ()(*arg2,*arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_NumberValueRangeProcessor(void *obj) {
Xapian::NumberValueRangeProcessor *arg1 = (Xapian::NumberValueRangeProcessor *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_NumberValueRangeProcessor_methods[] = {
    {"__call", _wrap_NumberValueRangeProcessor___call}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_NumberValueRangeProcessor_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_NumberValueRangeProcessor_bases[] = {0,0};
static const char *swig_Xapian_NumberValueRangeProcessor_base_names[] = {"Xapian::StringValueRangeProcessor *",0};
static swig_lua_class _wrap_class_Xapian_NumberValueRangeProcessor = { "NumberValueRangeProcessor", &SWIGTYPE_p_Xapian__NumberValueRangeProcessor,_wrap_new_NumberValueRangeProcessor, swig_delete_NumberValueRangeProcessor, swig_Xapian_NumberValueRangeProcessor_methods, swig_Xapian_NumberValueRangeProcessor_attributes, swig_Xapian_NumberValueRangeProcessor_bases, swig_Xapian_NumberValueRangeProcessor_base_names };

static int _wrap_new_QueryParser(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::QueryParser *result = 0 ;
  
  SWIG_check_num_args("Xapian::QueryParser::QueryParser",0,0)
  {
    try {
      result = (Xapian::QueryParser *)new Xapian::QueryParser();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__QueryParser,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_QueryParser_set_stemmer(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::Stem *arg2 = 0 ;
  
  SWIG_check_num_args("Xapian::QueryParser::set_stemmer",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::QueryParser::set_stemmer",1,"Xapian::QueryParser *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::QueryParser::set_stemmer",2,"Xapian::Stem const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__QueryParser,0))){
    SWIG_fail_ptr("QueryParser_set_stemmer",1,SWIGTYPE_p_Xapian__QueryParser);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__Stem,0))){
    SWIG_fail_ptr("QueryParser_set_stemmer",2,SWIGTYPE_p_Xapian__Stem);
  }
  
  {
    try {
      (arg1)->set_stemmer((Xapian::Stem const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_QueryParser_set_stemming_strategy(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::QueryParser::stem_strategy arg2 ;
  
  SWIG_check_num_args("Xapian::QueryParser::set_stemming_strategy",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::QueryParser::set_stemming_strategy",1,"Xapian::QueryParser *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::QueryParser::set_stemming_strategy",2,"Xapian::QueryParser::stem_strategy");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__QueryParser,0))){
    SWIG_fail_ptr("QueryParser_set_stemming_strategy",1,SWIGTYPE_p_Xapian__QueryParser);
  }
  
  arg2 = (Xapian::QueryParser::stem_strategy)(int)lua_tonumber(L, 2);
  {
    try {
      (arg1)->set_stemming_strategy(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_QueryParser_set_stopper__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::Stopper *arg2 = (Xapian::Stopper *) 0 ;
  
  SWIG_check_num_args("Xapian::QueryParser::set_stopper",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::QueryParser::set_stopper",1,"Xapian::QueryParser *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__QueryParser,0))){
    SWIG_fail_ptr("QueryParser_set_stopper",1,SWIGTYPE_p_Xapian__QueryParser);
  }
  
  {
    if (lua_isfunction(L, 2)) {
      arg2 = new luaStopper(L);
    }
    else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 2, (void**)&arg2, SWIGTYPE_p_Xapian__Stopper, 0))){
        SWIG_fail;
      }
    }
  }
  {
    try {
      (arg1)->set_stopper((Xapian::Stopper const *)arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_QueryParser_set_stopper__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  
  SWIG_check_num_args("Xapian::QueryParser::set_stopper",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::QueryParser::set_stopper",1,"Xapian::QueryParser *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__QueryParser,0))){
    SWIG_fail_ptr("QueryParser_set_stopper",1,SWIGTYPE_p_Xapian__QueryParser);
  }
  
  {
    try {
      (arg1)->set_stopper();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_QueryParser_set_stopper(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__QueryParser, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_QueryParser_set_stopper__SWIG_1(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__QueryParser, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        void *ptr;
        if (lua_isfunction(L, argv[1]) || (SWIG_isptrtype(L, argv[1]) && !SWIG_ConvertPtr(L, argv[1], (void **) &ptr, SWIGTYPE_p_Xapian__Stopper, 0))) {
          _v = 1;
        }
        else {
          _v = 0;
        }
      }
      if (_v) {
        return _wrap_QueryParser_set_stopper__SWIG_0(L);
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'QueryParser_set_stopper'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::QueryParser::set_stopper(Xapian::Stopper const *)\n"
    "    Xapian::QueryParser::set_stopper()\n");
  lua_error(L);return 0;
}


static int _wrap_QueryParser_set_default_op(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::Query::op arg2 ;
  
  SWIG_check_num_args("Xapian::QueryParser::set_default_op",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::QueryParser::set_default_op",1,"Xapian::QueryParser *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::QueryParser::set_default_op",2,"Xapian::Query::op");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__QueryParser,0))){
    SWIG_fail_ptr("QueryParser_set_default_op",1,SWIGTYPE_p_Xapian__QueryParser);
  }
  
  arg2 = (Xapian::Query::op)(int)lua_tonumber(L, 2);
  {
    try {
      (arg1)->set_default_op(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_QueryParser_get_default_op(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::Query::op result;
  
  SWIG_check_num_args("Xapian::QueryParser::get_default_op",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::QueryParser::get_default_op",1,"Xapian::QueryParser const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__QueryParser,0))){
    SWIG_fail_ptr("QueryParser_get_default_op",1,SWIGTYPE_p_Xapian__QueryParser);
  }
  
  {
    try {
      result = (Xapian::Query::op)((Xapian::QueryParser const *)arg1)->get_default_op();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number)(int)(result)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_QueryParser_set_database(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::Database *arg2 = 0 ;
  
  SWIG_check_num_args("Xapian::QueryParser::set_database",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::QueryParser::set_database",1,"Xapian::QueryParser *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::QueryParser::set_database",2,"Xapian::Database const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__QueryParser,0))){
    SWIG_fail_ptr("QueryParser_set_database",1,SWIGTYPE_p_Xapian__QueryParser);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("QueryParser_set_database",2,SWIGTYPE_p_Xapian__Database);
  }
  
  {
    try {
      (arg1)->set_database((Xapian::Database const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_QueryParser_set_max_wildcard_expansion(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::termcount arg2 ;
  
  SWIG_check_num_args("Xapian::QueryParser::set_max_wildcard_expansion",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::QueryParser::set_max_wildcard_expansion",1,"Xapian::QueryParser *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::QueryParser::set_max_wildcard_expansion",2,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__QueryParser,0))){
    SWIG_fail_ptr("QueryParser_set_max_wildcard_expansion",1,SWIGTYPE_p_Xapian__QueryParser);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::termcount)lua_tonumber(L, 2);
  {
    try {
      (arg1)->set_max_wildcard_expansion(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_QueryParser_parse_query__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  unsigned int arg3 ;
  std::string *arg4 = 0 ;
  std::string temp2 ;
  std::string temp4 ;
  Xapian::Query result;
  
  SWIG_check_num_args("Xapian::QueryParser::parse_query",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::QueryParser::parse_query",1,"Xapian::QueryParser *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::QueryParser::parse_query",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::QueryParser::parse_query",3,"unsigned int");
  if(!lua_isstring(L,4)) SWIG_fail_arg("Xapian::QueryParser::parse_query",4,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__QueryParser,0))){
    SWIG_fail_ptr("QueryParser_parse_query",1,SWIGTYPE_p_Xapian__QueryParser);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (unsigned int)lua_tonumber(L, 3);
  temp4.assign(lua_tostring(L,4),lua_rawlen(L,4)); arg4=&temp4;
  {
    try {
      result = (arg1)->parse_query((std::string const &)*arg2,arg3,(std::string const &)*arg4);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::Query * resultptr = new Xapian::Query((const Xapian::Query &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__Query,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_QueryParser_parse_query__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  unsigned int arg3 ;
  std::string temp2 ;
  Xapian::Query result;
  
  SWIG_check_num_args("Xapian::QueryParser::parse_query",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::QueryParser::parse_query",1,"Xapian::QueryParser *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::QueryParser::parse_query",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::QueryParser::parse_query",3,"unsigned int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__QueryParser,0))){
    SWIG_fail_ptr("QueryParser_parse_query",1,SWIGTYPE_p_Xapian__QueryParser);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (unsigned int)lua_tonumber(L, 3);
  {
    try {
      result = (arg1)->parse_query((std::string const &)*arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::Query * resultptr = new Xapian::Query((const Xapian::Query &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__Query,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_QueryParser_parse_query__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  Xapian::Query result;
  
  SWIG_check_num_args("Xapian::QueryParser::parse_query",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::QueryParser::parse_query",1,"Xapian::QueryParser *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::QueryParser::parse_query",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__QueryParser,0))){
    SWIG_fail_ptr("QueryParser_parse_query",1,SWIGTYPE_p_Xapian__QueryParser);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = (arg1)->parse_query((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::Query * resultptr = new Xapian::Query((const Xapian::Query &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__Query,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_QueryParser_parse_query(lua_State* L) {
  int argc;
  int argv[5]={
    1,2,3,4,5
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__QueryParser, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_QueryParser_parse_query__SWIG_2(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__QueryParser, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_QueryParser_parse_query__SWIG_1(L);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__QueryParser, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          {
            _v = lua_isstring(L,argv[3]);
          }
          if (_v) {
            return _wrap_QueryParser_parse_query__SWIG_0(L);
          }
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'QueryParser_parse_query'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::QueryParser::parse_query(std::string const &,unsigned int,std::string const &)\n"
    "    Xapian::QueryParser::parse_query(std::string const &,unsigned int)\n"
    "    Xapian::QueryParser::parse_query(std::string const &)\n");
  lua_error(L);return 0;
}


static int _wrap_QueryParser_add_prefix(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  std::string temp2 ;
  std::string temp3 ;
  
  SWIG_check_num_args("Xapian::QueryParser::add_prefix",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::QueryParser::add_prefix",1,"Xapian::QueryParser *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::QueryParser::add_prefix",2,"std::string const &");
  if(!lua_isstring(L,3)) SWIG_fail_arg("Xapian::QueryParser::add_prefix",3,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__QueryParser,0))){
    SWIG_fail_ptr("QueryParser_add_prefix",1,SWIGTYPE_p_Xapian__QueryParser);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  temp3.assign(lua_tostring(L,3),lua_rawlen(L,3)); arg3=&temp3;
  {
    try {
      (arg1)->add_prefix((std::string const &)*arg2,(std::string const &)*arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_QueryParser_add_boolean_prefix__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  bool arg4 ;
  std::string temp2 ;
  std::string temp3 ;
  
  SWIG_check_num_args("Xapian::QueryParser::add_boolean_prefix",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::QueryParser::add_boolean_prefix",1,"Xapian::QueryParser *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::QueryParser::add_boolean_prefix",2,"std::string const &");
  if(!lua_isstring(L,3)) SWIG_fail_arg("Xapian::QueryParser::add_boolean_prefix",3,"std::string const &");
  if(!lua_isboolean(L,4)) SWIG_fail_arg("Xapian::QueryParser::add_boolean_prefix",4,"bool");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__QueryParser,0))){
    SWIG_fail_ptr("QueryParser_add_boolean_prefix",1,SWIGTYPE_p_Xapian__QueryParser);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  temp3.assign(lua_tostring(L,3),lua_rawlen(L,3)); arg3=&temp3;
  arg4 = (lua_toboolean(L, 4)!=0);
  {
    try {
      (arg1)->add_boolean_prefix((std::string const &)*arg2,(std::string const &)*arg3,arg4);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_QueryParser_add_boolean_prefix__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  std::string temp2 ;
  std::string temp3 ;
  
  SWIG_check_num_args("Xapian::QueryParser::add_boolean_prefix",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::QueryParser::add_boolean_prefix",1,"Xapian::QueryParser *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::QueryParser::add_boolean_prefix",2,"std::string const &");
  if(!lua_isstring(L,3)) SWIG_fail_arg("Xapian::QueryParser::add_boolean_prefix",3,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__QueryParser,0))){
    SWIG_fail_ptr("QueryParser_add_boolean_prefix",1,SWIGTYPE_p_Xapian__QueryParser);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  temp3.assign(lua_tostring(L,3),lua_rawlen(L,3)); arg3=&temp3;
  {
    try {
      (arg1)->add_boolean_prefix((std::string const &)*arg2,(std::string const &)*arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_QueryParser_add_boolean_prefix(lua_State* L) {
  int argc;
  int argv[5]={
    1,2,3,4,5
  };
  
  argc = lua_gettop(L);
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__QueryParser, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isstring(L,argv[2]);
        }
        if (_v) {
          return _wrap_QueryParser_add_boolean_prefix__SWIG_1(L);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__QueryParser, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isstring(L,argv[2]);
        }
        if (_v) {
          {
            _v = lua_isboolean(L,argv[3]);
          }
          if (_v) {
            return _wrap_QueryParser_add_boolean_prefix__SWIG_0(L);
          }
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'QueryParser_add_boolean_prefix'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::QueryParser::add_boolean_prefix(std::string const &,std::string const &,bool)\n"
    "    Xapian::QueryParser::add_boolean_prefix(std::string const &,std::string const &)\n");
  lua_error(L);return 0;
}


static int _wrap_QueryParser_stoplist_begin(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::QueryParser::stoplist_begin",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::QueryParser::stoplist_begin",1,"Xapian::QueryParser const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__QueryParser,0))){
    SWIG_fail_ptr("QueryParser_stoplist_begin",1,SWIGTYPE_p_Xapian__QueryParser);
  }
  
  {
    try {
      result = ((Xapian::QueryParser const *)arg1)->stoplist_begin();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_QueryParser_stoplist_end(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::QueryParser::stoplist_end",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::QueryParser::stoplist_end",1,"Xapian::QueryParser const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__QueryParser,0))){
    SWIG_fail_ptr("QueryParser_stoplist_end",1,SWIGTYPE_p_Xapian__QueryParser);
  }
  
  {
    try {
      result = ((Xapian::QueryParser const *)arg1)->stoplist_end();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_QueryParser_unstem_begin(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::QueryParser::unstem_begin",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::QueryParser::unstem_begin",1,"Xapian::QueryParser const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::QueryParser::unstem_begin",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__QueryParser,0))){
    SWIG_fail_ptr("QueryParser_unstem_begin",1,SWIGTYPE_p_Xapian__QueryParser);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = ((Xapian::QueryParser const *)arg1)->unstem_begin((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_QueryParser_unstem_end(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  Xapian::TermIterator result;
  
  SWIG_check_num_args("Xapian::QueryParser::unstem_end",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::QueryParser::unstem_end",1,"Xapian::QueryParser const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::QueryParser::unstem_end",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__QueryParser,0))){
    SWIG_fail_ptr("QueryParser_unstem_end",1,SWIGTYPE_p_Xapian__QueryParser);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = ((Xapian::QueryParser const *)arg1)->unstem_end((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::TermIterator * resultptr = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__TermIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_QueryParser_add_valuerangeprocessor(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::ValueRangeProcessor *arg2 = (Xapian::ValueRangeProcessor *) 0 ;
  
  SWIG_check_num_args("Xapian::QueryParser::add_valuerangeprocessor",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::QueryParser::add_valuerangeprocessor",1,"Xapian::QueryParser *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__QueryParser,0))){
    SWIG_fail_ptr("QueryParser_add_valuerangeprocessor",1,SWIGTYPE_p_Xapian__QueryParser);
  }
  
  {
    if (lua_isfunction(L, 2)) {
      arg2 = new luaValueRangeProcessor(L);
    }
    else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 2, (void**)&arg2, SWIGTYPE_p_Xapian__ValueRangeProcessor, 0))){
        SWIG_fail;
      }
    }
  }
  {
    try {
      (arg1)->add_valuerangeprocessor(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_QueryParser_get_corrected_query_string(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::QueryParser::get_corrected_query_string",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::QueryParser::get_corrected_query_string",1,"Xapian::QueryParser const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__QueryParser,0))){
    SWIG_fail_ptr("QueryParser_get_corrected_query_string",1,SWIGTYPE_p_Xapian__QueryParser);
  }
  
  {
    try {
      result = ((Xapian::QueryParser const *)arg1)->get_corrected_query_string();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_QueryParser___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::QueryParser::get_description",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::QueryParser::get_description",1,"Xapian::QueryParser const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__QueryParser,0))){
    SWIG_fail_ptr("QueryParser___tostring",1,SWIGTYPE_p_Xapian__QueryParser);
  }
  
  {
    try {
      result = ((Xapian::QueryParser const *)arg1)->get_description();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_QueryParser_stoplist(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::pair< Xapian::TermIterator,Xapian::TermIterator > result;
  
  SWIG_check_num_args("Xapian::QueryParser::stoplist",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::QueryParser::stoplist",1,"Xapian::QueryParser *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__QueryParser,0))){
    SWIG_fail_ptr("QueryParser_stoplist",1,SWIGTYPE_p_Xapian__QueryParser);
  }
  
  result = Xapian_QueryParser_stoplist(arg1);
  {
    lua_getglobal(L, "xapian");
    lua_pushstring(L, "Iterator");
    lua_gettable(L, -2);
    lua_remove(L, -2);
    
    if (!lua_isfunction(L, -1)) {
      luaL_typerror(L, -1, "function");
    }
    
    Xapian::TermIterator * begin = new Xapian::TermIterator((const Xapian::TermIterator &)(&result)->first);
    SWIG_NewPointerObj(L, (void *) begin, SWIGTYPE_p_Xapian__TermIterator, 1);
    
    Xapian::TermIterator * end = new Xapian::TermIterator((const Xapian::TermIterator &)(&result)->second);
    SWIG_NewPointerObj(L, (void *) end, SWIGTYPE_p_Xapian__TermIterator, 1);
    
    if (lua_pcall(L, 2, 1, 0) != 0) {
      luaL_error(L, "error running function: %s", lua_tostring(L, -1));
    }
    
    SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_QueryParser(void *obj) {
Xapian::QueryParser *arg1 = (Xapian::QueryParser *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_QueryParser_methods[] = {
    {"set_stemmer", _wrap_QueryParser_set_stemmer}, 
    {"set_stemming_strategy", _wrap_QueryParser_set_stemming_strategy}, 
    {"set_stopper", _wrap_QueryParser_set_stopper}, 
    {"set_default_op", _wrap_QueryParser_set_default_op}, 
    {"get_default_op", _wrap_QueryParser_get_default_op}, 
    {"set_database", _wrap_QueryParser_set_database}, 
    {"set_max_wildcard_expansion", _wrap_QueryParser_set_max_wildcard_expansion}, 
    {"parse_query", _wrap_QueryParser_parse_query}, 
    {"add_prefix", _wrap_QueryParser_add_prefix}, 
    {"add_boolean_prefix", _wrap_QueryParser_add_boolean_prefix}, 
    {"stoplist_begin", _wrap_QueryParser_stoplist_begin}, 
    {"stoplist_end", _wrap_QueryParser_stoplist_end}, 
    {"unstem_begin", _wrap_QueryParser_unstem_begin}, 
    {"unstem_end", _wrap_QueryParser_unstem_end}, 
    {"add_valuerangeprocessor", _wrap_QueryParser_add_valuerangeprocessor}, 
    {"get_corrected_query_string", _wrap_QueryParser_get_corrected_query_string}, 
    {"__tostring", _wrap_QueryParser___tostring}, 
    {"stoplist", _wrap_QueryParser_stoplist}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_QueryParser_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_QueryParser_bases[] = {0};
static const char *swig_Xapian_QueryParser_base_names[] = {0};
static swig_lua_class _wrap_class_Xapian_QueryParser = { "QueryParser", &SWIGTYPE_p_Xapian__QueryParser,_wrap_new_QueryParser, swig_delete_QueryParser, swig_Xapian_QueryParser_methods, swig_Xapian_QueryParser_attributes, swig_Xapian_QueryParser_bases, swig_Xapian_QueryParser_base_names };

static int _wrap_sortable_serialise(lua_State* L) {
  int SWIG_arg = 0;
  double arg1 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::sortable_serialise",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::sortable_serialise",1,"double");
  arg1 = (double)lua_tonumber(L, 1);
  {
    try {
      result = Xapian::sortable_serialise(arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_sortable_unserialise(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string temp1 ;
  double result;
  
  SWIG_check_num_args("Xapian::sortable_unserialise",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::sortable_unserialise",1,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  {
    try {
      result = (double)Xapian::sortable_unserialise((std::string const &)*arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_Stem__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string temp1 ;
  Xapian::Stem *result = 0 ;
  
  SWIG_check_num_args("Xapian::Stem::Stem",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::Stem::Stem",1,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  {
    try {
      result = (Xapian::Stem *)new Xapian::Stem((std::string const &)*arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__Stem,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_Stem__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::StemImplementation *arg1 = (Xapian::StemImplementation *) 0 ;
  Xapian::Stem *result = 0 ;
  
  SWIG_check_num_args("Xapian::Stem::Stem",1,1)
  {
    if (lua_isfunction(L, 1)) {
      arg1 = new luaStemImplementation(L);
    }
    else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 1, (void**)&arg1, SWIGTYPE_p_Xapian__StemImplementation, 0))){
        SWIG_fail;
      }
    }
  }
  {
    try {
      result = (Xapian::Stem *)new Xapian::Stem(arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__Stem,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_Stem(lua_State* L) {
  int argc;
  int argv[2]={
    1,2
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (lua_isfunction(L, argv[0]) || (SWIG_isptrtype(L, argv[0]) && !SWIG_ConvertPtr(L, argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__StemImplementation, 0))) {
        _v = 1;
      }
      else {
        _v = 0;
      }
    }
    if (_v) {
      return _wrap_new_Stem__SWIG_1(L);
    }
  }
  if (argc == 1) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_Stem__SWIG_0(L);
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_Stem'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Stem::Stem(std::string const &)\n"
    "    Xapian::Stem::Stem(Xapian::StemImplementation *)\n");
  lua_error(L);return 0;
}


static int _wrap_Stem___call(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Stem *arg1 = (Xapian::Stem *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::Stem::operator ()",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Stem::operator ()",1,"Xapian::Stem const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Stem::operator ()",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Stem,0))){
    SWIG_fail_ptr("Stem___call",1,SWIGTYPE_p_Xapian__Stem);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = ((Xapian::Stem const *)arg1)->operator ()((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Stem___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Stem *arg1 = (Xapian::Stem *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::Stem::get_description",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Stem::get_description",1,"Xapian::Stem const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Stem,0))){
    SWIG_fail_ptr("Stem___tostring",1,SWIGTYPE_p_Xapian__Stem);
  }
  
  {
    try {
      result = ((Xapian::Stem const *)arg1)->get_description();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Stem_get_available_languages(lua_State* L) {
  int SWIG_arg = 0;
  std::string result;
  
  SWIG_check_num_args("Xapian::Stem::get_available_languages",0,0)
  {
    try {
      result = Xapian::Stem::get_available_languages();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_Stem(void *obj) {
Xapian::Stem *arg1 = (Xapian::Stem *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_Stem_methods[] = {
    {"__call", _wrap_Stem___call}, 
    {"__tostring", _wrap_Stem___tostring}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_Stem_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_Stem_bases[] = {0};
static const char *swig_Xapian_Stem_base_names[] = {0};
static swig_lua_class _wrap_class_Xapian_Stem = { "Stem", &SWIGTYPE_p_Xapian__Stem,_wrap_new_Stem, swig_delete_Stem, swig_Xapian_Stem_methods, swig_Xapian_Stem_attributes, swig_Xapian_Stem_bases, swig_Xapian_Stem_base_names };

static int _wrap_new_TermGenerator(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermGenerator *result = 0 ;
  
  SWIG_check_num_args("Xapian::TermGenerator::TermGenerator",0,0)
  {
    try {
      result = (Xapian::TermGenerator *)new Xapian::TermGenerator();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__TermGenerator,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TermGenerator_set_stemmer(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  Xapian::Stem *arg2 = 0 ;
  
  SWIG_check_num_args("Xapian::TermGenerator::set_stemmer",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TermGenerator::set_stemmer",1,"Xapian::TermGenerator *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::TermGenerator::set_stemmer",2,"Xapian::Stem const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermGenerator,0))){
    SWIG_fail_ptr("TermGenerator_set_stemmer",1,SWIGTYPE_p_Xapian__TermGenerator);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__Stem,0))){
    SWIG_fail_ptr("TermGenerator_set_stemmer",2,SWIGTYPE_p_Xapian__Stem);
  }
  
  {
    try {
      (arg1)->set_stemmer((Xapian::Stem const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TermGenerator_set_stopper__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  Xapian::Stopper *arg2 = (Xapian::Stopper *) 0 ;
  
  SWIG_check_num_args("Xapian::TermGenerator::set_stopper",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TermGenerator::set_stopper",1,"Xapian::TermGenerator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermGenerator,0))){
    SWIG_fail_ptr("TermGenerator_set_stopper",1,SWIGTYPE_p_Xapian__TermGenerator);
  }
  
  {
    if (lua_isfunction(L, 2)) {
      arg2 = new luaStopper(L);
    }
    else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 2, (void**)&arg2, SWIGTYPE_p_Xapian__Stopper, 0))){
        SWIG_fail;
      }
    }
  }
  {
    try {
      (arg1)->set_stopper((Xapian::Stopper const *)arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TermGenerator_set_stopper__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  
  SWIG_check_num_args("Xapian::TermGenerator::set_stopper",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TermGenerator::set_stopper",1,"Xapian::TermGenerator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermGenerator,0))){
    SWIG_fail_ptr("TermGenerator_set_stopper",1,SWIGTYPE_p_Xapian__TermGenerator);
  }
  
  {
    try {
      (arg1)->set_stopper();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TermGenerator_set_stopper(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__TermGenerator, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_TermGenerator_set_stopper__SWIG_1(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__TermGenerator, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        void *ptr;
        if (lua_isfunction(L, argv[1]) || (SWIG_isptrtype(L, argv[1]) && !SWIG_ConvertPtr(L, argv[1], (void **) &ptr, SWIGTYPE_p_Xapian__Stopper, 0))) {
          _v = 1;
        }
        else {
          _v = 0;
        }
      }
      if (_v) {
        return _wrap_TermGenerator_set_stopper__SWIG_0(L);
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'TermGenerator_set_stopper'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::TermGenerator::set_stopper(Xapian::Stopper const *)\n"
    "    Xapian::TermGenerator::set_stopper()\n");
  lua_error(L);return 0;
}


static int _wrap_TermGenerator_set_document(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  Xapian::Document *arg2 = 0 ;
  
  SWIG_check_num_args("Xapian::TermGenerator::set_document",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TermGenerator::set_document",1,"Xapian::TermGenerator *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::TermGenerator::set_document",2,"Xapian::Document const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermGenerator,0))){
    SWIG_fail_ptr("TermGenerator_set_document",1,SWIGTYPE_p_Xapian__TermGenerator);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("TermGenerator_set_document",2,SWIGTYPE_p_Xapian__Document);
  }
  
  {
    try {
      (arg1)->set_document((Xapian::Document const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TermGenerator_get_document(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  Xapian::Document *result = 0 ;
  
  SWIG_check_num_args("Xapian::TermGenerator::get_document",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TermGenerator::get_document",1,"Xapian::TermGenerator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermGenerator,0))){
    SWIG_fail_ptr("TermGenerator_get_document",1,SWIGTYPE_p_Xapian__TermGenerator);
  }
  
  {
    try {
      result = (Xapian::Document *) &((Xapian::TermGenerator const *)arg1)->get_document();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__Document,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TermGenerator_set_database(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  Xapian::WritableDatabase *arg2 = 0 ;
  
  SWIG_check_num_args("Xapian::TermGenerator::set_database",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TermGenerator::set_database",1,"Xapian::TermGenerator *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::TermGenerator::set_database",2,"Xapian::WritableDatabase const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermGenerator,0))){
    SWIG_fail_ptr("TermGenerator_set_database",1,SWIGTYPE_p_Xapian__TermGenerator);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__WritableDatabase,0))){
    SWIG_fail_ptr("TermGenerator_set_database",2,SWIGTYPE_p_Xapian__WritableDatabase);
  }
  
  {
    try {
      (arg1)->set_database((Xapian::WritableDatabase const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TermGenerator_set_flags__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  Xapian::TermGenerator::flags arg2 ;
  Xapian::TermGenerator::flags arg3 ;
  Xapian::TermGenerator::flags result;
  
  SWIG_check_num_args("Xapian::TermGenerator::set_flags",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TermGenerator::set_flags",1,"Xapian::TermGenerator *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::TermGenerator::set_flags",2,"Xapian::TermGenerator::flags");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::TermGenerator::set_flags",3,"Xapian::TermGenerator::flags");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermGenerator,0))){
    SWIG_fail_ptr("TermGenerator_set_flags",1,SWIGTYPE_p_Xapian__TermGenerator);
  }
  
  arg2 = (Xapian::TermGenerator::flags)(int)lua_tonumber(L, 2);
  arg3 = (Xapian::TermGenerator::flags)(int)lua_tonumber(L, 3);
  {
    try {
      result = (Xapian::TermGenerator::flags)(arg1)->set_flags(arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number)(int)(result)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TermGenerator_set_flags__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  Xapian::TermGenerator::flags arg2 ;
  Xapian::TermGenerator::flags result;
  
  SWIG_check_num_args("Xapian::TermGenerator::set_flags",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TermGenerator::set_flags",1,"Xapian::TermGenerator *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::TermGenerator::set_flags",2,"Xapian::TermGenerator::flags");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermGenerator,0))){
    SWIG_fail_ptr("TermGenerator_set_flags",1,SWIGTYPE_p_Xapian__TermGenerator);
  }
  
  arg2 = (Xapian::TermGenerator::flags)(int)lua_tonumber(L, 2);
  {
    try {
      result = (Xapian::TermGenerator::flags)(arg1)->set_flags(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number)(int)(result)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TermGenerator_set_flags(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__TermGenerator, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_TermGenerator_set_flags__SWIG_1(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__TermGenerator, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_TermGenerator_set_flags__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'TermGenerator_set_flags'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::TermGenerator::set_flags(Xapian::TermGenerator::flags,Xapian::TermGenerator::flags)\n"
    "    Xapian::TermGenerator::set_flags(Xapian::TermGenerator::flags)\n");
  lua_error(L);return 0;
}


static int _wrap_TermGenerator_set_stemming_strategy(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  Xapian::TermGenerator::stem_strategy arg2 ;
  
  SWIG_check_num_args("Xapian::TermGenerator::set_stemming_strategy",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TermGenerator::set_stemming_strategy",1,"Xapian::TermGenerator *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::TermGenerator::set_stemming_strategy",2,"Xapian::TermGenerator::stem_strategy");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermGenerator,0))){
    SWIG_fail_ptr("TermGenerator_set_stemming_strategy",1,SWIGTYPE_p_Xapian__TermGenerator);
  }
  
  arg2 = (Xapian::TermGenerator::stem_strategy)(int)lua_tonumber(L, 2);
  {
    try {
      (arg1)->set_stemming_strategy(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TermGenerator_set_max_word_length(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  unsigned int arg2 ;
  
  SWIG_check_num_args("Xapian::TermGenerator::set_max_word_length",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TermGenerator::set_max_word_length",1,"Xapian::TermGenerator *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::TermGenerator::set_max_word_length",2,"unsigned int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermGenerator,0))){
    SWIG_fail_ptr("TermGenerator_set_max_word_length",1,SWIGTYPE_p_Xapian__TermGenerator);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (unsigned int)lua_tonumber(L, 2);
  {
    try {
      (arg1)->set_max_word_length(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TermGenerator_index_text__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termcount arg3 ;
  std::string *arg4 = 0 ;
  std::string temp2 ;
  std::string temp4 ;
  
  SWIG_check_num_args("Xapian::TermGenerator::index_text",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TermGenerator::index_text",1,"Xapian::TermGenerator *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::TermGenerator::index_text",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::TermGenerator::index_text",3,"Xapian::termcount");
  if(!lua_isstring(L,4)) SWIG_fail_arg("Xapian::TermGenerator::index_text",4,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermGenerator,0))){
    SWIG_fail_ptr("TermGenerator_index_text",1,SWIGTYPE_p_Xapian__TermGenerator);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::termcount)lua_tonumber(L, 3);
  temp4.assign(lua_tostring(L,4),lua_rawlen(L,4)); arg4=&temp4;
  {
    try {
      (arg1)->index_text((std::string const &)*arg2,arg3,(std::string const &)*arg4);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TermGenerator_index_text__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termcount arg3 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::TermGenerator::index_text",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TermGenerator::index_text",1,"Xapian::TermGenerator *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::TermGenerator::index_text",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::TermGenerator::index_text",3,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermGenerator,0))){
    SWIG_fail_ptr("TermGenerator_index_text",1,SWIGTYPE_p_Xapian__TermGenerator);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::termcount)lua_tonumber(L, 3);
  {
    try {
      (arg1)->index_text((std::string const &)*arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TermGenerator_index_text__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::TermGenerator::index_text",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TermGenerator::index_text",1,"Xapian::TermGenerator *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::TermGenerator::index_text",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermGenerator,0))){
    SWIG_fail_ptr("TermGenerator_index_text",1,SWIGTYPE_p_Xapian__TermGenerator);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      (arg1)->index_text((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TermGenerator_index_text(lua_State* L) {
  int argc;
  int argv[5]={
    1,2,3,4,5
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__TermGenerator, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_TermGenerator_index_text__SWIG_2(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__TermGenerator, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_TermGenerator_index_text__SWIG_1(L);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__TermGenerator, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          {
            _v = lua_isstring(L,argv[3]);
          }
          if (_v) {
            return _wrap_TermGenerator_index_text__SWIG_0(L);
          }
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'TermGenerator_index_text'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::TermGenerator::index_text(std::string const &,Xapian::termcount,std::string const &)\n"
    "    Xapian::TermGenerator::index_text(std::string const &,Xapian::termcount)\n"
    "    Xapian::TermGenerator::index_text(std::string const &)\n");
  lua_error(L);return 0;
}


static int _wrap_TermGenerator_index_text_without_positions__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termcount arg3 ;
  std::string *arg4 = 0 ;
  std::string temp2 ;
  std::string temp4 ;
  
  SWIG_check_num_args("Xapian::TermGenerator::index_text_without_positions",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TermGenerator::index_text_without_positions",1,"Xapian::TermGenerator *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::TermGenerator::index_text_without_positions",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::TermGenerator::index_text_without_positions",3,"Xapian::termcount");
  if(!lua_isstring(L,4)) SWIG_fail_arg("Xapian::TermGenerator::index_text_without_positions",4,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermGenerator,0))){
    SWIG_fail_ptr("TermGenerator_index_text_without_positions",1,SWIGTYPE_p_Xapian__TermGenerator);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::termcount)lua_tonumber(L, 3);
  temp4.assign(lua_tostring(L,4),lua_rawlen(L,4)); arg4=&temp4;
  {
    try {
      (arg1)->index_text_without_positions((std::string const &)*arg2,arg3,(std::string const &)*arg4);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TermGenerator_index_text_without_positions__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termcount arg3 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::TermGenerator::index_text_without_positions",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TermGenerator::index_text_without_positions",1,"Xapian::TermGenerator *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::TermGenerator::index_text_without_positions",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::TermGenerator::index_text_without_positions",3,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermGenerator,0))){
    SWIG_fail_ptr("TermGenerator_index_text_without_positions",1,SWIGTYPE_p_Xapian__TermGenerator);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::termcount)lua_tonumber(L, 3);
  {
    try {
      (arg1)->index_text_without_positions((std::string const &)*arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TermGenerator_index_text_without_positions__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::TermGenerator::index_text_without_positions",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TermGenerator::index_text_without_positions",1,"Xapian::TermGenerator *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::TermGenerator::index_text_without_positions",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermGenerator,0))){
    SWIG_fail_ptr("TermGenerator_index_text_without_positions",1,SWIGTYPE_p_Xapian__TermGenerator);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      (arg1)->index_text_without_positions((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TermGenerator_index_text_without_positions(lua_State* L) {
  int argc;
  int argv[5]={
    1,2,3,4,5
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__TermGenerator, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_TermGenerator_index_text_without_positions__SWIG_2(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__TermGenerator, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_TermGenerator_index_text_without_positions__SWIG_1(L);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__TermGenerator, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          {
            _v = lua_isstring(L,argv[3]);
          }
          if (_v) {
            return _wrap_TermGenerator_index_text_without_positions__SWIG_0(L);
          }
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'TermGenerator_index_text_without_positions'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::TermGenerator::index_text_without_positions(std::string const &,Xapian::termcount,std::string const &)\n"
    "    Xapian::TermGenerator::index_text_without_positions(std::string const &,Xapian::termcount)\n"
    "    Xapian::TermGenerator::index_text_without_positions(std::string const &)\n");
  lua_error(L);return 0;
}


static int _wrap_TermGenerator_increase_termpos__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  Xapian::termcount arg2 ;
  
  SWIG_check_num_args("Xapian::TermGenerator::increase_termpos",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TermGenerator::increase_termpos",1,"Xapian::TermGenerator *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::TermGenerator::increase_termpos",2,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermGenerator,0))){
    SWIG_fail_ptr("TermGenerator_increase_termpos",1,SWIGTYPE_p_Xapian__TermGenerator);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::termcount)lua_tonumber(L, 2);
  {
    try {
      (arg1)->increase_termpos(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TermGenerator_increase_termpos__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  
  SWIG_check_num_args("Xapian::TermGenerator::increase_termpos",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TermGenerator::increase_termpos",1,"Xapian::TermGenerator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermGenerator,0))){
    SWIG_fail_ptr("TermGenerator_increase_termpos",1,SWIGTYPE_p_Xapian__TermGenerator);
  }
  
  {
    try {
      (arg1)->increase_termpos();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TermGenerator_increase_termpos(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__TermGenerator, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_TermGenerator_increase_termpos__SWIG_1(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__TermGenerator, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_TermGenerator_increase_termpos__SWIG_0(L);
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'TermGenerator_increase_termpos'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::TermGenerator::increase_termpos(Xapian::termcount)\n"
    "    Xapian::TermGenerator::increase_termpos()\n");
  lua_error(L);return 0;
}


static int _wrap_TermGenerator_get_termpos(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  Xapian::termcount result;
  
  SWIG_check_num_args("Xapian::TermGenerator::get_termpos",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TermGenerator::get_termpos",1,"Xapian::TermGenerator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermGenerator,0))){
    SWIG_fail_ptr("TermGenerator_get_termpos",1,SWIGTYPE_p_Xapian__TermGenerator);
  }
  
  {
    try {
      result = (Xapian::termcount)((Xapian::TermGenerator const *)arg1)->get_termpos();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TermGenerator_set_termpos(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  Xapian::termcount arg2 ;
  
  SWIG_check_num_args("Xapian::TermGenerator::set_termpos",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TermGenerator::set_termpos",1,"Xapian::TermGenerator *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::TermGenerator::set_termpos",2,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermGenerator,0))){
    SWIG_fail_ptr("TermGenerator_set_termpos",1,SWIGTYPE_p_Xapian__TermGenerator);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::termcount)lua_tonumber(L, 2);
  {
    try {
      (arg1)->set_termpos(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_TermGenerator___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::TermGenerator::get_description",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TermGenerator::get_description",1,"Xapian::TermGenerator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermGenerator,0))){
    SWIG_fail_ptr("TermGenerator___tostring",1,SWIGTYPE_p_Xapian__TermGenerator);
  }
  
  {
    try {
      result = ((Xapian::TermGenerator const *)arg1)->get_description();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_TermGenerator(void *obj) {
Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_TermGenerator_methods[] = {
    {"set_stemmer", _wrap_TermGenerator_set_stemmer}, 
    {"set_stopper", _wrap_TermGenerator_set_stopper}, 
    {"set_document", _wrap_TermGenerator_set_document}, 
    {"get_document", _wrap_TermGenerator_get_document}, 
    {"set_database", _wrap_TermGenerator_set_database}, 
    {"set_flags", _wrap_TermGenerator_set_flags}, 
    {"set_stemming_strategy", _wrap_TermGenerator_set_stemming_strategy}, 
    {"set_max_word_length", _wrap_TermGenerator_set_max_word_length}, 
    {"index_text", _wrap_TermGenerator_index_text}, 
    {"index_text_without_positions", _wrap_TermGenerator_index_text_without_positions}, 
    {"increase_termpos", _wrap_TermGenerator_increase_termpos}, 
    {"get_termpos", _wrap_TermGenerator_get_termpos}, 
    {"set_termpos", _wrap_TermGenerator_set_termpos}, 
    {"__tostring", _wrap_TermGenerator___tostring}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_TermGenerator_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_TermGenerator_bases[] = {0};
static const char *swig_Xapian_TermGenerator_base_names[] = {0};
static swig_lua_class _wrap_class_Xapian_TermGenerator = { "TermGenerator", &SWIGTYPE_p_Xapian__TermGenerator,_wrap_new_TermGenerator, swig_delete_TermGenerator, swig_Xapian_TermGenerator_methods, swig_Xapian_TermGenerator_attributes, swig_Xapian_TermGenerator_bases, swig_Xapian_TermGenerator_base_names };

static int _wrap_KeyMaker___call(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::KeyMaker *arg1 = (Xapian::KeyMaker *) 0 ;
  Xapian::Document *arg2 = 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::KeyMaker::operator ()",2,2)
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::KeyMaker::operator ()",2,"Xapian::Document const &");
  {
    if (lua_isfunction(L, 1)) {
      arg1 = new luaKeyMaker(L);
    }
    else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 1, (void**)&arg1, SWIGTYPE_p_Xapian__KeyMaker, 0))){
        SWIG_fail;
      }
    }
  }
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("KeyMaker___call",2,SWIGTYPE_p_Xapian__Document);
  }
  
  {
    try {
      result = ((Xapian::KeyMaker const *)arg1)->operator ()((Xapian::Document const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_KeyMaker(void *obj) {
Xapian::KeyMaker *arg1 = (Xapian::KeyMaker *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_KeyMaker_methods[] = {
    {"__call", _wrap_KeyMaker___call}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_KeyMaker_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_KeyMaker_bases[] = {0};
static const char *swig_Xapian_KeyMaker_base_names[] = {0};
static swig_lua_class _wrap_class_Xapian_KeyMaker = { "KeyMaker", &SWIGTYPE_p_Xapian__KeyMaker,0, swig_delete_KeyMaker, swig_Xapian_KeyMaker_methods, swig_Xapian_KeyMaker_attributes, swig_Xapian_KeyMaker_bases, swig_Xapian_KeyMaker_base_names };

static int _wrap_new_MultiValueKeyMaker(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MultiValueKeyMaker *result = 0 ;
  
  SWIG_check_num_args("Xapian::MultiValueKeyMaker::MultiValueKeyMaker",0,0)
  {
    try {
      result = (Xapian::MultiValueKeyMaker *)new Xapian::MultiValueKeyMaker();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__MultiValueKeyMaker,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MultiValueKeyMaker___call(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MultiValueKeyMaker *arg1 = (Xapian::MultiValueKeyMaker *) 0 ;
  Xapian::Document *arg2 = 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::MultiValueKeyMaker::operator ()",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MultiValueKeyMaker::operator ()",1,"Xapian::MultiValueKeyMaker const *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::MultiValueKeyMaker::operator ()",2,"Xapian::Document const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MultiValueKeyMaker,0))){
    SWIG_fail_ptr("MultiValueKeyMaker___call",1,SWIGTYPE_p_Xapian__MultiValueKeyMaker);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("MultiValueKeyMaker___call",2,SWIGTYPE_p_Xapian__Document);
  }
  
  {
    try {
      result = ((Xapian::MultiValueKeyMaker const *)arg1)->operator ()((Xapian::Document const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MultiValueKeyMaker_add_value__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MultiValueKeyMaker *arg1 = (Xapian::MultiValueKeyMaker *) 0 ;
  Xapian::valueno arg2 ;
  bool arg3 ;
  
  SWIG_check_num_args("Xapian::MultiValueKeyMaker::add_value",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MultiValueKeyMaker::add_value",1,"Xapian::MultiValueKeyMaker *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::MultiValueKeyMaker::add_value",2,"Xapian::valueno");
  if(!lua_isboolean(L,3)) SWIG_fail_arg("Xapian::MultiValueKeyMaker::add_value",3,"bool");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MultiValueKeyMaker,0))){
    SWIG_fail_ptr("MultiValueKeyMaker_add_value",1,SWIGTYPE_p_Xapian__MultiValueKeyMaker);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::valueno)lua_tonumber(L, 2);
  arg3 = (lua_toboolean(L, 3)!=0);
  {
    try {
      (arg1)->add_value(arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MultiValueKeyMaker_add_value__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MultiValueKeyMaker *arg1 = (Xapian::MultiValueKeyMaker *) 0 ;
  Xapian::valueno arg2 ;
  
  SWIG_check_num_args("Xapian::MultiValueKeyMaker::add_value",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MultiValueKeyMaker::add_value",1,"Xapian::MultiValueKeyMaker *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::MultiValueKeyMaker::add_value",2,"Xapian::valueno");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MultiValueKeyMaker,0))){
    SWIG_fail_ptr("MultiValueKeyMaker_add_value",1,SWIGTYPE_p_Xapian__MultiValueKeyMaker);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::valueno)lua_tonumber(L, 2);
  {
    try {
      (arg1)->add_value(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MultiValueKeyMaker_add_value(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__MultiValueKeyMaker, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_MultiValueKeyMaker_add_value__SWIG_1(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__MultiValueKeyMaker, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isboolean(L,argv[2]);
        }
        if (_v) {
          return _wrap_MultiValueKeyMaker_add_value__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'MultiValueKeyMaker_add_value'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::MultiValueKeyMaker::add_value(Xapian::valueno,bool)\n"
    "    Xapian::MultiValueKeyMaker::add_value(Xapian::valueno)\n");
  lua_error(L);return 0;
}


static void swig_delete_MultiValueKeyMaker(void *obj) {
Xapian::MultiValueKeyMaker *arg1 = (Xapian::MultiValueKeyMaker *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_MultiValueKeyMaker_methods[] = {
    {"__call", _wrap_MultiValueKeyMaker___call}, 
    {"add_value", _wrap_MultiValueKeyMaker_add_value}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_MultiValueKeyMaker_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_MultiValueKeyMaker_bases[] = {0,0};
static const char *swig_Xapian_MultiValueKeyMaker_base_names[] = {"Xapian::KeyMaker *",0};
static swig_lua_class _wrap_class_Xapian_MultiValueKeyMaker = { "MultiValueKeyMaker", &SWIGTYPE_p_Xapian__MultiValueKeyMaker,_wrap_new_MultiValueKeyMaker, swig_delete_MultiValueKeyMaker, swig_Xapian_MultiValueKeyMaker_methods, swig_Xapian_MultiValueKeyMaker_attributes, swig_Xapian_MultiValueKeyMaker_bases, swig_Xapian_MultiValueKeyMaker_base_names };

static void swig_delete_Sorter(void *obj) {
Xapian::Sorter *arg1 = (Xapian::Sorter *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_Sorter_methods[] = {
    {0,0}
};
static swig_lua_attribute swig_Xapian_Sorter_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_Sorter_bases[] = {0,0};
static const char *swig_Xapian_Sorter_base_names[] = {"Xapian::KeyMaker *",0};
static swig_lua_class _wrap_class_Xapian_Sorter = { "Sorter", &SWIGTYPE_p_Xapian__Sorter,0, swig_delete_Sorter, swig_Xapian_Sorter_methods, swig_Xapian_Sorter_attributes, swig_Xapian_Sorter_bases, swig_Xapian_Sorter_base_names };

static int _wrap_new_MultiValueSorter(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MultiValueSorter *result = 0 ;
  
  SWIG_check_num_args("Xapian::MultiValueSorter::MultiValueSorter",0,0)
  {
    try {
      result = (Xapian::MultiValueSorter *)new Xapian::MultiValueSorter();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__MultiValueSorter,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MultiValueSorter___call(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MultiValueSorter *arg1 = (Xapian::MultiValueSorter *) 0 ;
  Xapian::Document *arg2 = 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::MultiValueSorter::operator ()",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MultiValueSorter::operator ()",1,"Xapian::MultiValueSorter const *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::MultiValueSorter::operator ()",2,"Xapian::Document const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MultiValueSorter,0))){
    SWIG_fail_ptr("MultiValueSorter___call",1,SWIGTYPE_p_Xapian__MultiValueSorter);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("MultiValueSorter___call",2,SWIGTYPE_p_Xapian__Document);
  }
  
  {
    try {
      result = ((Xapian::MultiValueSorter const *)arg1)->operator ()((Xapian::Document const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MultiValueSorter_add__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MultiValueSorter *arg1 = (Xapian::MultiValueSorter *) 0 ;
  Xapian::valueno arg2 ;
  bool arg3 ;
  
  SWIG_check_num_args("Xapian::MultiValueSorter::add",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MultiValueSorter::add",1,"Xapian::MultiValueSorter *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::MultiValueSorter::add",2,"Xapian::valueno");
  if(!lua_isboolean(L,3)) SWIG_fail_arg("Xapian::MultiValueSorter::add",3,"bool");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MultiValueSorter,0))){
    SWIG_fail_ptr("MultiValueSorter_add",1,SWIGTYPE_p_Xapian__MultiValueSorter);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::valueno)lua_tonumber(L, 2);
  arg3 = (lua_toboolean(L, 3)!=0);
  {
    try {
      (arg1)->add(arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MultiValueSorter_add__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MultiValueSorter *arg1 = (Xapian::MultiValueSorter *) 0 ;
  Xapian::valueno arg2 ;
  
  SWIG_check_num_args("Xapian::MultiValueSorter::add",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MultiValueSorter::add",1,"Xapian::MultiValueSorter *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::MultiValueSorter::add",2,"Xapian::valueno");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MultiValueSorter,0))){
    SWIG_fail_ptr("MultiValueSorter_add",1,SWIGTYPE_p_Xapian__MultiValueSorter);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::valueno)lua_tonumber(L, 2);
  {
    try {
      (arg1)->add(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MultiValueSorter_add(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__MultiValueSorter, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_MultiValueSorter_add__SWIG_1(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Xapian__MultiValueSorter, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isboolean(L,argv[2]);
        }
        if (_v) {
          return _wrap_MultiValueSorter_add__SWIG_0(L);
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'MultiValueSorter_add'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::MultiValueSorter::add(Xapian::valueno,bool)\n"
    "    Xapian::MultiValueSorter::add(Xapian::valueno)\n");
  lua_error(L);return 0;
}


static void swig_delete_MultiValueSorter(void *obj) {
Xapian::MultiValueSorter *arg1 = (Xapian::MultiValueSorter *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_MultiValueSorter_methods[] = {
    {"__call", _wrap_MultiValueSorter___call}, 
    {"add", _wrap_MultiValueSorter_add}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_MultiValueSorter_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_MultiValueSorter_bases[] = {0,0};
static const char *swig_Xapian_MultiValueSorter_base_names[] = {"Xapian::Sorter *",0};
static swig_lua_class _wrap_class_Xapian_MultiValueSorter = { "MultiValueSorter", &SWIGTYPE_p_Xapian__MultiValueSorter,_wrap_new_MultiValueSorter, swig_delete_MultiValueSorter, swig_Xapian_MultiValueSorter_methods, swig_Xapian_MultiValueSorter_attributes, swig_Xapian_MultiValueSorter_bases, swig_Xapian_MultiValueSorter_base_names };

static int _wrap_new_ValueSetMatchDecider(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  bool arg2 ;
  Xapian::ValueSetMatchDecider *result = 0 ;
  
  SWIG_check_num_args("Xapian::ValueSetMatchDecider::ValueSetMatchDecider",2,2)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::ValueSetMatchDecider::ValueSetMatchDecider",1,"Xapian::valueno");
  if(!lua_isboolean(L,2)) SWIG_fail_arg("Xapian::ValueSetMatchDecider::ValueSetMatchDecider",2,"bool");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  arg2 = (lua_toboolean(L, 2)!=0);
  {
    try {
      result = (Xapian::ValueSetMatchDecider *)new Xapian::ValueSetMatchDecider(arg1,arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__ValueSetMatchDecider,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValueSetMatchDecider_add_value(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueSetMatchDecider *arg1 = (Xapian::ValueSetMatchDecider *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::ValueSetMatchDecider::add_value",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueSetMatchDecider::add_value",1,"Xapian::ValueSetMatchDecider *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::ValueSetMatchDecider::add_value",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueSetMatchDecider,0))){
    SWIG_fail_ptr("ValueSetMatchDecider_add_value",1,SWIGTYPE_p_Xapian__ValueSetMatchDecider);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      (arg1)->add_value((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValueSetMatchDecider_remove_value(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueSetMatchDecider *arg1 = (Xapian::ValueSetMatchDecider *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::ValueSetMatchDecider::remove_value",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueSetMatchDecider::remove_value",1,"Xapian::ValueSetMatchDecider *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::ValueSetMatchDecider::remove_value",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueSetMatchDecider,0))){
    SWIG_fail_ptr("ValueSetMatchDecider_remove_value",1,SWIGTYPE_p_Xapian__ValueSetMatchDecider);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      (arg1)->remove_value((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ValueSetMatchDecider___call(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueSetMatchDecider *arg1 = (Xapian::ValueSetMatchDecider *) 0 ;
  Xapian::Document *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("Xapian::ValueSetMatchDecider::operator ()",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ValueSetMatchDecider::operator ()",1,"Xapian::ValueSetMatchDecider const *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::ValueSetMatchDecider::operator ()",2,"Xapian::Document const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueSetMatchDecider,0))){
    SWIG_fail_ptr("ValueSetMatchDecider___call",1,SWIGTYPE_p_Xapian__ValueSetMatchDecider);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("ValueSetMatchDecider___call",2,SWIGTYPE_p_Xapian__Document);
  }
  
  {
    try {
      result = (bool)((Xapian::ValueSetMatchDecider const *)arg1)->operator ()((Xapian::Document const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_ValueSetMatchDecider(void *obj) {
Xapian::ValueSetMatchDecider *arg1 = (Xapian::ValueSetMatchDecider *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_ValueSetMatchDecider_methods[] = {
    {"add_value", _wrap_ValueSetMatchDecider_add_value}, 
    {"remove_value", _wrap_ValueSetMatchDecider_remove_value}, 
    {"__call", _wrap_ValueSetMatchDecider___call}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_ValueSetMatchDecider_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_ValueSetMatchDecider_bases[] = {0,0};
static const char *swig_Xapian_ValueSetMatchDecider_base_names[] = {"Xapian::MatchDecider *",0};
static swig_lua_class _wrap_class_Xapian_ValueSetMatchDecider = { "ValueSetMatchDecider", &SWIGTYPE_p_Xapian__ValueSetMatchDecider,_wrap_new_ValueSetMatchDecider, swig_delete_ValueSetMatchDecider, swig_Xapian_ValueSetMatchDecider_methods, swig_Xapian_ValueSetMatchDecider_attributes, swig_Xapian_ValueSetMatchDecider_bases, swig_Xapian_ValueSetMatchDecider_base_names };

static int _wrap_new_Compactor(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Compactor *result = 0 ;
  
  SWIG_check_num_args("Xapian::Compactor::Compactor",0,0)
  {
    try {
      result = (Xapian::Compactor *)new Xapian::Compactor();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__Compactor,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Compactor_set_block_size(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Compactor *arg1 = (Xapian::Compactor *) 0 ;
  size_t arg2 ;
  
  SWIG_check_num_args("Xapian::Compactor::set_block_size",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Compactor::set_block_size",1,"Xapian::Compactor *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Compactor::set_block_size",2,"size_t");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Compactor,0))){
    SWIG_fail_ptr("Compactor_set_block_size",1,SWIGTYPE_p_Xapian__Compactor);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (size_t)lua_tonumber(L, 2);
  {
    try {
      (arg1)->set_block_size(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Compactor_set_renumber(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Compactor *arg1 = (Xapian::Compactor *) 0 ;
  bool arg2 ;
  
  SWIG_check_num_args("Xapian::Compactor::set_renumber",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Compactor::set_renumber",1,"Xapian::Compactor *");
  if(!lua_isboolean(L,2)) SWIG_fail_arg("Xapian::Compactor::set_renumber",2,"bool");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Compactor,0))){
    SWIG_fail_ptr("Compactor_set_renumber",1,SWIGTYPE_p_Xapian__Compactor);
  }
  
  arg2 = (lua_toboolean(L, 2)!=0);
  {
    try {
      (arg1)->set_renumber(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Compactor_set_multipass(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Compactor *arg1 = (Xapian::Compactor *) 0 ;
  bool arg2 ;
  
  SWIG_check_num_args("Xapian::Compactor::set_multipass",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Compactor::set_multipass",1,"Xapian::Compactor *");
  if(!lua_isboolean(L,2)) SWIG_fail_arg("Xapian::Compactor::set_multipass",2,"bool");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Compactor,0))){
    SWIG_fail_ptr("Compactor_set_multipass",1,SWIGTYPE_p_Xapian__Compactor);
  }
  
  arg2 = (lua_toboolean(L, 2)!=0);
  {
    try {
      (arg1)->set_multipass(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Compactor_set_compaction_level(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Compactor *arg1 = (Xapian::Compactor *) 0 ;
  Xapian::Compactor::compaction_level arg2 ;
  
  SWIG_check_num_args("Xapian::Compactor::set_compaction_level",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Compactor::set_compaction_level",1,"Xapian::Compactor *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Compactor::set_compaction_level",2,"Xapian::Compactor::compaction_level");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Compactor,0))){
    SWIG_fail_ptr("Compactor_set_compaction_level",1,SWIGTYPE_p_Xapian__Compactor);
  }
  
  arg2 = (Xapian::Compactor::compaction_level)(int)lua_tonumber(L, 2);
  {
    try {
      (arg1)->set_compaction_level(arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Compactor_set_destdir(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Compactor *arg1 = (Xapian::Compactor *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::Compactor::set_destdir",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Compactor::set_destdir",1,"Xapian::Compactor *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Compactor::set_destdir",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Compactor,0))){
    SWIG_fail_ptr("Compactor_set_destdir",1,SWIGTYPE_p_Xapian__Compactor);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      (arg1)->set_destdir((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Compactor_add_source(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Compactor *arg1 = (Xapian::Compactor *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::Compactor::add_source",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Compactor::add_source",1,"Xapian::Compactor *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Compactor::add_source",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Compactor,0))){
    SWIG_fail_ptr("Compactor_add_source",1,SWIGTYPE_p_Xapian__Compactor);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      (arg1)->add_source((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Compactor_compact(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Compactor *arg1 = (Xapian::Compactor *) 0 ;
  
  SWIG_check_num_args("Xapian::Compactor::compact",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Compactor::compact",1,"Xapian::Compactor *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Compactor,0))){
    SWIG_fail_ptr("Compactor_compact",1,SWIGTYPE_p_Xapian__Compactor);
  }
  
  {
    try {
      (arg1)->compact();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Compactor_set_status(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Compactor *arg1 = (Xapian::Compactor *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  std::string temp2 ;
  std::string temp3 ;
  
  SWIG_check_num_args("Xapian::Compactor::set_status",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Compactor::set_status",1,"Xapian::Compactor *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Compactor::set_status",2,"std::string const &");
  if(!lua_isstring(L,3)) SWIG_fail_arg("Xapian::Compactor::set_status",3,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Compactor,0))){
    SWIG_fail_ptr("Compactor_set_status",1,SWIGTYPE_p_Xapian__Compactor);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  temp3.assign(lua_tostring(L,3),lua_rawlen(L,3)); arg3=&temp3;
  {
    try {
      (arg1)->set_status((std::string const &)*arg2,(std::string const &)*arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_Compactor_resolve_duplicate_metadata(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Compactor *arg1 = (Xapian::Compactor *) 0 ;
  std::string *arg2 = 0 ;
  size_t arg3 ;
  std::string *arg4 ;
  std::string temp2 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::Compactor::resolve_duplicate_metadata",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Compactor::resolve_duplicate_metadata",1,"Xapian::Compactor *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Compactor::resolve_duplicate_metadata",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Compactor::resolve_duplicate_metadata",3,"size_t");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("Xapian::Compactor::resolve_duplicate_metadata",4,"std::string const []");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Compactor,0))){
    SWIG_fail_ptr("Compactor_resolve_duplicate_metadata",1,SWIGTYPE_p_Xapian__Compactor);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (size_t)lua_tonumber(L, 3);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_std__string,0))){
    SWIG_fail_ptr("Compactor_resolve_duplicate_metadata",4,SWIGTYPE_p_std__string);
  }
  
  {
    try {
      result = (arg1)->resolve_duplicate_metadata((std::string const &)*arg2,arg3,(std::string const (*))arg4);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_Compactor(void *obj) {
Xapian::Compactor *arg1 = (Xapian::Compactor *) obj;
delete arg1;
}
static swig_lua_method swig_Xapian_Compactor_methods[] = {
    {"set_block_size", _wrap_Compactor_set_block_size}, 
    {"set_renumber", _wrap_Compactor_set_renumber}, 
    {"set_multipass", _wrap_Compactor_set_multipass}, 
    {"set_compaction_level", _wrap_Compactor_set_compaction_level}, 
    {"set_destdir", _wrap_Compactor_set_destdir}, 
    {"add_source", _wrap_Compactor_add_source}, 
    {"compact", _wrap_Compactor_compact}, 
    {"set_status", _wrap_Compactor_set_status}, 
    {"resolve_duplicate_metadata", _wrap_Compactor_resolve_duplicate_metadata}, 
    {0,0}
};
static swig_lua_attribute swig_Xapian_Compactor_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_Xapian_Compactor_bases[] = {0};
static const char *swig_Xapian_Compactor_base_names[] = {0};
static swig_lua_class _wrap_class_Xapian_Compactor = { "Compactor", &SWIGTYPE_p_Xapian__Compactor,_wrap_new_Compactor, swig_delete_Compactor, swig_Xapian_Compactor_methods, swig_Xapian_Compactor_attributes, swig_Xapian_Compactor_bases, swig_Xapian_Compactor_base_names };

#ifdef __cplusplus
}
#endif

static const struct luaL_Reg swig_commands[] = {
    { "version_string", _wrap_version_string},
    { "major_version", _wrap_major_version},
    { "minor_version", _wrap_minor_version},
    { "revision", _wrap_revision},
    { "__eq", _wrap___eq},
    { "Document_unserialise", _wrap_Document_unserialise},
    { "open_stub", _wrap_open_stub},
    { "brass_open",_wrap_brass_open},
    { "chert_open",_wrap_chert_open},
    { "flint_open",_wrap_flint_open},
    { "inmemory_open", _wrap_inmemory_open},
    { "remote_open",_wrap_remote_open},
    { "remote_open_writable",_wrap_remote_open_writable},
    { "Query_unserialise",_wrap_Query_unserialise},
    { "sortable_serialise", _wrap_sortable_serialise},
    { "sortable_unserialise", _wrap_sortable_unserialise},
    { "Stem_get_available_languages", _wrap_Stem_get_available_languages},
    {0,0}
};

static swig_lua_var_info swig_variables[] = {
    { "BAD_VALUENO", _wrap_BAD_VALUENO_get, SWIG_Lua_set_immutable },
    { "Query_MatchAll", _wrap_Query_MatchAll_get, SWIG_Lua_set_immutable },
    { "Query_MatchNothing", _wrap_Query_MatchNothing_get, SWIG_Lua_set_immutable },
    {0,0,0}
};

static swig_lua_const_info swig_constants[] = {
{ SWIG_LUA_INT,     (char *)"Enquire_ASCENDING", (long) Xapian::Enquire::ASCENDING, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"Enquire_DESCENDING", (long) Xapian::Enquire::DESCENDING, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"Enquire_DONT_CARE", (long) Xapian::Enquire::DONT_CARE, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"Enquire_INCLUDE_QUERY_TERMS", (long) Xapian::Enquire::INCLUDE_QUERY_TERMS, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"Enquire_USE_EXACT_TERMFREQ", (long) Xapian::Enquire::USE_EXACT_TERMFREQ, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"DB_CREATE_OR_OPEN", (long) Xapian::DB_CREATE_OR_OPEN, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"DB_CREATE", (long) Xapian::DB_CREATE, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"DB_CREATE_OR_OVERWRITE", (long) Xapian::DB_CREATE_OR_OVERWRITE, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"DB_OPEN", (long) Xapian::DB_OPEN, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"Query_OP_AND", (long) Xapian::Query::OP_AND, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"Query_OP_OR", (long) Xapian::Query::OP_OR, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"Query_OP_AND_NOT", (long) Xapian::Query::OP_AND_NOT, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"Query_OP_XOR", (long) Xapian::Query::OP_XOR, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"Query_OP_AND_MAYBE", (long) Xapian::Query::OP_AND_MAYBE, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"Query_OP_FILTER", (long) Xapian::Query::OP_FILTER, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"Query_OP_NEAR", (long) Xapian::Query::OP_NEAR, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"Query_OP_PHRASE", (long) Xapian::Query::OP_PHRASE, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"Query_OP_VALUE_RANGE", (long) Xapian::Query::OP_VALUE_RANGE, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"Query_OP_SCALE_WEIGHT", (long) Xapian::Query::OP_SCALE_WEIGHT, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"Query_OP_ELITE_SET", (long) Xapian::Query::OP_ELITE_SET, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"Query_OP_VALUE_GE", (long) Xapian::Query::OP_VALUE_GE, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"Query_OP_VALUE_LE", (long) Xapian::Query::OP_VALUE_LE, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"Query_OP_SYNONYM", (long) Xapian::Query::OP_SYNONYM, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"QueryParser_FLAG_BOOLEAN", (long) Xapian::QueryParser::FLAG_BOOLEAN, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"QueryParser_FLAG_PHRASE", (long) Xapian::QueryParser::FLAG_PHRASE, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"QueryParser_FLAG_LOVEHATE", (long) Xapian::QueryParser::FLAG_LOVEHATE, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"QueryParser_FLAG_BOOLEAN_ANY_CASE", (long) Xapian::QueryParser::FLAG_BOOLEAN_ANY_CASE, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"QueryParser_FLAG_WILDCARD", (long) Xapian::QueryParser::FLAG_WILDCARD, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"QueryParser_FLAG_PURE_NOT", (long) Xapian::QueryParser::FLAG_PURE_NOT, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"QueryParser_FLAG_PARTIAL", (long) Xapian::QueryParser::FLAG_PARTIAL, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"QueryParser_FLAG_SPELLING_CORRECTION", (long) Xapian::QueryParser::FLAG_SPELLING_CORRECTION, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"QueryParser_FLAG_SYNONYM", (long) Xapian::QueryParser::FLAG_SYNONYM, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"QueryParser_FLAG_AUTO_SYNONYMS", (long) Xapian::QueryParser::FLAG_AUTO_SYNONYMS, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"QueryParser_FLAG_AUTO_MULTIWORD_SYNONYMS", (long) Xapian::QueryParser::FLAG_AUTO_MULTIWORD_SYNONYMS, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"QueryParser_FLAG_CJK_NGRAM", (long) Xapian::QueryParser::FLAG_CJK_NGRAM, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"QueryParser_FLAG_DEFAULT", (long) Xapian::QueryParser::FLAG_DEFAULT, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"QueryParser_STEM_NONE", (long) Xapian::QueryParser::STEM_NONE, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"QueryParser_STEM_SOME", (long) Xapian::QueryParser::STEM_SOME, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"QueryParser_STEM_ALL", (long) Xapian::QueryParser::STEM_ALL, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"QueryParser_STEM_ALL_Z", (long) Xapian::QueryParser::STEM_ALL_Z, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"TermGenerator_FLAG_SPELLING", (long) Xapian::TermGenerator::FLAG_SPELLING, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"TermGenerator_FLAG_CJK_NGRAM", (long) Xapian::TermGenerator::FLAG_CJK_NGRAM, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"TermGenerator_STEM_NONE", (long) Xapian::TermGenerator::STEM_NONE, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"TermGenerator_STEM_SOME", (long) Xapian::TermGenerator::STEM_SOME, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"TermGenerator_STEM_ALL", (long) Xapian::TermGenerator::STEM_ALL, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"TermGenerator_STEM_ALL_Z", (long) Xapian::TermGenerator::STEM_ALL_Z, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"Compactor_STANDARD", (long) Xapian::Compactor::STANDARD, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"Compactor_FULL", (long) Xapian::Compactor::FULL, 0, 0, 0},
{ SWIG_LUA_INT,     (char *)"Compactor_FULLER", (long) Xapian::Compactor::FULLER, 0, 0, 0},
    {0,0,0,0,0,0}
};

/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */

static void *_p_Xapian__WritableDatabaseTo_p_Xapian__Database(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Database *)  ((Xapian::WritableDatabase *) x));
}
static void *_p_Xapian__ValueSetMatchDeciderTo_p_Xapian__MatchDecider(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::MatchDecider *)  ((Xapian::ValueSetMatchDecider *) x));
}
static void *_p_Xapian__NetworkTimeoutErrorTo_p_Xapian__NetworkError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::NetworkError *)  ((Xapian::NetworkTimeoutError *) x));
}
static void *_p_Xapian__MultiValueSorterTo_p_Xapian__Sorter(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Sorter *)  ((Xapian::MultiValueSorter *) x));
}
static void *_p_Xapian__SorterTo_p_Xapian__KeyMaker(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::KeyMaker *)  ((Xapian::Sorter *) x));
}
static void *_p_Xapian__MultiValueSorterTo_p_Xapian__KeyMaker(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::KeyMaker *) (Xapian::Sorter *) ((Xapian::MultiValueSorter *) x));
}
static void *_p_Xapian__MultiValueKeyMakerTo_p_Xapian__KeyMaker(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::KeyMaker *)  ((Xapian::MultiValueKeyMaker *) x));
}
static void *_p_Xapian__AssertionErrorTo_p_Xapian__LogicError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::LogicError *)  ((Xapian::AssertionError *) x));
}
static void *_p_Xapian__InvalidOperationErrorTo_p_Xapian__LogicError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::LogicError *)  ((Xapian::InvalidOperationError *) x));
}
static void *_p_Xapian__UnimplementedErrorTo_p_Xapian__LogicError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::LogicError *)  ((Xapian::UnimplementedError *) x));
}
static void *_p_Xapian__InvalidArgumentErrorTo_p_Xapian__LogicError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::LogicError *)  ((Xapian::InvalidArgumentError *) x));
}
static void *_p_Xapian__ValuePostingSourceTo_p_Xapian__PostingSource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::PostingSource *)  ((Xapian::ValuePostingSource *) x));
}
static void *_p_Xapian__ValueWeightPostingSourceTo_p_Xapian__PostingSource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::PostingSource *) (Xapian::ValuePostingSource *) ((Xapian::ValueWeightPostingSource *) x));
}
static void *_p_Xapian__DecreasingValueWeightPostingSourceTo_p_Xapian__PostingSource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::PostingSource *) (Xapian::ValuePostingSource *)(Xapian::ValueWeightPostingSource *) ((Xapian::DecreasingValueWeightPostingSource *) x));
}
static void *_p_Xapian__ValueMapPostingSourceTo_p_Xapian__PostingSource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::PostingSource *) (Xapian::ValuePostingSource *) ((Xapian::ValueMapPostingSource *) x));
}
static void *_p_Xapian__FixedWeightPostingSourceTo_p_Xapian__PostingSource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::PostingSource *)  ((Xapian::FixedWeightPostingSource *) x));
}
static void *_p_Xapian__DecreasingValueWeightPostingSourceTo_p_Xapian__ValueWeightPostingSource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::ValueWeightPostingSource *)  ((Xapian::DecreasingValueWeightPostingSource *) x));
}
static void *_p_Xapian__ValueWeightPostingSourceTo_p_Xapian__ValuePostingSource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::ValuePostingSource *)  ((Xapian::ValueWeightPostingSource *) x));
}
static void *_p_Xapian__DecreasingValueWeightPostingSourceTo_p_Xapian__ValuePostingSource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::ValuePostingSource *) (Xapian::ValueWeightPostingSource *) ((Xapian::DecreasingValueWeightPostingSource *) x));
}
static void *_p_Xapian__ValueMapPostingSourceTo_p_Xapian__ValuePostingSource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::ValuePostingSource *)  ((Xapian::ValueMapPostingSource *) x));
}
static void *_p_Xapian__BoolWeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::BoolWeight *) x));
}
static void *_p_Xapian__TradWeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::TradWeight *) x));
}
static void *_p_Xapian__BM25WeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::BM25Weight *) x));
}
static void *_p_Xapian__ValueCountMatchSpyTo_p_Xapian__MatchSpy(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::MatchSpy *)  ((Xapian::ValueCountMatchSpy *) x));
}
static void *_p_Xapian__SimpleStopperTo_p_Xapian__Stopper(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Stopper *)  ((Xapian::SimpleStopper *) x));
}
static void *_p_Xapian__DatabaseVersionErrorTo_p_Xapian__DatabaseOpeningError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::DatabaseOpeningError *)  ((Xapian::DatabaseVersionError *) x));
}
static void *_p_Xapian__DatabaseVersionErrorTo_p_Xapian__DatabaseError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::DatabaseError *) (Xapian::DatabaseOpeningError *) ((Xapian::DatabaseVersionError *) x));
}
static void *_p_Xapian__DatabaseLockErrorTo_p_Xapian__DatabaseError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::DatabaseError *)  ((Xapian::DatabaseLockError *) x));
}
static void *_p_Xapian__DatabaseModifiedErrorTo_p_Xapian__DatabaseError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::DatabaseError *)  ((Xapian::DatabaseModifiedError *) x));
}
static void *_p_Xapian__DatabaseOpeningErrorTo_p_Xapian__DatabaseError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::DatabaseError *)  ((Xapian::DatabaseOpeningError *) x));
}
static void *_p_Xapian__DatabaseCreateErrorTo_p_Xapian__DatabaseError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::DatabaseError *)  ((Xapian::DatabaseCreateError *) x));
}
static void *_p_Xapian__DatabaseCorruptErrorTo_p_Xapian__DatabaseError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::DatabaseError *)  ((Xapian::DatabaseCorruptError *) x));
}
static void *_p_Xapian__DocNotFoundErrorTo_p_Xapian__RuntimeError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::RuntimeError *)  ((Xapian::DocNotFoundError *) x));
}
static void *_p_Xapian__DatabaseLockErrorTo_p_Xapian__RuntimeError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::RuntimeError *) (Xapian::DatabaseError *) ((Xapian::DatabaseLockError *) x));
}
static void *_p_Xapian__NetworkTimeoutErrorTo_p_Xapian__RuntimeError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::RuntimeError *) (Xapian::NetworkError *) ((Xapian::NetworkTimeoutError *) x));
}
static void *_p_Xapian__FeatureUnavailableErrorTo_p_Xapian__RuntimeError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::RuntimeError *)  ((Xapian::FeatureUnavailableError *) x));
}
static void *_p_Xapian__DatabaseCreateErrorTo_p_Xapian__RuntimeError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::RuntimeError *) (Xapian::DatabaseError *) ((Xapian::DatabaseCreateError *) x));
}
static void *_p_Xapian__InternalErrorTo_p_Xapian__RuntimeError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::RuntimeError *)  ((Xapian::InternalError *) x));
}
static void *_p_Xapian__DatabaseModifiedErrorTo_p_Xapian__RuntimeError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::RuntimeError *) (Xapian::DatabaseError *) ((Xapian::DatabaseModifiedError *) x));
}
static void *_p_Xapian__DatabaseErrorTo_p_Xapian__RuntimeError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::RuntimeError *)  ((Xapian::DatabaseError *) x));
}
static void *_p_Xapian__DatabaseOpeningErrorTo_p_Xapian__RuntimeError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::RuntimeError *) (Xapian::DatabaseError *) ((Xapian::DatabaseOpeningError *) x));
}
static void *_p_Xapian__RangeErrorTo_p_Xapian__RuntimeError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::RuntimeError *)  ((Xapian::RangeError *) x));
}
static void *_p_Xapian__SerialisationErrorTo_p_Xapian__RuntimeError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::RuntimeError *)  ((Xapian::SerialisationError *) x));
}
static void *_p_Xapian__DatabaseVersionErrorTo_p_Xapian__RuntimeError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::RuntimeError *) (Xapian::DatabaseError *)(Xapian::DatabaseOpeningError *) ((Xapian::DatabaseVersionError *) x));
}
static void *_p_Xapian__NetworkErrorTo_p_Xapian__RuntimeError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::RuntimeError *)  ((Xapian::NetworkError *) x));
}
static void *_p_Xapian__DatabaseCorruptErrorTo_p_Xapian__RuntimeError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::RuntimeError *) (Xapian::DatabaseError *) ((Xapian::DatabaseCorruptError *) x));
}
static void *_p_Xapian__QueryParserErrorTo_p_Xapian__RuntimeError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::RuntimeError *)  ((Xapian::QueryParserError *) x));
}
static void *_p_Xapian__StringValueRangeProcessorTo_p_Xapian__ValueRangeProcessor(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::ValueRangeProcessor *)  ((Xapian::StringValueRangeProcessor *) x));
}
static void *_p_Xapian__DateValueRangeProcessorTo_p_Xapian__ValueRangeProcessor(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::ValueRangeProcessor *) (Xapian::StringValueRangeProcessor *) ((Xapian::DateValueRangeProcessor *) x));
}
static void *_p_Xapian__NumberValueRangeProcessorTo_p_Xapian__ValueRangeProcessor(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::ValueRangeProcessor *) (Xapian::StringValueRangeProcessor *) ((Xapian::NumberValueRangeProcessor *) x));
}
static void *_p_Xapian__DateValueRangeProcessorTo_p_Xapian__StringValueRangeProcessor(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::StringValueRangeProcessor *)  ((Xapian::DateValueRangeProcessor *) x));
}
static void *_p_Xapian__NumberValueRangeProcessorTo_p_Xapian__StringValueRangeProcessor(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::StringValueRangeProcessor *)  ((Xapian::NumberValueRangeProcessor *) x));
}
static void *_p_Xapian__DocNotFoundErrorTo_p_Xapian__Error(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Error *) (Xapian::RuntimeError *) ((Xapian::DocNotFoundError *) x));
}
static void *_p_Xapian__DatabaseLockErrorTo_p_Xapian__Error(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Error *) (Xapian::RuntimeError *)(Xapian::DatabaseError *) ((Xapian::DatabaseLockError *) x));
}
static void *_p_Xapian__LogicErrorTo_p_Xapian__Error(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Error *)  ((Xapian::LogicError *) x));
}
static void *_p_Xapian__DatabaseCreateErrorTo_p_Xapian__Error(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Error *) (Xapian::RuntimeError *)(Xapian::DatabaseError *) ((Xapian::DatabaseCreateError *) x));
}
static void *_p_Xapian__FeatureUnavailableErrorTo_p_Xapian__Error(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Error *) (Xapian::RuntimeError *) ((Xapian::FeatureUnavailableError *) x));
}
static void *_p_Xapian__NetworkTimeoutErrorTo_p_Xapian__Error(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Error *) (Xapian::RuntimeError *)(Xapian::NetworkError *) ((Xapian::NetworkTimeoutError *) x));
}
static void *_p_Xapian__InternalErrorTo_p_Xapian__Error(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Error *) (Xapian::RuntimeError *) ((Xapian::InternalError *) x));
}
static void *_p_Xapian__DatabaseModifiedErrorTo_p_Xapian__Error(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Error *) (Xapian::RuntimeError *)(Xapian::DatabaseError *) ((Xapian::DatabaseModifiedError *) x));
}
static void *_p_Xapian__UnimplementedErrorTo_p_Xapian__Error(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Error *) (Xapian::LogicError *) ((Xapian::UnimplementedError *) x));
}
static void *_p_Xapian__DatabaseErrorTo_p_Xapian__Error(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Error *) (Xapian::RuntimeError *) ((Xapian::DatabaseError *) x));
}
static void *_p_Xapian__RuntimeErrorTo_p_Xapian__Error(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Error *)  ((Xapian::RuntimeError *) x));
}
static void *_p_Xapian__DatabaseOpeningErrorTo_p_Xapian__Error(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Error *) (Xapian::RuntimeError *)(Xapian::DatabaseError *) ((Xapian::DatabaseOpeningError *) x));
}
static void *_p_Xapian__RangeErrorTo_p_Xapian__Error(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Error *) (Xapian::RuntimeError *) ((Xapian::RangeError *) x));
}
static void *_p_Xapian__DatabaseVersionErrorTo_p_Xapian__Error(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Error *) (Xapian::RuntimeError *)(Xapian::DatabaseError *)(Xapian::DatabaseOpeningError *) ((Xapian::DatabaseVersionError *) x));
}
static void *_p_Xapian__InvalidOperationErrorTo_p_Xapian__Error(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Error *) (Xapian::LogicError *) ((Xapian::InvalidOperationError *) x));
}
static void *_p_Xapian__AssertionErrorTo_p_Xapian__Error(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Error *) (Xapian::LogicError *) ((Xapian::AssertionError *) x));
}
static void *_p_Xapian__SerialisationErrorTo_p_Xapian__Error(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Error *) (Xapian::RuntimeError *) ((Xapian::SerialisationError *) x));
}
static void *_p_Xapian__NetworkErrorTo_p_Xapian__Error(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Error *) (Xapian::RuntimeError *) ((Xapian::NetworkError *) x));
}
static void *_p_Xapian__DatabaseCorruptErrorTo_p_Xapian__Error(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Error *) (Xapian::RuntimeError *)(Xapian::DatabaseError *) ((Xapian::DatabaseCorruptError *) x));
}
static void *_p_Xapian__InvalidArgumentErrorTo_p_Xapian__Error(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Error *) (Xapian::LogicError *) ((Xapian::InvalidArgumentError *) x));
}
static void *_p_Xapian__QueryParserErrorTo_p_Xapian__Error(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Error *) (Xapian::RuntimeError *) ((Xapian::QueryParserError *) x));
}
static swig_type_info _swigt__p_Xapian__AssertionError = {"_p_Xapian__AssertionError", "Xapian::AssertionError *", 0, 0, (void*)&_wrap_class_Xapian_AssertionError, 0};
static swig_type_info _swigt__p_Xapian__BM25Weight = {"_p_Xapian__BM25Weight", "Xapian::BM25Weight *", 0, 0, (void*)&_wrap_class_Xapian_BM25Weight, 0};
static swig_type_info _swigt__p_Xapian__BoolWeight = {"_p_Xapian__BoolWeight", "Xapian::BoolWeight *", 0, 0, (void*)&_wrap_class_Xapian_BoolWeight, 0};
static swig_type_info _swigt__p_Xapian__Compactor = {"_p_Xapian__Compactor", "Xapian::Compactor *", 0, 0, (void*)&_wrap_class_Xapian_Compactor, 0};
static swig_type_info _swigt__p_Xapian__Database = {"_p_Xapian__Database", "Xapian::Database *", 0, 0, (void*)&_wrap_class_Xapian_Database, 0};
static swig_type_info _swigt__p_Xapian__DatabaseCorruptError = {"_p_Xapian__DatabaseCorruptError", "Xapian::DatabaseCorruptError *", 0, 0, (void*)&_wrap_class_Xapian_DatabaseCorruptError, 0};
static swig_type_info _swigt__p_Xapian__DatabaseCreateError = {"_p_Xapian__DatabaseCreateError", "Xapian::DatabaseCreateError *", 0, 0, (void*)&_wrap_class_Xapian_DatabaseCreateError, 0};
static swig_type_info _swigt__p_Xapian__DatabaseError = {"_p_Xapian__DatabaseError", "Xapian::DatabaseError *", 0, 0, (void*)&_wrap_class_Xapian_DatabaseError, 0};
static swig_type_info _swigt__p_Xapian__DatabaseLockError = {"_p_Xapian__DatabaseLockError", "Xapian::DatabaseLockError *", 0, 0, (void*)&_wrap_class_Xapian_DatabaseLockError, 0};
static swig_type_info _swigt__p_Xapian__DatabaseModifiedError = {"_p_Xapian__DatabaseModifiedError", "Xapian::DatabaseModifiedError *", 0, 0, (void*)&_wrap_class_Xapian_DatabaseModifiedError, 0};
static swig_type_info _swigt__p_Xapian__DatabaseOpeningError = {"_p_Xapian__DatabaseOpeningError", "Xapian::DatabaseOpeningError *", 0, 0, (void*)&_wrap_class_Xapian_DatabaseOpeningError, 0};
static swig_type_info _swigt__p_Xapian__DatabaseVersionError = {"_p_Xapian__DatabaseVersionError", "Xapian::DatabaseVersionError *", 0, 0, (void*)&_wrap_class_Xapian_DatabaseVersionError, 0};
static swig_type_info _swigt__p_Xapian__DateValueRangeProcessor = {"_p_Xapian__DateValueRangeProcessor", "Xapian::DateValueRangeProcessor *", 0, 0, (void*)&_wrap_class_Xapian_DateValueRangeProcessor, 0};
static swig_type_info _swigt__p_Xapian__DecreasingValueWeightPostingSource = {"_p_Xapian__DecreasingValueWeightPostingSource", "Xapian::DecreasingValueWeightPostingSource *", 0, 0, (void*)&_wrap_class_Xapian_DecreasingValueWeightPostingSource, 0};
static swig_type_info _swigt__p_Xapian__DocNotFoundError = {"_p_Xapian__DocNotFoundError", "Xapian::DocNotFoundError *", 0, 0, (void*)&_wrap_class_Xapian_DocNotFoundError, 0};
static swig_type_info _swigt__p_Xapian__Document = {"_p_Xapian__Document", "Xapian::Document *", 0, 0, (void*)&_wrap_class_Xapian_Document, 0};
static swig_type_info _swigt__p_Xapian__ESet = {"_p_Xapian__ESet", "Xapian::ESet *", 0, 0, (void*)&_wrap_class_Xapian_ESet, 0};
static swig_type_info _swigt__p_Xapian__ESetIterator = {"_p_Xapian__ESetIterator", "Xapian::ESetIterator *", 0, 0, (void*)&_wrap_class_Xapian_ESetIterator, 0};
static swig_type_info _swigt__p_Xapian__Enquire = {"_p_Xapian__Enquire", "Xapian::Enquire *", 0, 0, (void*)&_wrap_class_Xapian_Enquire, 0};
static swig_type_info _swigt__p_Xapian__Error = {"_p_Xapian__Error", "Xapian::Error *", 0, 0, (void*)&_wrap_class_Xapian_Error, 0};
static swig_type_info _swigt__p_Xapian__ExpandDecider = {"_p_Xapian__ExpandDecider", "Xapian::ExpandDecider *", 0, 0, (void*)&_wrap_class_Xapian_ExpandDecider, 0};
static swig_type_info _swigt__p_Xapian__FeatureUnavailableError = {"_p_Xapian__FeatureUnavailableError", "Xapian::FeatureUnavailableError *", 0, 0, (void*)&_wrap_class_Xapian_FeatureUnavailableError, 0};
static swig_type_info _swigt__p_Xapian__FixedWeightPostingSource = {"_p_Xapian__FixedWeightPostingSource", "Xapian::FixedWeightPostingSource *", 0, 0, (void*)&_wrap_class_Xapian_FixedWeightPostingSource, 0};
static swig_type_info _swigt__p_Xapian__InternalError = {"_p_Xapian__InternalError", "Xapian::InternalError *", 0, 0, (void*)&_wrap_class_Xapian_InternalError, 0};
static swig_type_info _swigt__p_Xapian__InvalidArgumentError = {"_p_Xapian__InvalidArgumentError", "Xapian::InvalidArgumentError *", 0, 0, (void*)&_wrap_class_Xapian_InvalidArgumentError, 0};
static swig_type_info _swigt__p_Xapian__InvalidOperationError = {"_p_Xapian__InvalidOperationError", "Xapian::InvalidOperationError *", 0, 0, (void*)&_wrap_class_Xapian_InvalidOperationError, 0};
static swig_type_info _swigt__p_Xapian__KeyMaker = {"_p_Xapian__KeyMaker", "Xapian::KeyMaker *", 0, 0, (void*)&_wrap_class_Xapian_KeyMaker, 0};
static swig_type_info _swigt__p_Xapian__LogicError = {"_p_Xapian__LogicError", "Xapian::LogicError *", 0, 0, (void*)&_wrap_class_Xapian_LogicError, 0};
static swig_type_info _swigt__p_Xapian__MSet = {"_p_Xapian__MSet", "Xapian::MSet *", 0, 0, (void*)&_wrap_class_Xapian_MSet, 0};
static swig_type_info _swigt__p_Xapian__MSetIterator = {"_p_Xapian__MSetIterator", "Xapian::MSetIterator *", 0, 0, (void*)&_wrap_class_Xapian_MSetIterator, 0};
static swig_type_info _swigt__p_Xapian__MatchDecider = {"_p_Xapian__MatchDecider", "Xapian::MatchDecider *", 0, 0, (void*)&_wrap_class_Xapian_MatchDecider, 0};
static swig_type_info _swigt__p_Xapian__MatchSpy = {"_p_Xapian__MatchSpy", "Xapian::MatchSpy *", 0, 0, (void*)&_wrap_class_Xapian_MatchSpy, 0};
static swig_type_info _swigt__p_Xapian__MultiValueKeyMaker = {"_p_Xapian__MultiValueKeyMaker", "Xapian::MultiValueKeyMaker *", 0, 0, (void*)&_wrap_class_Xapian_MultiValueKeyMaker, 0};
static swig_type_info _swigt__p_Xapian__MultiValueSorter = {"_p_Xapian__MultiValueSorter", "Xapian::MultiValueSorter *", 0, 0, (void*)&_wrap_class_Xapian_MultiValueSorter, 0};
static swig_type_info _swigt__p_Xapian__NetworkError = {"_p_Xapian__NetworkError", "Xapian::NetworkError *", 0, 0, (void*)&_wrap_class_Xapian_NetworkError, 0};
static swig_type_info _swigt__p_Xapian__NetworkTimeoutError = {"_p_Xapian__NetworkTimeoutError", "Xapian::NetworkTimeoutError *", 0, 0, (void*)&_wrap_class_Xapian_NetworkTimeoutError, 0};
static swig_type_info _swigt__p_Xapian__NumberValueRangeProcessor = {"_p_Xapian__NumberValueRangeProcessor", "Xapian::NumberValueRangeProcessor *", 0, 0, (void*)&_wrap_class_Xapian_NumberValueRangeProcessor, 0};
static swig_type_info _swigt__p_Xapian__PositionIterator = {"_p_Xapian__PositionIterator", "Xapian::PositionIterator *", 0, 0, (void*)&_wrap_class_Xapian_PositionIterator, 0};
static swig_type_info _swigt__p_Xapian__PostingIterator = {"_p_Xapian__PostingIterator", "Xapian::PostingIterator *", 0, 0, (void*)&_wrap_class_Xapian_PostingIterator, 0};
static swig_type_info _swigt__p_Xapian__PostingSource = {"_p_Xapian__PostingSource", "Xapian::PostingSource *", 0, 0, (void*)&_wrap_class_Xapian_PostingSource, 0};
static swig_type_info _swigt__p_Xapian__Query = {"_p_Xapian__Query", "Xapian::Query *", 0, 0, (void*)&_wrap_class_Xapian_Query, 0};
static swig_type_info _swigt__p_Xapian__QueryParser = {"_p_Xapian__QueryParser", "Xapian::QueryParser *", 0, 0, (void*)&_wrap_class_Xapian_QueryParser, 0};
static swig_type_info _swigt__p_Xapian__QueryParserError = {"_p_Xapian__QueryParserError", "Xapian::QueryParserError *", 0, 0, (void*)&_wrap_class_Xapian_QueryParserError, 0};
static swig_type_info _swigt__p_Xapian__RSet = {"_p_Xapian__RSet", "Xapian::RSet *", 0, 0, (void*)&_wrap_class_Xapian_RSet, 0};
static swig_type_info _swigt__p_Xapian__RangeError = {"_p_Xapian__RangeError", "Xapian::RangeError *", 0, 0, (void*)&_wrap_class_Xapian_RangeError, 0};
static swig_type_info _swigt__p_Xapian__Registry = {"_p_Xapian__Registry", "Xapian::Registry *", 0, 0, (void*)&_wrap_class_Xapian_Registry, 0};
static swig_type_info _swigt__p_Xapian__RuntimeError = {"_p_Xapian__RuntimeError", "Xapian::RuntimeError *", 0, 0, (void*)&_wrap_class_Xapian_RuntimeError, 0};
static swig_type_info _swigt__p_Xapian__SerialisationError = {"_p_Xapian__SerialisationError", "Xapian::SerialisationError *", 0, 0, (void*)&_wrap_class_Xapian_SerialisationError, 0};
static swig_type_info _swigt__p_Xapian__SimpleStopper = {"_p_Xapian__SimpleStopper", "Xapian::SimpleStopper *", 0, 0, (void*)&_wrap_class_Xapian_SimpleStopper, 0};
static swig_type_info _swigt__p_Xapian__Sorter = {"_p_Xapian__Sorter", "Xapian::Sorter *", 0, 0, (void*)&_wrap_class_Xapian_Sorter, 0};
static swig_type_info _swigt__p_Xapian__Stem = {"_p_Xapian__Stem", "Xapian::Stem *", 0, 0, (void*)&_wrap_class_Xapian_Stem, 0};
static swig_type_info _swigt__p_Xapian__StemImplementation = {"_p_Xapian__StemImplementation", "Xapian::StemImplementation *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__Stopper = {"_p_Xapian__Stopper", "Xapian::Stopper *", 0, 0, (void*)&_wrap_class_Xapian_Stopper, 0};
static swig_type_info _swigt__p_Xapian__StringValueRangeProcessor = {"_p_Xapian__StringValueRangeProcessor", "Xapian::StringValueRangeProcessor *", 0, 0, (void*)&_wrap_class_Xapian_StringValueRangeProcessor, 0};
static swig_type_info _swigt__p_Xapian__TermGenerator = {"_p_Xapian__TermGenerator", "Xapian::TermGenerator *", 0, 0, (void*)&_wrap_class_Xapian_TermGenerator, 0};
static swig_type_info _swigt__p_Xapian__TermIterator = {"_p_Xapian__TermIterator", "Xapian::TermIterator *", 0, 0, (void*)&_wrap_class_Xapian_TermIterator, 0};
static swig_type_info _swigt__p_Xapian__TradWeight = {"_p_Xapian__TradWeight", "Xapian::TradWeight *", 0, 0, (void*)&_wrap_class_Xapian_TradWeight, 0};
static swig_type_info _swigt__p_Xapian__UnimplementedError = {"_p_Xapian__UnimplementedError", "Xapian::UnimplementedError *", 0, 0, (void*)&_wrap_class_Xapian_UnimplementedError, 0};
static swig_type_info _swigt__p_Xapian__ValueCountMatchSpy = {"_p_Xapian__ValueCountMatchSpy", "Xapian::ValueCountMatchSpy *", 0, 0, (void*)&_wrap_class_Xapian_ValueCountMatchSpy, 0};
static swig_type_info _swigt__p_Xapian__ValueIterator = {"_p_Xapian__ValueIterator", "Xapian::ValueIterator *", 0, 0, (void*)&_wrap_class_Xapian_ValueIterator, 0};
static swig_type_info _swigt__p_Xapian__ValueMapPostingSource = {"_p_Xapian__ValueMapPostingSource", "Xapian::ValueMapPostingSource *", 0, 0, (void*)&_wrap_class_Xapian_ValueMapPostingSource, 0};
static swig_type_info _swigt__p_Xapian__ValuePostingSource = {"_p_Xapian__ValuePostingSource", "Xapian::ValuePostingSource *", 0, 0, (void*)&_wrap_class_Xapian_ValuePostingSource, 0};
static swig_type_info _swigt__p_Xapian__ValueRangeProcessor = {"_p_Xapian__ValueRangeProcessor", "Xapian::ValueRangeProcessor *", 0, 0, (void*)&_wrap_class_Xapian_ValueRangeProcessor, 0};
static swig_type_info _swigt__p_Xapian__ValueSetMatchDecider = {"_p_Xapian__ValueSetMatchDecider", "Xapian::ValueSetMatchDecider *", 0, 0, (void*)&_wrap_class_Xapian_ValueSetMatchDecider, 0};
static swig_type_info _swigt__p_Xapian__ValueWeightPostingSource = {"_p_Xapian__ValueWeightPostingSource", "Xapian::ValueWeightPostingSource *", 0, 0, (void*)&_wrap_class_Xapian_ValueWeightPostingSource, 0};
static swig_type_info _swigt__p_Xapian__Weight = {"_p_Xapian__Weight", "Xapian::Weight *", 0, 0, (void*)&_wrap_class_Xapian_Weight, 0};
static swig_type_info _swigt__p_Xapian__WritableDatabase = {"_p_Xapian__WritableDatabase", "Xapian::WritableDatabase *", 0, 0, (void*)&_wrap_class_Xapian_WritableDatabase, 0};
static swig_type_info _swigt__p_compaction_level = {"_p_compaction_level", "compaction_level *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_docid_order = {"_p_docid_order", "docid_order *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_double = {"_p_double", "Xapian::doclength *|double *|Xapian::weight *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_feature_flag = {"_p_feature_flag", "feature_flag *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_first_type = {"_p_first_type", "first_type *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_int = {"_p_int", "int *|Xapian::doccount_diff *|Xapian::termcount_diff *|Xapian::termpos_diff *|Xapian::valueno_diff *|Xapian::percent *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_op = {"_p_op", "op *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_second_type = {"_p_second_type", "second_type *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__string = {"_p_std__string", "std::string *", 0, 0, (void*)&_wrap_class_std_string, 0};
static swig_type_info _swigt__p_stem_strategy = {"_p_stem_strategy", "stem_strategy *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "Xapian::timeout *|unsigned int *|Xapian::doccount *|Xapian::termcount *|Xapian::valueno *|Xapian::docid *|Xapian::termpos *", 0, 0, (void*)0, 0};

static swig_type_info *swig_type_initial[] = {
  &_swigt__p_Xapian__AssertionError,
  &_swigt__p_Xapian__BM25Weight,
  &_swigt__p_Xapian__BoolWeight,
  &_swigt__p_Xapian__Compactor,
  &_swigt__p_Xapian__Database,
  &_swigt__p_Xapian__DatabaseCorruptError,
  &_swigt__p_Xapian__DatabaseCreateError,
  &_swigt__p_Xapian__DatabaseError,
  &_swigt__p_Xapian__DatabaseLockError,
  &_swigt__p_Xapian__DatabaseModifiedError,
  &_swigt__p_Xapian__DatabaseOpeningError,
  &_swigt__p_Xapian__DatabaseVersionError,
  &_swigt__p_Xapian__DateValueRangeProcessor,
  &_swigt__p_Xapian__DecreasingValueWeightPostingSource,
  &_swigt__p_Xapian__DocNotFoundError,
  &_swigt__p_Xapian__Document,
  &_swigt__p_Xapian__ESet,
  &_swigt__p_Xapian__ESetIterator,
  &_swigt__p_Xapian__Enquire,
  &_swigt__p_Xapian__Error,
  &_swigt__p_Xapian__ExpandDecider,
  &_swigt__p_Xapian__FeatureUnavailableError,
  &_swigt__p_Xapian__FixedWeightPostingSource,
  &_swigt__p_Xapian__InternalError,
  &_swigt__p_Xapian__InvalidArgumentError,
  &_swigt__p_Xapian__InvalidOperationError,
  &_swigt__p_Xapian__KeyMaker,
  &_swigt__p_Xapian__LogicError,
  &_swigt__p_Xapian__MSet,
  &_swigt__p_Xapian__MSetIterator,
  &_swigt__p_Xapian__MatchDecider,
  &_swigt__p_Xapian__MatchSpy,
  &_swigt__p_Xapian__MultiValueKeyMaker,
  &_swigt__p_Xapian__MultiValueSorter,
  &_swigt__p_Xapian__NetworkError,
  &_swigt__p_Xapian__NetworkTimeoutError,
  &_swigt__p_Xapian__NumberValueRangeProcessor,
  &_swigt__p_Xapian__PositionIterator,
  &_swigt__p_Xapian__PostingIterator,
  &_swigt__p_Xapian__PostingSource,
  &_swigt__p_Xapian__Query,
  &_swigt__p_Xapian__QueryParser,
  &_swigt__p_Xapian__QueryParserError,
  &_swigt__p_Xapian__RSet,
  &_swigt__p_Xapian__RangeError,
  &_swigt__p_Xapian__Registry,
  &_swigt__p_Xapian__RuntimeError,
  &_swigt__p_Xapian__SerialisationError,
  &_swigt__p_Xapian__SimpleStopper,
  &_swigt__p_Xapian__Sorter,
  &_swigt__p_Xapian__Stem,
  &_swigt__p_Xapian__StemImplementation,
  &_swigt__p_Xapian__Stopper,
  &_swigt__p_Xapian__StringValueRangeProcessor,
  &_swigt__p_Xapian__TermGenerator,
  &_swigt__p_Xapian__TermIterator,
  &_swigt__p_Xapian__TradWeight,
  &_swigt__p_Xapian__UnimplementedError,
  &_swigt__p_Xapian__ValueCountMatchSpy,
  &_swigt__p_Xapian__ValueIterator,
  &_swigt__p_Xapian__ValueMapPostingSource,
  &_swigt__p_Xapian__ValuePostingSource,
  &_swigt__p_Xapian__ValueRangeProcessor,
  &_swigt__p_Xapian__ValueSetMatchDecider,
  &_swigt__p_Xapian__ValueWeightPostingSource,
  &_swigt__p_Xapian__Weight,
  &_swigt__p_Xapian__WritableDatabase,
  &_swigt__p_compaction_level,
  &_swigt__p_docid_order,
  &_swigt__p_double,
  &_swigt__p_feature_flag,
  &_swigt__p_first_type,
  &_swigt__p_int,
  &_swigt__p_op,
  &_swigt__p_second_type,
  &_swigt__p_std__string,
  &_swigt__p_stem_strategy,
  &_swigt__p_unsigned_int,
};

static swig_cast_info _swigc__p_Xapian__AssertionError[] = {  {&_swigt__p_Xapian__AssertionError, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__BM25Weight[] = {  {&_swigt__p_Xapian__BM25Weight, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__BoolWeight[] = {  {&_swigt__p_Xapian__BoolWeight, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__Compactor[] = {  {&_swigt__p_Xapian__Compactor, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__Database[] = {  {&_swigt__p_Xapian__Database, 0, 0, 0},  {&_swigt__p_Xapian__WritableDatabase, _p_Xapian__WritableDatabaseTo_p_Xapian__Database, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__DatabaseCorruptError[] = {  {&_swigt__p_Xapian__DatabaseCorruptError, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__DatabaseCreateError[] = {  {&_swigt__p_Xapian__DatabaseCreateError, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__DatabaseError[] = {  {&_swigt__p_Xapian__DatabaseVersionError, _p_Xapian__DatabaseVersionErrorTo_p_Xapian__DatabaseError, 0, 0},  {&_swigt__p_Xapian__DatabaseLockError, _p_Xapian__DatabaseLockErrorTo_p_Xapian__DatabaseError, 0, 0},  {&_swigt__p_Xapian__DatabaseModifiedError, _p_Xapian__DatabaseModifiedErrorTo_p_Xapian__DatabaseError, 0, 0},  {&_swigt__p_Xapian__DatabaseOpeningError, _p_Xapian__DatabaseOpeningErrorTo_p_Xapian__DatabaseError, 0, 0},  {&_swigt__p_Xapian__DatabaseError, 0, 0, 0},  {&_swigt__p_Xapian__DatabaseCreateError, _p_Xapian__DatabaseCreateErrorTo_p_Xapian__DatabaseError, 0, 0},  {&_swigt__p_Xapian__DatabaseCorruptError, _p_Xapian__DatabaseCorruptErrorTo_p_Xapian__DatabaseError, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__DatabaseLockError[] = {  {&_swigt__p_Xapian__DatabaseLockError, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__DatabaseModifiedError[] = {  {&_swigt__p_Xapian__DatabaseModifiedError, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__DatabaseOpeningError[] = {  {&_swigt__p_Xapian__DatabaseVersionError, _p_Xapian__DatabaseVersionErrorTo_p_Xapian__DatabaseOpeningError, 0, 0},  {&_swigt__p_Xapian__DatabaseOpeningError, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__DatabaseVersionError[] = {  {&_swigt__p_Xapian__DatabaseVersionError, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__DateValueRangeProcessor[] = {  {&_swigt__p_Xapian__DateValueRangeProcessor, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__DecreasingValueWeightPostingSource[] = {  {&_swigt__p_Xapian__DecreasingValueWeightPostingSource, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__DocNotFoundError[] = {  {&_swigt__p_Xapian__DocNotFoundError, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__Document[] = {  {&_swigt__p_Xapian__Document, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ESet[] = {  {&_swigt__p_Xapian__ESet, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ESetIterator[] = {  {&_swigt__p_Xapian__ESetIterator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__Enquire[] = {  {&_swigt__p_Xapian__Enquire, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__Error[] = {  {&_swigt__p_Xapian__DocNotFoundError, _p_Xapian__DocNotFoundErrorTo_p_Xapian__Error, 0, 0},  {&_swigt__p_Xapian__DatabaseLockError, _p_Xapian__DatabaseLockErrorTo_p_Xapian__Error, 0, 0},  {&_swigt__p_Xapian__LogicError, _p_Xapian__LogicErrorTo_p_Xapian__Error, 0, 0},  {&_swigt__p_Xapian__NetworkTimeoutError, _p_Xapian__NetworkTimeoutErrorTo_p_Xapian__Error, 0, 0},  {&_swigt__p_Xapian__DatabaseCreateError, _p_Xapian__DatabaseCreateErrorTo_p_Xapian__Error, 0, 0},  {&_swigt__p_Xapian__FeatureUnavailableError, _p_Xapian__FeatureUnavailableErrorTo_p_Xapian__Error, 0, 0},  {&_swigt__p_Xapian__InternalError, _p_Xapian__InternalErrorTo_p_Xapian__Error, 0, 0},  {&_swigt__p_Xapian__DatabaseModifiedError, _p_Xapian__DatabaseModifiedErrorTo_p_Xapian__Error, 0, 0},  {&_swigt__p_Xapian__UnimplementedError, _p_Xapian__UnimplementedErrorTo_p_Xapian__Error, 0, 0},  {&_swigt__p_Xapian__RangeError, _p_Xapian__RangeErrorTo_p_Xapian__Error, 0, 0},  {&_swigt__p_Xapian__RuntimeError, _p_Xapian__RuntimeErrorTo_p_Xapian__Error, 0, 0},  {&_swigt__p_Xapian__DatabaseError, _p_Xapian__DatabaseErrorTo_p_Xapian__Error, 0, 0},  {&_swigt__p_Xapian__DatabaseOpeningError, _p_Xapian__DatabaseOpeningErrorTo_p_Xapian__Error, 0, 0},  {&_swigt__p_Xapian__InvalidOperationError, _p_Xapian__InvalidOperationErrorTo_p_Xapian__Error, 0, 0},  {&_swigt__p_Xapian__AssertionError, _p_Xapian__AssertionErrorTo_p_Xapian__Error, 0, 0},  {&_swigt__p_Xapian__DatabaseVersionError, _p_Xapian__DatabaseVersionErrorTo_p_Xapian__Error, 0, 0},  {&_swigt__p_Xapian__SerialisationError, _p_Xapian__SerialisationErrorTo_p_Xapian__Error, 0, 0},  {&_swigt__p_Xapian__Error, 0, 0, 0},  {&_swigt__p_Xapian__NetworkError, _p_Xapian__NetworkErrorTo_p_Xapian__Error, 0, 0},  {&_swigt__p_Xapian__InvalidArgumentError, _p_Xapian__InvalidArgumentErrorTo_p_Xapian__Error, 0, 0},  {&_swigt__p_Xapian__DatabaseCorruptError, _p_Xapian__DatabaseCorruptErrorTo_p_Xapian__Error, 0, 0},  {&_swigt__p_Xapian__QueryParserError, _p_Xapian__QueryParserErrorTo_p_Xapian__Error, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ExpandDecider[] = {  {&_swigt__p_Xapian__ExpandDecider, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__FeatureUnavailableError[] = {  {&_swigt__p_Xapian__FeatureUnavailableError, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__FixedWeightPostingSource[] = {  {&_swigt__p_Xapian__FixedWeightPostingSource, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__InternalError[] = {  {&_swigt__p_Xapian__InternalError, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__InvalidArgumentError[] = {  {&_swigt__p_Xapian__InvalidArgumentError, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__InvalidOperationError[] = {  {&_swigt__p_Xapian__InvalidOperationError, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__KeyMaker[] = {  {&_swigt__p_Xapian__Sorter, _p_Xapian__SorterTo_p_Xapian__KeyMaker, 0, 0},  {&_swigt__p_Xapian__MultiValueSorter, _p_Xapian__MultiValueSorterTo_p_Xapian__KeyMaker, 0, 0},  {&_swigt__p_Xapian__KeyMaker, 0, 0, 0},  {&_swigt__p_Xapian__MultiValueKeyMaker, _p_Xapian__MultiValueKeyMakerTo_p_Xapian__KeyMaker, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__LogicError[] = {  {&_swigt__p_Xapian__AssertionError, _p_Xapian__AssertionErrorTo_p_Xapian__LogicError, 0, 0},  {&_swigt__p_Xapian__InvalidOperationError, _p_Xapian__InvalidOperationErrorTo_p_Xapian__LogicError, 0, 0},  {&_swigt__p_Xapian__UnimplementedError, _p_Xapian__UnimplementedErrorTo_p_Xapian__LogicError, 0, 0},  {&_swigt__p_Xapian__LogicError, 0, 0, 0},  {&_swigt__p_Xapian__InvalidArgumentError, _p_Xapian__InvalidArgumentErrorTo_p_Xapian__LogicError, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__MSet[] = {  {&_swigt__p_Xapian__MSet, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__MSetIterator[] = {  {&_swigt__p_Xapian__MSetIterator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__MatchDecider[] = {  {&_swigt__p_Xapian__MatchDecider, 0, 0, 0},  {&_swigt__p_Xapian__ValueSetMatchDecider, _p_Xapian__ValueSetMatchDeciderTo_p_Xapian__MatchDecider, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__MatchSpy[] = {  {&_swigt__p_Xapian__MatchSpy, 0, 0, 0},  {&_swigt__p_Xapian__ValueCountMatchSpy, _p_Xapian__ValueCountMatchSpyTo_p_Xapian__MatchSpy, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__MultiValueKeyMaker[] = {  {&_swigt__p_Xapian__MultiValueKeyMaker, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__MultiValueSorter[] = {  {&_swigt__p_Xapian__MultiValueSorter, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__NetworkError[] = {  {&_swigt__p_Xapian__NetworkError, 0, 0, 0},  {&_swigt__p_Xapian__NetworkTimeoutError, _p_Xapian__NetworkTimeoutErrorTo_p_Xapian__NetworkError, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__NetworkTimeoutError[] = {  {&_swigt__p_Xapian__NetworkTimeoutError, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__NumberValueRangeProcessor[] = {  {&_swigt__p_Xapian__NumberValueRangeProcessor, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__PositionIterator[] = {  {&_swigt__p_Xapian__PositionIterator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__PostingIterator[] = {  {&_swigt__p_Xapian__PostingIterator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__PostingSource[] = {  {&_swigt__p_Xapian__PostingSource, 0, 0, 0},  {&_swigt__p_Xapian__ValuePostingSource, _p_Xapian__ValuePostingSourceTo_p_Xapian__PostingSource, 0, 0},  {&_swigt__p_Xapian__ValueWeightPostingSource, _p_Xapian__ValueWeightPostingSourceTo_p_Xapian__PostingSource, 0, 0},  {&_swigt__p_Xapian__DecreasingValueWeightPostingSource, _p_Xapian__DecreasingValueWeightPostingSourceTo_p_Xapian__PostingSource, 0, 0},  {&_swigt__p_Xapian__ValueMapPostingSource, _p_Xapian__ValueMapPostingSourceTo_p_Xapian__PostingSource, 0, 0},  {&_swigt__p_Xapian__FixedWeightPostingSource, _p_Xapian__FixedWeightPostingSourceTo_p_Xapian__PostingSource, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__Query[] = {  {&_swigt__p_Xapian__Query, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__QueryParser[] = {  {&_swigt__p_Xapian__QueryParser, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__QueryParserError[] = {  {&_swigt__p_Xapian__QueryParserError, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__RSet[] = {  {&_swigt__p_Xapian__RSet, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__RangeError[] = {  {&_swigt__p_Xapian__RangeError, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__Registry[] = {  {&_swigt__p_Xapian__Registry, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__RuntimeError[] = {  {&_swigt__p_Xapian__DocNotFoundError, _p_Xapian__DocNotFoundErrorTo_p_Xapian__RuntimeError, 0, 0},  {&_swigt__p_Xapian__DatabaseLockError, _p_Xapian__DatabaseLockErrorTo_p_Xapian__RuntimeError, 0, 0},  {&_swigt__p_Xapian__NetworkTimeoutError, _p_Xapian__NetworkTimeoutErrorTo_p_Xapian__RuntimeError, 0, 0},  {&_swigt__p_Xapian__FeatureUnavailableError, _p_Xapian__FeatureUnavailableErrorTo_p_Xapian__RuntimeError, 0, 0},  {&_swigt__p_Xapian__DatabaseCreateError, _p_Xapian__DatabaseCreateErrorTo_p_Xapian__RuntimeError, 0, 0},  {&_swigt__p_Xapian__InternalError, _p_Xapian__InternalErrorTo_p_Xapian__RuntimeError, 0, 0},  {&_swigt__p_Xapian__DatabaseModifiedError, _p_Xapian__DatabaseModifiedErrorTo_p_Xapian__RuntimeError, 0, 0},  {&_swigt__p_Xapian__DatabaseError, _p_Xapian__DatabaseErrorTo_p_Xapian__RuntimeError, 0, 0},  {&_swigt__p_Xapian__RangeError, _p_Xapian__RangeErrorTo_p_Xapian__RuntimeError, 0, 0},  {&_swigt__p_Xapian__RuntimeError, 0, 0, 0},  {&_swigt__p_Xapian__DatabaseOpeningError, _p_Xapian__DatabaseOpeningErrorTo_p_Xapian__RuntimeError, 0, 0},  {&_swigt__p_Xapian__SerialisationError, _p_Xapian__SerialisationErrorTo_p_Xapian__RuntimeError, 0, 0},  {&_swigt__p_Xapian__DatabaseVersionError, _p_Xapian__DatabaseVersionErrorTo_p_Xapian__RuntimeError, 0, 0},  {&_swigt__p_Xapian__NetworkError, _p_Xapian__NetworkErrorTo_p_Xapian__RuntimeError, 0, 0},  {&_swigt__p_Xapian__DatabaseCorruptError, _p_Xapian__DatabaseCorruptErrorTo_p_Xapian__RuntimeError, 0, 0},  {&_swigt__p_Xapian__QueryParserError, _p_Xapian__QueryParserErrorTo_p_Xapian__RuntimeError, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__SerialisationError[] = {  {&_swigt__p_Xapian__SerialisationError, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__SimpleStopper[] = {  {&_swigt__p_Xapian__SimpleStopper, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__Sorter[] = {  {&_swigt__p_Xapian__Sorter, 0, 0, 0},  {&_swigt__p_Xapian__MultiValueSorter, _p_Xapian__MultiValueSorterTo_p_Xapian__Sorter, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__Stem[] = {  {&_swigt__p_Xapian__Stem, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__StemImplementation[] = {  {&_swigt__p_Xapian__StemImplementation, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__Stopper[] = {  {&_swigt__p_Xapian__Stopper, 0, 0, 0},  {&_swigt__p_Xapian__SimpleStopper, _p_Xapian__SimpleStopperTo_p_Xapian__Stopper, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__StringValueRangeProcessor[] = {  {&_swigt__p_Xapian__StringValueRangeProcessor, 0, 0, 0},  {&_swigt__p_Xapian__DateValueRangeProcessor, _p_Xapian__DateValueRangeProcessorTo_p_Xapian__StringValueRangeProcessor, 0, 0},  {&_swigt__p_Xapian__NumberValueRangeProcessor, _p_Xapian__NumberValueRangeProcessorTo_p_Xapian__StringValueRangeProcessor, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__TermGenerator[] = {  {&_swigt__p_Xapian__TermGenerator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__TermIterator[] = {  {&_swigt__p_Xapian__TermIterator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__TradWeight[] = {  {&_swigt__p_Xapian__TradWeight, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__UnimplementedError[] = {  {&_swigt__p_Xapian__UnimplementedError, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ValueCountMatchSpy[] = {  {&_swigt__p_Xapian__ValueCountMatchSpy, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ValueIterator[] = {  {&_swigt__p_Xapian__ValueIterator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ValueMapPostingSource[] = {  {&_swigt__p_Xapian__ValueMapPostingSource, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ValuePostingSource[] = {  {&_swigt__p_Xapian__ValuePostingSource, 0, 0, 0},  {&_swigt__p_Xapian__ValueWeightPostingSource, _p_Xapian__ValueWeightPostingSourceTo_p_Xapian__ValuePostingSource, 0, 0},  {&_swigt__p_Xapian__DecreasingValueWeightPostingSource, _p_Xapian__DecreasingValueWeightPostingSourceTo_p_Xapian__ValuePostingSource, 0, 0},  {&_swigt__p_Xapian__ValueMapPostingSource, _p_Xapian__ValueMapPostingSourceTo_p_Xapian__ValuePostingSource, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ValueRangeProcessor[] = {  {&_swigt__p_Xapian__ValueRangeProcessor, 0, 0, 0},  {&_swigt__p_Xapian__StringValueRangeProcessor, _p_Xapian__StringValueRangeProcessorTo_p_Xapian__ValueRangeProcessor, 0, 0},  {&_swigt__p_Xapian__DateValueRangeProcessor, _p_Xapian__DateValueRangeProcessorTo_p_Xapian__ValueRangeProcessor, 0, 0},  {&_swigt__p_Xapian__NumberValueRangeProcessor, _p_Xapian__NumberValueRangeProcessorTo_p_Xapian__ValueRangeProcessor, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ValueSetMatchDecider[] = {  {&_swigt__p_Xapian__ValueSetMatchDecider, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ValueWeightPostingSource[] = {  {&_swigt__p_Xapian__ValueWeightPostingSource, 0, 0, 0},  {&_swigt__p_Xapian__DecreasingValueWeightPostingSource, _p_Xapian__DecreasingValueWeightPostingSourceTo_p_Xapian__ValueWeightPostingSource, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__Weight[] = {  {&_swigt__p_Xapian__BoolWeight, _p_Xapian__BoolWeightTo_p_Xapian__Weight, 0, 0},  {&_swigt__p_Xapian__TradWeight, _p_Xapian__TradWeightTo_p_Xapian__Weight, 0, 0},  {&_swigt__p_Xapian__Weight, 0, 0, 0},  {&_swigt__p_Xapian__BM25Weight, _p_Xapian__BM25WeightTo_p_Xapian__Weight, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__WritableDatabase[] = {  {&_swigt__p_Xapian__WritableDatabase, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_compaction_level[] = {  {&_swigt__p_compaction_level, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_docid_order[] = {  {&_swigt__p_docid_order, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_double[] = {  {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_feature_flag[] = {  {&_swigt__p_feature_flag, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_first_type[] = {  {&_swigt__p_first_type, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_op[] = {  {&_swigt__p_op, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_second_type[] = {  {&_swigt__p_second_type, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__string[] = {  {&_swigt__p_std__string, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_stem_strategy[] = {  {&_swigt__p_stem_strategy, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_unsigned_int[] = {  {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}};

static swig_cast_info *swig_cast_initial[] = {
  _swigc__p_Xapian__AssertionError,
  _swigc__p_Xapian__BM25Weight,
  _swigc__p_Xapian__BoolWeight,
  _swigc__p_Xapian__Compactor,
  _swigc__p_Xapian__Database,
  _swigc__p_Xapian__DatabaseCorruptError,
  _swigc__p_Xapian__DatabaseCreateError,
  _swigc__p_Xapian__DatabaseError,
  _swigc__p_Xapian__DatabaseLockError,
  _swigc__p_Xapian__DatabaseModifiedError,
  _swigc__p_Xapian__DatabaseOpeningError,
  _swigc__p_Xapian__DatabaseVersionError,
  _swigc__p_Xapian__DateValueRangeProcessor,
  _swigc__p_Xapian__DecreasingValueWeightPostingSource,
  _swigc__p_Xapian__DocNotFoundError,
  _swigc__p_Xapian__Document,
  _swigc__p_Xapian__ESet,
  _swigc__p_Xapian__ESetIterator,
  _swigc__p_Xapian__Enquire,
  _swigc__p_Xapian__Error,
  _swigc__p_Xapian__ExpandDecider,
  _swigc__p_Xapian__FeatureUnavailableError,
  _swigc__p_Xapian__FixedWeightPostingSource,
  _swigc__p_Xapian__InternalError,
  _swigc__p_Xapian__InvalidArgumentError,
  _swigc__p_Xapian__InvalidOperationError,
  _swigc__p_Xapian__KeyMaker,
  _swigc__p_Xapian__LogicError,
  _swigc__p_Xapian__MSet,
  _swigc__p_Xapian__MSetIterator,
  _swigc__p_Xapian__MatchDecider,
  _swigc__p_Xapian__MatchSpy,
  _swigc__p_Xapian__MultiValueKeyMaker,
  _swigc__p_Xapian__MultiValueSorter,
  _swigc__p_Xapian__NetworkError,
  _swigc__p_Xapian__NetworkTimeoutError,
  _swigc__p_Xapian__NumberValueRangeProcessor,
  _swigc__p_Xapian__PositionIterator,
  _swigc__p_Xapian__PostingIterator,
  _swigc__p_Xapian__PostingSource,
  _swigc__p_Xapian__Query,
  _swigc__p_Xapian__QueryParser,
  _swigc__p_Xapian__QueryParserError,
  _swigc__p_Xapian__RSet,
  _swigc__p_Xapian__RangeError,
  _swigc__p_Xapian__Registry,
  _swigc__p_Xapian__RuntimeError,
  _swigc__p_Xapian__SerialisationError,
  _swigc__p_Xapian__SimpleStopper,
  _swigc__p_Xapian__Sorter,
  _swigc__p_Xapian__Stem,
  _swigc__p_Xapian__StemImplementation,
  _swigc__p_Xapian__Stopper,
  _swigc__p_Xapian__StringValueRangeProcessor,
  _swigc__p_Xapian__TermGenerator,
  _swigc__p_Xapian__TermIterator,
  _swigc__p_Xapian__TradWeight,
  _swigc__p_Xapian__UnimplementedError,
  _swigc__p_Xapian__ValueCountMatchSpy,
  _swigc__p_Xapian__ValueIterator,
  _swigc__p_Xapian__ValueMapPostingSource,
  _swigc__p_Xapian__ValuePostingSource,
  _swigc__p_Xapian__ValueRangeProcessor,
  _swigc__p_Xapian__ValueSetMatchDecider,
  _swigc__p_Xapian__ValueWeightPostingSource,
  _swigc__p_Xapian__Weight,
  _swigc__p_Xapian__WritableDatabase,
  _swigc__p_compaction_level,
  _swigc__p_docid_order,
  _swigc__p_double,
  _swigc__p_feature_flag,
  _swigc__p_first_type,
  _swigc__p_int,
  _swigc__p_op,
  _swigc__p_second_type,
  _swigc__p_std__string,
  _swigc__p_stem_strategy,
  _swigc__p_unsigned_int,
};


/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */

/* -----------------------------------------------------------------------------
 * Type initialization:
 * This problem is tough by the requirement that no dynamic 
 * memory is used. Also, since swig_type_info structures store pointers to 
 * swig_cast_info structures and swig_cast_info structures store pointers back
 * to swig_type_info structures, we need some lookup code at initialization. 
 * The idea is that swig generates all the structures that are needed. 
 * The runtime then collects these partially filled structures. 
 * The SWIG_InitializeModule function takes these initial arrays out of 
 * swig_module, and does all the lookup, filling in the swig_module.types
 * array with the correct data and linking the correct swig_cast_info
 * structures together.
 *
 * The generated swig_type_info structures are assigned staticly to an initial 
 * array. We just loop through that array, and handle each type individually.
 * First we lookup if this type has been already loaded, and if so, use the
 * loaded structure instead of the generated one. Then we have to fill in the
 * cast linked list. The cast data is initially stored in something like a
 * two-dimensional array. Each row corresponds to a type (there are the same
 * number of rows as there are in the swig_type_initial array). Each entry in
 * a column is one of the swig_cast_info structures for that type.
 * The cast_initial array is actually an array of arrays, because each row has
 * a variable number of columns. So to actually build the cast linked list,
 * we find the array of casts associated with the type, and loop through it 
 * adding the casts to the list. The one last trick we need to do is making
 * sure the type pointer in the swig_cast_info struct is correct.
 *
 * First off, we lookup the cast->type name to see if it is already loaded. 
 * There are three cases to handle:
 *  1) If the cast->type has already been loaded AND the type we are adding
 *     casting info to has not been loaded (it is in this module), THEN we
 *     replace the cast->type pointer with the type pointer that has already
 *     been loaded.
 *  2) If BOTH types (the one we are adding casting info to, and the 
 *     cast->type) are loaded, THEN the cast info has already been loaded by
 *     the previous module so we just ignore it.
 *  3) Finally, if cast->type has not already been loaded, then we add that
 *     swig_cast_info to the linked list (because the cast->type) pointer will
 *     be correct.
 * ----------------------------------------------------------------------------- */

#ifdef __cplusplus
extern "C" {
#if 0
} /* c-mode */
#endif
#endif

#if 0
#define SWIGRUNTIME_DEBUG
#endif


SWIGRUNTIME void
SWIG_InitializeModule(void *clientdata) {
  size_t i;
  swig_module_info *module_head, *iter;
  int found, init;

  clientdata = clientdata;

  /* check to see if the circular list has been setup, if not, set it up */
  if (swig_module.next==0) {
    /* Initialize the swig_module */
    swig_module.type_initial = swig_type_initial;
    swig_module.cast_initial = swig_cast_initial;
    swig_module.next = &swig_module;
    init = 1;
  } else {
    init = 0;
  }

  /* Try and load any already created modules */
  module_head = SWIG_GetModule(clientdata);
  if (!module_head) {
    /* This is the first module loaded for this interpreter */
    /* so set the swig module into the interpreter */
    SWIG_SetModule(clientdata, &swig_module);
    module_head = &swig_module;
  } else {
    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
    found=0;
    iter=module_head;
    do {
      if (iter==&swig_module) {
        found=1;
        break;
      }
      iter=iter->next;
    } while (iter!= module_head);

    /* if the is found in the list, then all is done and we may leave */
    if (found) return;
    /* otherwise we must add out module into the list */
    swig_module.next = module_head->next;
    module_head->next = &swig_module;
  }

  /* When multiple interpeters are used, a module could have already been initialized in
     a different interpreter, but not yet have a pointer in this interpreter.
     In this case, we do not want to continue adding types... everything should be
     set up already */
  if (init == 0) return;

  /* Now work on filling in swig_module.types */
#ifdef SWIGRUNTIME_DEBUG
  printf("SWIG_InitializeModule: size %d\n", swig_module.size);
#endif
  for (i = 0; i < swig_module.size; ++i) {
    swig_type_info *type = 0;
    swig_type_info *ret;
    swig_cast_info *cast;
  
#ifdef SWIGRUNTIME_DEBUG
    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
#endif

    /* if there is another module already loaded */
    if (swig_module.next != &swig_module) {
      type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
    }
    if (type) {
      /* Overwrite clientdata field */
#ifdef SWIGRUNTIME_DEBUG
      printf("SWIG_InitializeModule: found type %s\n", type->name);
#endif
      if (swig_module.type_initial[i]->clientdata) {
	type->clientdata = swig_module.type_initial[i]->clientdata;
#ifdef SWIGRUNTIME_DEBUG
      printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
#endif
      }
    } else {
      type = swig_module.type_initial[i];
    }

    /* Insert casting types */
    cast = swig_module.cast_initial[i];
    while (cast->type) {
    
      /* Don't need to add information already in the list */
      ret = 0;
#ifdef SWIGRUNTIME_DEBUG
      printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
#endif
      if (swig_module.next != &swig_module) {
        ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
#ifdef SWIGRUNTIME_DEBUG
	if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
#endif
      }
      if (ret) {
	if (type == swig_module.type_initial[i]) {
#ifdef SWIGRUNTIME_DEBUG
	  printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
#endif
	  cast->type = ret;
	  ret = 0;
	} else {
	  /* Check for casting already in the list */
	  swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
#ifdef SWIGRUNTIME_DEBUG
	  if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
#endif
	  if (!ocast) ret = 0;
	}
      }

      if (!ret) {
#ifdef SWIGRUNTIME_DEBUG
	printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
#endif
        if (type->cast) {
          type->cast->prev = cast;
          cast->next = type->cast;
        }
        type->cast = cast;
      }
      cast++;
    }
    /* Set entry in modules->types array equal to the type */
    swig_module.types[i] = type;
  }
  swig_module.types[i] = 0;

#ifdef SWIGRUNTIME_DEBUG
  printf("**** SWIG_InitializeModule: Cast List ******\n");
  for (i = 0; i < swig_module.size; ++i) {
    int j = 0;
    swig_cast_info *cast = swig_module.cast_initial[i];
    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
    while (cast->type) {
      printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
      cast++;
      ++j;
    }
  printf("---- Total casts: %d\n",j);
  }
  printf("**** SWIG_InitializeModule: Cast List ******\n");
#endif
}

/* This function will propagate the clientdata field of type to
* any new swig_type_info structures that have been added into the list
* of equivalent types.  It is like calling
* SWIG_TypeClientData(type, clientdata) a second time.
*/
SWIGRUNTIME void
SWIG_PropagateClientData(void) {
  size_t i;
  swig_cast_info *equiv;
  static int init_run = 0;

  if (init_run) return;
  init_run = 1;

  for (i = 0; i < swig_module.size; i++) {
    if (swig_module.types[i]->clientdata) {
      equiv = swig_module.types[i]->cast;
      while (equiv) {
        if (!equiv->converter) {
          if (equiv->type && !equiv->type->clientdata)
            SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
        }
        equiv = equiv->next;
      }
    }
  }
}

#ifdef __cplusplus
#if 0
{ /* c-mode */
#endif
}
#endif



/* Forward declaration of where the user's %init{} gets inserted */
void SWIG_init_user(lua_State* L );
    
#ifdef __cplusplus
extern "C" {
#endif
/* this is the initialization function
  added at the very end of the code
  the function is always called SWIG_init, but an eariler #define will rename it
*/
SWIGEXPORT int SWIG_init(lua_State* L)
{
  int i;
  /* start with global table */
  lua_pushvalue(L,LUA_GLOBALSINDEX);
  /* SWIG's internal initalisation */
  SWIG_InitializeModule((void*)L);
  SWIG_PropagateClientData();
  /* add a global fn */
  SWIG_Lua_add_function(L,"swig_type",SWIG_Lua_type);
  SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_equal);
  /* begin the module (its a table with the same name as the module) */
  SWIG_Lua_module_begin(L,SWIG_name);
  /* add commands/functions */
  for (i = 0; swig_commands[i].name; i++){
    SWIG_Lua_module_add_function(L,swig_commands[i].name,swig_commands[i].func);
  }
  /* add variables */
  for (i = 0; swig_variables[i].name; i++){
    SWIG_Lua_module_add_variable(L,swig_variables[i].name,swig_variables[i].get,swig_variables[i].set);
  }
  /* set up base class pointers (the hierachy) */
  for (i = 0; swig_types[i]; i++){
    if (swig_types[i]->clientdata){
      SWIG_Lua_init_base_class(L,(swig_lua_class*)(swig_types[i]->clientdata));
    }
  }
  /* additional registration structs & classes in lua */
  for (i = 0; swig_types[i]; i++){
    if (swig_types[i]->clientdata){
      SWIG_Lua_class_register(L,(swig_lua_class*)(swig_types[i]->clientdata));
    }
  }
  /* constants */
  SWIG_Lua_InstallConstants(L,swig_constants);
  /* invoke user-specific initialization */
  SWIG_init_user(L);
  /* end module */
  return 1;
}

#ifdef __cplusplus
}
#endif


const char* SWIG_LUACODE=
  "\n"
  "function xapian.Iterator(begin, _end)\n"
  "	local iter = begin;\n"
  "	local isFirst = 1\n"
  "	return function()\n"
  "		if iter:equals(_end) then\n"
  "			return nil\n"
  "		else\n"
  "			if isFirst == 1 then\n"
  "				isFirst = 0;\n"
  "				return iter\n"
  "			else\n"
  "				iter:next()\n"
  "				if iter:equals(_end) then\n"
  "					return nil\n"
  "				end\n"
  "				return iter\n"
  "			end\n"
  "		end\n"
  "	end\n"
  "end";

void SWIG_init_user(lua_State* L)
{
  /* exec Lua code if applicable */
  SWIG_Lua_dostring(L,SWIG_LUACODE);
}

