/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 3.0.13
 *
 * 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.
 * ----------------------------------------------------------------------------- */


#ifndef SWIGLUA
#define SWIGLUA
#endif

#define SWIG_LUA_TARGET SWIG_LUA_FLAVOR_LUA
#define SWIG_LUA_MODULE_GLOBAL


#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 defined(__GNUC__)
#  if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
#    ifndef GCC_HASCLASSVISIBILITY
#      define GCC_HASCLASSVISIBILITY
#    endif
#  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

/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
#endif

/* Intel's compiler complains if a variable which was never initialised is
 * cast to void, which is a common idiom which we use to indicate that we
 * are aware a variable isn't used.  So we just silence that warning.
 * See: https://github.com/swig/swig/issues/192 for more discussion.
 */
#ifdef __INTEL_COMPILER
# pragma warning disable 592
#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(r) (r)
#  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 equal, -1 if nb < tb, 1 if nb > tb
*/
SWIGRUNTIME int
SWIG_TypeCmp(const char *nb, const char *tb) {
  int equiv = 1;
  const char* te = tb + strlen(tb);
  const char* ne = nb;
  while (equiv != 0 && *ne) {
    for (nb = ne; *ne; ++ne) {
      if (*ne == '|') break;
    }
    equiv = SWIG_TypeNameComp(nb, ne, tb, te);
    if (*ne) ++ne;
  }
  return equiv;
}

/*
  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) {
  return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
}

/*
  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) {
      size_t l = 0;
      size_t r = iter->size - 1;
      do {
	/* since l+r >= 0, we can (>> 1) instead (/ 2) */
	size_t i = (l + r) >> 1;
	const char *iname = iter->types[i]->name;
	if (iname) {
	  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 {
      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";
  const unsigned char *u = (unsigned char *) ptr;
  const unsigned char *eu =  u + sz;
  for (; u != eu; ++u) {
    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) {
  unsigned char *u = (unsigned char *) ptr;
  const unsigned char *eu = u + sz;
  for (; u != eu; ++u) {
    char d = *(c++);
    unsigned char uu;
    if ((d >= '0') && (d <= '9'))
      uu = (unsigned char)((d - '0') << 4);
    else if ((d >= 'a') && (d <= 'f'))
      uu = (unsigned char)((d - ('a'-10)) << 4);
    else
      return (char *) 0;
    d = *(c++);
    if ((d >= '0') && (d <= '9'))
      uu |= (unsigned char)(d - '0');
    else if ((d >= 'a') && (d <= 'f'))
      uu |= (unsigned char)(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 */

/* -----------------------------------------------------------------------------
 * Lua flavors
 * ----------------------------------------------------------------------------- */

#define SWIG_LUA_FLAVOR_LUA 1
#define SWIG_LUA_FLAVOR_ELUA 2
#define SWIG_LUA_FLAVOR_ELUAC 3

#if !defined(SWIG_LUA_TARGET)
# error SWIG_LUA_TARGET not defined
#endif

#if defined(SWIG_LUA_ELUA_EMULATE)

struct swig_elua_entry;

typedef struct swig_elua_key {
  int type;
  union {
    const char* strkey;
    lua_Number numkey;
  } key;
} swig_elua_key;

typedef struct swig_elua_val {
  int type;
  union {
    lua_Number number;
    const struct swig_elua_entry *table;
    const char *string;
    lua_CFunction function;
    struct {
      char member;
      long lvalue;
      void *pvalue;
      swig_type_info **ptype;
    } userdata;
  } value;
} swig_elua_val;

typedef struct swig_elua_entry {
  swig_elua_key key;
  swig_elua_val value;
} swig_elua_entry;

#define LSTRKEY(x) {LUA_TSTRING, {.strkey = x} }
#define LNUMKEY(x) {LUA_TNUMBER, {.numkey = x} }
#define LNILKEY {LUA_TNIL, {.strkey = 0} }

#define LNUMVAL(x) {LUA_TNUMBER, {.number = x} }
#define LFUNCVAL(x) {LUA_TFUNCTION, {.function = x} }
#define LROVAL(x) {LUA_TTABLE, {.table = x} }
#define LNILVAL {LUA_TNIL, {.string = 0} }
#define LSTRVAL(x) {LUA_TSTRING, {.string = x} }

#define LUA_REG_TYPE swig_elua_entry

#define SWIG_LUA_ELUA_EMUL_METATABLE_KEY "__metatable"

#define lua_pushrotable(L,p)\
  lua_newtable(L);\
  assert(p);\
  SWIG_Lua_elua_emulate_register(L,(swig_elua_entry*)(p));

#define SWIG_LUA_CONSTTAB_POINTER(B,C,D)\
  LSTRKEY(B), {LUA_TUSERDATA, { .userdata={0,0,(void*)(C),&D} } }

#define SWIG_LUA_CONSTTAB_BINARY(B,S,C,D)\
  LSTRKEY(B), {LUA_TUSERDATA, { .userdata={1,S,(void*)(C),&D} } }
#endif

#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
#  define SWIG_LUA_CONSTTAB_INT(B, C) LSTRKEY(B), LNUMVAL(C)
#  define SWIG_LUA_CONSTTAB_FLOAT(B, C) LSTRKEY(B), LNUMVAL(C)
#  define SWIG_LUA_CONSTTAB_STRING(B, C) LSTRKEY(B), LSTRVAL(C)
#  define SWIG_LUA_CONSTTAB_CHAR(B, C) LSTRKEY(B), LNUMVAL(C)
    /* Those two types of constants are not supported in elua */

#ifndef SWIG_LUA_CONSTTAB_POINTER
#warning eLua does not support pointers as constants. By default, nil will be used as value
#define SWIG_LUA_CONSTTAB_POINTER(B,C,D) LSTRKEY(B), LNILVAL
#endif

#ifndef SWIG_LUA_CONSTTAB_BINARY
#warning eLua does not support pointers to member as constants. By default, nil will be used as value
#define SWIG_LUA_CONSTTAB_BINARY(B, S, C, D) LSTRKEY(B), LNILVAL
#endif
#else /* SWIG_LUA_FLAVOR_LUA */
#  define SWIG_LUA_CONSTTAB_INT(B, C) SWIG_LUA_INT, (char *)B, (long)C, 0, 0, 0
#  define SWIG_LUA_CONSTTAB_FLOAT(B, C) SWIG_LUA_FLOAT, (char *)B, 0, (double)C, 0, 0
#  define SWIG_LUA_CONSTTAB_STRING(B, C) SWIG_LUA_STRING, (char *)B, 0, 0, (void *)C, 0
#  define SWIG_LUA_CONSTTAB_CHAR(B, C) SWIG_LUA_CHAR, (char *)B, (long)C, 0, 0, 0
#  define SWIG_LUA_CONSTTAB_POINTER(B,C,D)\
       SWIG_LUA_POINTER, (char *)B, 0, 0, (void *)C, &D
#  define SWIG_LUA_CONSTTAB_BINARY(B, S, C, D)\
       SWIG_LUA_BINARY,  (char *)B, S, 0, (void *)C, &D
#endif

#ifndef SWIG_LUA_ELUA_EMULATE
#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
#  define LRO_STRVAL(v) {{.p = (char *) v}, LUA_TSTRING}
#  define LSTRVAL LRO_STRVAL
#endif
#endif /* SWIG_LUA_ELUA_EMULATE*/

#ifndef SWIG_LUA_ELUA_EMULATE
#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)

#ifndef MIN_OPT_LEVEL
#define MIN_OPT_LEVEL 2
#endif

#include "lrodefs.h"
#include "lrotable.h"
#endif
#endif /* SWIG_LUA_ELUA_EMULATE*/
/* -----------------------------------------------------------------------------
 * compatibility defines
 * ----------------------------------------------------------------------------- */

/* History of Lua C API length functions:  In Lua 5.0 (and before?)
   there was "lua_strlen".  In Lua 5.1, this was renamed "lua_objlen",
   but a compatibility define of "lua_strlen" was added.  In Lua 5.2,
   this function was again renamed, to "lua_rawlen" (to emphasize that
   it doesn't call the "__len" metamethod), and the compatibility
   define of lua_strlen was removed.  All SWIG uses have been updated
   to "lua_rawlen", and we add our own defines of that here for older
   versions of Lua.  */
#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501
# define lua_rawlen lua_strlen
#elif LUA_VERSION_NUM == 501
# define lua_rawlen lua_objlen
#endif


/* lua_pushglobaltable is the recommended "future-proof" way to get
   the global table for Lua 5.2 and later.  Here we define
   lua_pushglobaltable ourselves for Lua versions before 5.2.  */
#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
# define lua_pushglobaltable(L) lua_pushvalue(L, LUA_GLOBALSINDEX)
#endif

/* lua_absindex was introduced in Lua 5.2 */
#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
# define lua_absindex(L,i) ((i)>0 || (i) <= LUA_REGISTRYINDEX ? (i) : lua_gettop(L) + (i) + 1)
#endif

/* lua_rawsetp was introduced in Lua 5.2 */
#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
#define lua_rawsetp(L,index,ptr)\
  lua_pushlightuserdata(L,(void*)(ptr));\
  lua_insert(L,-2);\
  lua_rawset(L,index);

#define lua_rawgetp(L,index,ptr)\
  lua_pushlightuserdata(L,(void*)(ptr));\
  lua_rawget(L,index);

#endif

/* --------------------------------------------------------------------------
 * Helper functions for error handling
 * -------------------------------------------------------------------------- */

/* Push the string STR on the Lua stack, like lua_pushstring, but
   prefixed with the the location of the innermost Lua call-point
   (as formated by luaL_where).  */
SWIGRUNTIME void
SWIG_Lua_pusherrstring (lua_State *L, const char *str)
{
  luaL_where (L, 1);
  lua_pushstring (L, str);
  lua_concat (L, 2);
}

/* Push a formatted string generated from FMT and following args on
   the Lua stack, like lua_pushfstring, but prefixed with the the
   location of the innermost Lua call-point (as formated by luaL_where).  */
SWIGRUNTIME void
SWIG_Lua_pushferrstring (lua_State *L, const char *fmt, ...)
{
  va_list argp;
  va_start(argp, fmt);
  luaL_where(L, 1);
  lua_pushvfstring(L, fmt, argp);
  va_end(argp);
  lua_concat(L, 2);
}


/* -----------------------------------------------------------------------------
 * 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;

#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
typedef const LUA_REG_TYPE swig_lua_method;
typedef const LUA_REG_TYPE swig_lua_const_info;
#else /* Normal lua */
typedef luaL_Reg swig_lua_method;

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

#endif

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


struct swig_lua_class;
/* Can be used to create namespaces. Currently used to wrap class static methods/variables/constants */
typedef struct swig_lua_namespace {
  const char            *name;
  swig_lua_method       *ns_methods;
  swig_lua_attribute    *ns_attributes;
  swig_lua_const_info   *ns_constants;
  struct swig_lua_class        **ns_classes;
  struct swig_lua_namespace    **ns_namespaces;
} swig_lua_namespace;

typedef struct swig_lua_class {
  const char    *name; /* Name that this class has in Lua */
  const char    *fqname; /* Fully qualified name - Scope + class name */
  swig_type_info   **type;
  lua_CFunction  constructor;
  void    (*destructor)(void *);
  swig_lua_method   *methods;
  swig_lua_attribute     *attributes;
  swig_lua_namespace    *cls_static;
  swig_lua_method   *metatable; /* 0 for -eluac */
  struct swig_lua_class **bases;
  const char **base_names;
} swig_lua_class;

/* this is the struct for wrapping 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 arbitrary 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)) { SWIG_Lua_pusherrstring(L, (char *) msg); goto fail; } else


/* helper #defines */
#define SWIG_fail {goto fail;}
#define SWIG_fail_arg(func_name,argnum,type) \
  {SWIG_Lua_pushferrstring(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) \
  {SWIG_Lua_pushferrstring(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))

#define SWIG_Lua_add_boolean(L,n,b) \
  (lua_pushstring(L, n), \
      lua_pushboolean(L, b), \
      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 action 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 */
  luaL_error(L,"This variable is immutable");
#endif
    return 0;   /* should not return anything */
}

#ifdef SWIG_LUA_ELUA_EMULATE

SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State *L,void *ptr,swig_type_info *type, int own);
SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State *L,void *ptr,size_t size,swig_type_info *type);
static int swig_lua_elua_emulate_unique_key;

/* This function emulates eLua rotables behaviour. It loads a rotable definition into the usual lua table. */
SWIGINTERN void SWIG_Lua_elua_emulate_register(lua_State *L, const swig_elua_entry *table)
{
  int i, table_parsed, parsed_tables_array, target_table;
  assert(lua_istable(L,-1));
  target_table = lua_gettop(L);
  /* Get the registry where we put all parsed tables to avoid loops */
  lua_rawgetp(L, LUA_REGISTRYINDEX, &swig_lua_elua_emulate_unique_key);
  if(lua_isnil(L,-1)) {
    lua_pop(L,1);
    lua_newtable(L);
    lua_pushvalue(L,-1);
    lua_rawsetp(L,LUA_REGISTRYINDEX,(void*)(&swig_lua_elua_emulate_unique_key));
  }
  parsed_tables_array = lua_gettop(L);
  lua_pushvalue(L,target_table);
  lua_rawsetp(L, parsed_tables_array, table);
  table_parsed = 0;
  const int SWIGUNUSED pairs_start = lua_gettop(L);
  for(i = 0;table[i].key.type != LUA_TNIL || table[i].value.type != LUA_TNIL;i++)
  {
    const swig_elua_entry *entry = table + i;
    int is_metatable = 0;
    switch(entry->key.type) {
      case LUA_TSTRING:
        lua_pushstring(L,entry->key.key.strkey);
        if(strcmp(entry->key.key.strkey, SWIG_LUA_ELUA_EMUL_METATABLE_KEY) == 0)
          is_metatable = 1;
        break;
      case  LUA_TNUMBER:
        lua_pushnumber(L,entry->key.key.numkey);
        break;
      case LUA_TNIL:
        lua_pushnil(L);
        break;
      default:
        assert(0);
    }
    switch(entry->value.type) {
      case LUA_TSTRING:
        lua_pushstring(L,entry->value.value.string);
        break;
      case  LUA_TNUMBER:
        lua_pushnumber(L,entry->value.value.number);
        break;
      case LUA_TFUNCTION:
        lua_pushcfunction(L,entry->value.value.function);
        break;
      case LUA_TTABLE:
        lua_rawgetp(L,parsed_tables_array, entry->value.value.table);
        table_parsed = !lua_isnil(L,-1);
        if(!table_parsed) {
          lua_pop(L,1); /*remove nil */
          lua_newtable(L);
          SWIG_Lua_elua_emulate_register(L,entry->value.value.table);
        } 
        if(is_metatable) {
          assert(lua_istable(L,-1));
          lua_pushvalue(L,-1);
          lua_setmetatable(L,target_table);
        }

        break;
      case LUA_TUSERDATA:
        if(entry->value.value.userdata.member) 
          SWIG_NewMemberObj(L,entry->value.value.userdata.pvalue,
              entry->value.value.userdata.lvalue,
              *(entry->value.value.userdata.ptype));
        else 
          SWIG_NewPointerObj(L,entry->value.value.userdata.pvalue,
              *(entry->value.value.userdata.ptype),0);
        break;
      case LUA_TNIL:
        lua_pushnil(L);
        break;
      default:
        assert(0);
    }
    assert(lua_gettop(L) == pairs_start + 2);
    lua_rawset(L,target_table);
  }
  lua_pop(L,1); /* Removing parsed tables storage */
  assert(lua_gettop(L) == target_table);
}

SWIGINTERN void SWIG_Lua_elua_emulate_register_clear(lua_State *L)
{
  lua_pushnil(L);
  lua_rawsetp(L, LUA_REGISTRYINDEX, &swig_lua_elua_emulate_unique_key);
}

SWIGINTERN void SWIG_Lua_get_class_registry(lua_State *L);

SWIGINTERN int SWIG_Lua_emulate_elua_getmetatable(lua_State *L)
{
  SWIG_check_num_args("getmetatable(SWIG eLua emulation)", 1, 1);
  SWIG_Lua_get_class_registry(L);
  lua_getfield(L,-1,"lua_getmetatable");
  lua_remove(L,-2); /* remove the registry*/
  assert(!lua_isnil(L,-1));
  lua_pushvalue(L,1);
  assert(lua_gettop(L) == 3); /* object | function | object again */
  lua_call(L,1,1);
  if(!lua_isnil(L,-1)) /*There is an ordinary metatable */
    return 1;
  /*if it is a table, then emulate elua behaviour - check for __metatable attribute of a table*/
  assert(lua_gettop(L) == 2);
  if(lua_istable(L,-2)) {
    lua_pop(L,1); /*remove the nil*/
    lua_getfield(L,-1, SWIG_LUA_ELUA_EMUL_METATABLE_KEY);
  }
  assert(lua_gettop(L) == 2);
  return 1;
  
fail:
  lua_error(L);
  return 0;
}

SWIGINTERN void SWIG_Lua_emulate_elua_swap_getmetatable(lua_State *L)
{
  SWIG_Lua_get_class_registry(L);
  lua_pushglobaltable(L);
  lua_pushstring(L,"lua_getmetatable");
  lua_getfield(L,-2,"getmetatable");
  assert(!lua_isnil(L,-1));
  lua_rawset(L,-4);
  lua_pushstring(L, "getmetatable");
  lua_pushcfunction(L, SWIG_Lua_emulate_elua_getmetatable);
  lua_rawset(L,-3);
  lua_pop(L,2);
      
}
/* END OF REMOVE */

#endif
/* -----------------------------------------------------------------------------
 * global variable support code: namespaces and modules (which are the same thing)
 * ----------------------------------------------------------------------------- */

SWIGINTERN int SWIG_Lua_namespace_get(lua_State *L)
{
/*  there should be 2 params passed in
  (1) table (not the meta table)
  (2) string name of the attribute
*/
  assert(lua_istable(L,-2));  /* just in case */
  lua_getmetatable(L,-2);
  assert(lua_istable(L,-1));
  SWIG_Lua_get_table(L,".get"); /* find the .get table */
  assert(lua_istable(L,-1));
  /* 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_call(L,0,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: whether it's 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 */
  return 0;
}

SWIGINTERN int SWIG_Lua_namespace_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
*/

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

  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,3);  /* value */
      lua_call(L,1,0);
      return 0;
    }
    lua_pop(L,1);  /* remove the value */
  }
  lua_pop(L,1);  /* remove the value .set table */
  lua_pop(L,1); /* remote metatable */
  lua_rawset(L,-3);
  return 0;
}

#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) /* In elua this is useless */
SWIGINTERN void SWIG_Lua_InstallConstants(lua_State *L, swig_lua_const_info constants[]); /* forward declaration */
SWIGINTERN void  SWIG_Lua_add_variable(lua_State *L,const char *name,lua_CFunction getFn,lua_CFunction setFn); /* forward declaration */
SWIGINTERN void  SWIG_Lua_class_register(lua_State *L,swig_lua_class *clss);

/* helper function - register namespace methods and attributes into namespace */
SWIGINTERN int SWIG_Lua_add_namespace_details(lua_State *L, swig_lua_namespace *ns)
{
  int i;
  /* There must be namespace table (not metatable) at the top of the stack */
  assert(lua_istable(L,-1));
  SWIG_Lua_InstallConstants(L, ns->ns_constants);

  /* add methods to the namespace/module table */
  for(i=0;ns->ns_methods[i].name;i++){
    SWIG_Lua_add_function(L,ns->ns_methods[i].name,ns->ns_methods[i].func);
  }
  lua_getmetatable(L,-1);

  /* add fns */
  for(i=0;ns->ns_attributes[i].name;i++){
    SWIG_Lua_add_variable(L,ns->ns_attributes[i].name,ns->ns_attributes[i].getmethod,ns->ns_attributes[i].setmethod);
  }

  /* clear stack - remove metatble */
  lua_pop(L,1);
  return 0;
}

/* Register all classes in the namespace */
SWIGINTERN void SWIG_Lua_add_namespace_classes(lua_State *L, swig_lua_namespace *ns)
{
  swig_lua_class **classes;

  /* There must be a module/namespace table at the top of the stack */
  assert(lua_istable(L,-1));

  classes = ns->ns_classes;

  if( classes != 0 ) {
    while(*classes != 0) {
      SWIG_Lua_class_register(L, *classes);
      classes++;
    }
  }
}

/* Helper function. Creates namespace table and adds it to module table
   if 'reg' is true, then will register namespace table to parent one (must be on top of the stack
   when function is called).
   Function always returns newly registered table on top of the stack.
*/
SWIGINTERN void SWIG_Lua_namespace_register(lua_State *L, swig_lua_namespace *ns, int reg)
{
  swig_lua_namespace **sub_namespace;
  /* 1 argument - table on the top of the stack */
  const int SWIGUNUSED begin = lua_gettop(L);
  assert(lua_istable(L,-1)); /* just in case. This is supposed to be module table or parent namespace table */
  lua_checkstack(L,5);
  lua_newtable(L); /* namespace itself */
  lua_newtable(L); /* metatable for namespace */

  /* 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_namespace_get);
  SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_namespace_set);

  lua_setmetatable(L,-2); /* set metatable */

  /* Register all functions, variables etc */
  SWIG_Lua_add_namespace_details(L,ns);
  /* Register classes */
  SWIG_Lua_add_namespace_classes(L,ns);

  sub_namespace = ns->ns_namespaces;
  if( sub_namespace != 0) {
    while(*sub_namespace != 0) {
      SWIG_Lua_namespace_register(L, *sub_namespace, 1);
      lua_pop(L,1); /* removing sub-namespace table */
      sub_namespace++;
    }
  }

  if (reg) {
    lua_pushstring(L,ns->name);
    lua_pushvalue(L,-2);
    lua_rawset(L,-4); /* add namespace to module table */
  }
  assert(lua_gettop(L) == begin+1);
}
#endif /* SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA */

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

SWIGINTERN void  SWIG_Lua_get_class_metatable(lua_State *L,const char *cname);

typedef int (*swig_lua_base_iterator_func)(lua_State*,swig_type_info*, int, int *ret);

SWIGINTERN int SWIG_Lua_iterate_bases(lua_State *L, swig_type_info * SWIGUNUSED swig_type,
  int first_arg, swig_lua_base_iterator_func func, int  *const ret)
{
    /* first_arg - position of the object in stack. Everything that is above are arguments
     * and is passed to every evocation of the func */
    int last_arg = lua_gettop(L);/* position of last argument */
    int original_metatable = last_arg + 1;
    size_t bases_count;
    int result = SWIG_ERROR;
    int bases_table;
    (void)swig_type;
    lua_getmetatable(L,first_arg);

    /* initialise base search */
#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
    SWIG_Lua_get_table(L,".bases");
    assert(lua_istable(L,-1));
    bases_count = lua_rawlen(L,-1);
    bases_table = lua_gettop(L);
#else
    /* In elua .bases table doesn't exist. Use table from swig_lua_class */
    (void)bases_table;
    assert(swig_type!=0);
    swig_module_info *module=SWIG_GetModule(L);
    swig_lua_class **bases= ((swig_lua_class*)(swig_type->clientdata))->bases;
    const char **base_names= ((swig_lua_class*)(swig_type->clientdata))->base_names;
    bases_count = 0;
    for(;base_names[bases_count];
      bases_count++);/* get length of bases */
#endif

    if(ret)
      *ret = 0;
    if(bases_count>0)
    {
      int to_remove;
      size_t i;
      int j;
      int subcall_last_arg;
      int subcall_first_arg = lua_gettop(L) + 1;/* Here a copy of first_arg and arguments begin */
      int valid = 1;
      swig_type_info *base_swig_type = 0;
      for(j=first_arg;j<=last_arg;j++)
        lua_pushvalue(L,j);
      subcall_last_arg = lua_gettop(L);

      /* Trick: temporarily replacing original metatable with metatable for base class and call getter */
      for(i=0;i<bases_count;i++) {
        /* Iteration through class bases */
#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
        lua_rawgeti(L,bases_table,i+1);
        base_swig_type = 0;
        if(lua_isnil(L,-1)) {
          valid = 0;
          lua_pop(L,1);
        } else {
          valid = 1;
        }
#else /* In elua .bases table doesn't exist. Use table from swig_lua_class */
        swig_lua_class *base_class = bases[i];
        if(!base_class) {
          valid = 0;
        } else {
          valid = 1;
          SWIG_Lua_get_class_metatable(L,base_class->fqname);
          base_swig_type = SWIG_TypeQueryModule(module,module,base_names[i]);
          assert(base_swig_type != 0);
        }
#endif

        if(!valid)
          continue;
        assert(lua_isuserdata(L, subcall_first_arg));
        assert(lua_istable(L,-1));
        lua_setmetatable(L,subcall_first_arg); /* Set new metatable */
        assert(lua_gettop(L) == subcall_last_arg);
        result = func(L, base_swig_type,subcall_first_arg, ret); /* Forward call */
        if(result != SWIG_ERROR) {
          break;
        }
      }
      /* Restore original metatable */
      lua_pushvalue(L,original_metatable);
      lua_setmetatable(L,first_arg);
      /* Clear - remove everything between last_arg and subcall_last_arg including */
      to_remove = subcall_last_arg - last_arg;
      for(j=0;j<to_remove;j++)
        lua_remove(L,last_arg+1);
    } else {
      /* Remove everything after last_arg */
      lua_pop(L, lua_gettop(L) - last_arg);
    }
    if(ret) assert(lua_gettop(L) == last_arg + *ret);
    return result;
}

/* The class.get method helper, performs the lookup of class attributes.
 * It returns an error code. Number of function return values is passed inside 'ret'.
 * first_arg is not used in this function because function always has 2 arguments.
 */
SWIGINTERN int  SWIG_Lua_class_do_get_item(lua_State *L, swig_type_info *type, int SWIGUNUSED first_arg, int *ret)
{
/*  there should be 2 params passed in
  (1) userdata (not the meta table)
  (2) string name of the attribute
*/
  int bases_search_result;
  int substack_start = lua_gettop(L)-2;
  assert(first_arg == substack_start+1);
  lua_checkstack(L,5);
  assert(lua_isuserdata(L,-2));  /* just in case */
  lua_getmetatable(L,-2);    /* get the meta table */
  assert(lua_istable(L,-1));  /* just in case */
  /* 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,substack_start+1);  /* the userdata */
    lua_pushvalue(L,substack_start+2);  /* the parameter */
    lua_call(L,2,1);  /* 2 value in (userdata),1 out (result) */
    lua_remove(L,-2); /* stack tidy, remove metatable */
    if(ret) *ret = 1;
    return SWIG_OK;
  }
  lua_pop(L,1);
  /* Remove the metatable */
  lua_pop(L,1);
  /* Search in base classes */
  bases_search_result = SWIG_Lua_iterate_bases(L,type,substack_start+1,SWIG_Lua_class_do_get_item,ret);
  return bases_search_result;  /* sorry not known */
}


/* The class.get method helper, performs the lookup of class attributes.
 * It returns an error code. Number of function return values is passed inside 'ret'.
 * first_arg is not used in this function because function always has 2 arguments.
 */
SWIGINTERN int  SWIG_Lua_class_do_get(lua_State *L, swig_type_info *type, int SWIGUNUSED first_arg, int *ret)
{
/*  there should be 2 params passed in
  (1) userdata (not the meta table)
  (2) string name of the attribute
*/
  int bases_search_result;
  int substack_start = lua_gettop(L)-2;
  assert(first_arg == substack_start+1);
  lua_checkstack(L,5);
  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,substack_start+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,substack_start+1);  /* the userdata */
    lua_call(L,1,1);  /* 1 value in (userdata),1 out (result) */
    lua_remove(L,-2); /* stack tidy, remove metatable */
    if(ret)
      *ret = 1;
    return SWIG_OK;
  }
  lua_pop(L,1);  /* remove whatever was there */
  /* ok, so try the .fn table */
  SWIG_Lua_get_table(L,".fn"); /* find the .fn table */
  assert(lua_istable(L,-1));  /* just in case */
  lua_pushvalue(L,substack_start+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 */
    if(ret)
      *ret = 1;
    return SWIG_OK;
  }
  lua_pop(L,1);  /* remove whatever was there */
  /* Remove the metatable */
  lua_pop(L,1);
  /* Search in base classes */
  bases_search_result = SWIG_Lua_iterate_bases(L,type,substack_start+1,SWIG_Lua_class_do_get,ret);
  return bases_search_result;  /* sorry not known */
}

/* 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
*/
  int result;
  swig_lua_userdata *usr;
  swig_type_info *type;
  int ret = 0;
  assert(lua_isuserdata(L,1));
  usr=(swig_lua_userdata*)lua_touserdata(L,1);  /* get data */
  type = usr->type;
  result = SWIG_Lua_class_do_get(L,type,1,&ret);
  if(result == SWIG_OK)
    return ret;

  result = SWIG_Lua_class_do_get_item(L,type,1,&ret);
  if(result == SWIG_OK)
    return ret;

  return 0;
}

/* helper for the class.set method, performs the lookup of class attributes
 * It returns error code. Number of function return values is passed inside 'ret'
 */
SWIGINTERN int  SWIG_Lua_class_do_set(lua_State *L, swig_type_info *type, int first_arg, int *ret)
{
/*  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
  */

  int bases_search_result;
  int substack_start = lua_gettop(L) - 3;
  lua_checkstack(L,5);
  assert(lua_isuserdata(L,substack_start+1));  /* just in case */
  lua_getmetatable(L,substack_start+1);    /* get the meta table */
  assert(lua_istable(L,-1));  /* just in case */
  if(ret)
    *ret = 0; /* it is setter - number of return values is always 0 */

  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,substack_start+2);  /* key */
    lua_rawget(L,-2);
    lua_remove(L,-2); /* tidy stack, remove .set table */
    if (lua_iscfunction(L,-1))
    {  /* found it so call the fn & return its value */
      lua_pushvalue(L,substack_start+1);  /* userdata */
      lua_pushvalue(L,substack_start+3);  /* value */
      lua_call(L,2,0);
      lua_remove(L,substack_start+4); /*remove metatable*/
      return SWIG_OK;
    }
    lua_pop(L,1);  /* remove the value */
  } else {
    lua_pop(L,1);  /* remove the answer for .set table request*/
  }
  /* 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,substack_start+1);  /* the userdata */
    lua_pushvalue(L,substack_start+2);  /* the parameter */
    lua_pushvalue(L,substack_start+3);  /* the value */
    lua_call(L,3,0);  /* 3 values in ,0 out */
    lua_remove(L,-2); /* stack tidy, remove metatable */
    return SWIG_OK;
  }
  lua_pop(L,1); /* remove value */

  lua_pop(L,1); /* remove metatable */
  /* Search among bases */
  bases_search_result = SWIG_Lua_iterate_bases(L,type,first_arg,SWIG_Lua_class_do_set,ret);
  if(ret)
    assert(*ret == 0);
  assert(lua_gettop(L) == substack_start + 3);
  return bases_search_result;
}

/* This is the actual method exported to Lua. It calls SWIG_Lua_class_do_set and correctly
 * handles return values.
 */
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
  */
  int ret = 0;
  int result;
  swig_lua_userdata *usr;
  swig_type_info *type;
  assert(lua_isuserdata(L,1));
  usr=(swig_lua_userdata*)lua_touserdata(L,1);  /* get data */
  type = usr->type;
  result = SWIG_Lua_class_do_set(L,type,1,&ret);
  if(result != SWIG_OK) {
   SWIG_Lua_pushferrstring(L,"Assignment not possible. No setter/member with this name. For custom assignments implement __setitem method.");
   lua_error(L);
  } else {
    assert(ret==0);
  }
  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;
}

/* the class.__tostring method called by the interpreter and print */
SWIGINTERN int  SWIG_Lua_class_tostring(lua_State *L)
{
/*  there should be 1 param passed in
  (1) userdata (not the metatable) */
  const char *className;
  void* userData;
  assert(lua_isuserdata(L,1));  /* just in case */
  userData = lua_touserdata(L,1); /* get the userdata address for later */
  lua_getmetatable(L,1);    /* get the meta table */
  assert(lua_istable(L,-1));  /* just in case */

  lua_getfield(L, -1, ".type");
  className = lua_tostring(L, -1);

  lua_pushfstring(L, "<%s userdata: %p>", className, userData);
  return 1;
}

/* to manually disown some userdata */
SWIGINTERN int  SWIG_Lua_class_disown(lua_State *L)
{
/*  there should be 1 params passed in
  (1) userdata (not the meta table) */
  swig_lua_userdata *usr;
  assert(lua_isuserdata(L,-1));  /* just in case */
  usr=(swig_lua_userdata*)lua_touserdata(L,-1);  /* get it */
  
  usr->own = 0; /* clear our ownership */
  return 0;
}

/* 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_class_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;
}

/* populate table at the top of the stack with metamethods that ought to be inherited */
SWIGINTERN void SWIG_Lua_populate_inheritable_metamethods(lua_State *L)
{
  SWIG_Lua_add_boolean(L, "__add", 1);
  SWIG_Lua_add_boolean(L, "__sub", 1);
  SWIG_Lua_add_boolean(L, "__mul", 1);
  SWIG_Lua_add_boolean(L, "__div", 1);
  SWIG_Lua_add_boolean(L, "__mod", 1);
  SWIG_Lua_add_boolean(L, "__pow", 1);
  SWIG_Lua_add_boolean(L, "__unm", 1);
  SWIG_Lua_add_boolean(L, "__len", 1 );
  SWIG_Lua_add_boolean(L, "__concat", 1 );
  SWIG_Lua_add_boolean(L, "__eq", 1);
  SWIG_Lua_add_boolean(L, "__lt", 1);
  SWIG_Lua_add_boolean(L, "__le", 1);
  SWIG_Lua_add_boolean(L, "__call", 1);
  SWIG_Lua_add_boolean(L, "__tostring", 1);
  SWIG_Lua_add_boolean(L, "__gc", 0);
}

/* creates the swig registry */
SWIGINTERN void SWIG_Lua_create_class_registry(lua_State *L)
{
  /* create main SWIG registry table */
  lua_pushstring(L,"SWIG");
  lua_newtable(L);
  /* populate it with some predefined data */

  /* .library table. Placeholder */
  lua_pushstring(L,".library");
  lua_newtable(L);
  {
    /* list of metamethods that class inherits from its bases */
    lua_pushstring(L,"inheritable_metamethods");
    lua_newtable(L);
    /* populate with list of metamethods */
    SWIG_Lua_populate_inheritable_metamethods(L);
    lua_rawset(L,-3);
  }
  lua_rawset(L,-3);

  lua_rawset(L,LUA_REGISTRYINDEX);
}

/* gets the swig 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 */
    SWIG_Lua_create_class_registry(L);
    /* then get it */
    lua_pushstring(L,"SWIG");
    lua_rawget(L,LUA_REGISTRYINDEX);
  }
}

SWIGINTERN void SWIG_Lua_get_inheritable_metamethods(lua_State *L)
{
  SWIG_Lua_get_class_registry(L);
  lua_pushstring(L, ".library");
  lua_rawget(L,-2);
  assert( !lua_isnil(L,-1) );
  lua_pushstring(L, "inheritable_metamethods");
  lua_rawget(L,-2);

  /* Remove class registry and library table */
  lua_remove(L,-2);
  lua_remove(L,-2);
}

/* Helper function 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) */
}

/* 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;
    }
  }
}

#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
/* Merges two tables  */
SWIGINTERN void SWIG_Lua_merge_tables_by_index(lua_State *L, int target, int source)
{
  /* iterating */
  lua_pushnil(L);
  while (lua_next(L,source) != 0) {
    /* -1 - value, -2 - index */
    /* have to copy to assign */
    lua_pushvalue(L,-2); /* copy of index */
    lua_pushvalue(L,-2); /* copy of value */
    lua_rawset(L, target);
    lua_pop(L,1);
    /* only key is left */
  }
}

/* Merges two tables with given name. original - index of target metatable, base - index of source metatable */
SWIGINTERN void SWIG_Lua_merge_tables(lua_State *L, const char* name, int original, int base)
{
  /* push original[name], then base[name] */
  lua_pushstring(L,name);
  lua_rawget(L,original);
  int original_table = lua_gettop(L);
  lua_pushstring(L,name);
  lua_rawget(L,base);
  int base_table = lua_gettop(L);
  SWIG_Lua_merge_tables_by_index(L, original_table, base_table);
  /* clearing stack */
  lua_pop(L,2);
}

/* Function takes all symbols from base and adds it to derived class. It's just a helper. */
SWIGINTERN void SWIG_Lua_class_squash_base(lua_State *L, swig_lua_class *base_cls)
{
  /* There is one parameter - original, i.e. 'derived' class metatable */
  assert(lua_istable(L,-1));
  int original = lua_gettop(L);
  SWIG_Lua_get_class_metatable(L,base_cls->fqname);
  int base = lua_gettop(L);
  SWIG_Lua_merge_tables(L, ".fn", original, base );
  SWIG_Lua_merge_tables(L, ".set", original, base );
  SWIG_Lua_merge_tables(L, ".get", original, base );
  lua_pop(L,1);
}

/* Function squashes all symbols from 'clss' bases into itself */
SWIGINTERN void  SWIG_Lua_class_squash_bases(lua_State *L, swig_lua_class *clss)
{
  int i;
  SWIG_Lua_get_class_metatable(L,clss->fqname);
  for(i=0;clss->base_names[i];i++)
  {
    if (clss->bases[i]==0) /* Somehow it's not found. Skip it */
      continue;
    /* Thing is: all bases are already registered. Thus they have already executed
     * this function. So we just need to squash them into us, because their bases
     * are already squashed into them. No need for recursion here!
     */
    SWIG_Lua_class_squash_base(L, clss->bases[i]);
  }
  lua_pop(L,1); /*tidy stack*/
}
#endif

#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) /* In elua this is useless */
/* helper add a variable to a registered class */
SWIGINTERN void  SWIG_Lua_add_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 static details (static attributes, operations and constants) */
SWIGINTERN void SWIG_Lua_add_class_static_details(lua_State *L, swig_lua_class *clss)
{
  int i = 0;
  /* The class namespace table must be on the top of the stack */
  assert(lua_istable(L,-1));
  /* call all the base classes first: we can then override these later: */
  for(i=0;clss->bases[i];i++)
  {
    SWIG_Lua_add_class_static_details(L,clss->bases[i]);
  }

  SWIG_Lua_add_namespace_details(L, clss->cls_static);
}

SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class *clss); /* forward declaration */

/* helper to recursively add class details (attributes & operations) */
SWIGINTERN void  SWIG_Lua_add_class_instance_details(lua_State *L, swig_lua_class *clss)
{
  int i;
  size_t bases_count = 0;
  /* Add bases to .bases table */
  SWIG_Lua_get_table(L,".bases");
  assert(lua_istable(L,-1));  /* just in case */
  for(i=0;clss->bases[i];i++)
  {
    SWIG_Lua_get_class_metatable(L,clss->bases[i]->fqname);
    /* Base class must be already registered */
    assert(lua_istable(L,-1));
    lua_rawseti(L,-2,i+1); /* In lua indexing starts from 1 */
    bases_count++;
  }
  assert(lua_rawlen(L,-1) == bases_count);
  lua_pop(L,1); /* remove .bases table */
  /* add attributes */
  for(i=0;clss->attributes[i].name;i++){
    SWIG_Lua_add_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].func);
  }
  lua_pop(L,1);       /* tidy stack (remove table) */
  /* add operator overloads
    This adds methods from metatable array to metatable. Can mess up garbage
    collectind if someone defines __gc method
    */
  if(clss->metatable) {
    for(i=0;clss->metatable[i].name;i++) {
      SWIG_Lua_add_function(L,clss->metatable[i].name,clss->metatable[i].func);
    }
  }

#if !defined(SWIG_LUA_SQUASH_BASES)
  /* Adding metamethods that are defined in base classes. If bases were squashed
   * then it is obviously unnecessary
   */
  SWIG_Lua_add_class_user_metamethods(L, clss);
#endif
}

/* Helpers to add user defined class metamedhods - __add, __sub etc. The helpers are needed
   for the following issue: Lua runtime checks for metamethod existence with rawget function
   ignoring our SWIG-provided __index and __newindex functions. Thus our inheritance-aware method
   search algorithm doesn't work in such case. (Not to say that Lua runtime queries metamethod directly
   in metatable and not in object).
   Current solution is this: if somewhere in hierarchy metamethod __x is defined, then all descendants
   are automatically given a special proxy __x that calls the real __x method.
   Obvious idea - to copy __x instead of creating __x-proxy is wrong because if someone changes __x in runtime,
   those changes must be reflected in all descendants.
*/

SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L); /*forward declaration*/

/* The real function that resolves a metamethod.
 * Function searches given class and all it's bases(recursively) for first instance of something that is
 * not equal to SWIG_Lua_resolve_metatmethod. (Almost always this 'something' is actual metamethod implementation
 * and it is a SWIG-generated C function.). It returns value on the top of the L and there is no garbage below the
 * answer.
 * Returns 1 if found, 0 otherwise.
 * clss is class which metatable we will search for method
 * metamethod_name_idx is index in L where metamethod name (as string) lies
 * skip_check allows to skip searching metamethod in givel clss and immideatelly go to searching in bases. skip_check
 * is not caried to subsequent recursive calls - false is always passed. It is set to true only at first call from
 * SWIG_Lua_resolve_metamethod
 * */
SWIGINTERN int SWIG_Lua_do_resolve_metamethod(lua_State *L, const swig_lua_class *clss, int metamethod_name_idx,
    int skip_check)
{
  /* This function is called recursively */
  int result = 0;
  int i = 0;

  if (!skip_check) {
    SWIG_Lua_get_class_metatable(L, clss->fqname);
    lua_pushvalue(L, metamethod_name_idx);
    lua_rawget(L,-2);
    /* If this is cfunction and it is equal to SWIG_Lua_resolve_metamethod then
     * this isn't the function we are looking for :)
     * lua_tocfunction will return NULL if not cfunction
     */
    if (!lua_isnil(L,-1) && lua_tocfunction(L,-1) != SWIG_Lua_resolve_metamethod ) {
      lua_remove(L,-2); /* removing class metatable */
      return 1;
    }
    lua_pop(L,2); /* remove class metatable and query result */
  }

  /* Forwarding calls to bases */
  for(i=0;clss->bases[i];i++)
  {
    result = SWIG_Lua_do_resolve_metamethod(L, clss->bases[i], metamethod_name_idx, 0);
    if (result)
      break;
  }

  return result;
}

/* The proxy function for metamethod. All parameters are passed as cclosure. Searches for actual method
 * and calls it */
SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L)
{
  int numargs;
  int metamethod_name_idx;
  const swig_lua_class* clss;
  int result;

  lua_checkstack(L,5);
  numargs = lua_gettop(L); /* number of arguments to pass to actual metamethod */
  
  /* Get upvalues from closure */
  lua_pushvalue(L, lua_upvalueindex(1)); /*Get function name*/
  metamethod_name_idx = lua_gettop(L);
  
  lua_pushvalue(L, lua_upvalueindex(2));
  clss = (const swig_lua_class*)(lua_touserdata(L,-1));
  lua_pop(L,1); /* remove lightuserdata with clss from stack */

  /* Actual work */
  result = SWIG_Lua_do_resolve_metamethod(L, clss, metamethod_name_idx, 1);
  if (!result) {
   SWIG_Lua_pushferrstring(L,"The metamethod proxy is set, but it failed to find actual metamethod. Memory corruption is most likely explanation.");
   lua_error(L);
   return 0;
  }

  lua_remove(L,-2); /* remove metamethod key */
  lua_insert(L,1); /* move function to correct position */
  lua_call(L, numargs, LUA_MULTRET);
  return lua_gettop(L); /* return all results */
}


/* If given metamethod must be present in given class, then creates appropriate proxy
 * Returns 1 if successfully added, 0 if not added because no base class has it, -1
 * if method is defined in the class metatable itself
 */
SWIGINTERN int SWIG_Lua_add_class_user_metamethod(lua_State *L, swig_lua_class *clss, const int metatable_index)
{
  int key_index;
  int success = 0;
  int i = 0;

  /* metamethod name - on the top of the stack */
  assert(lua_isstring(L,-1));
  
  key_index = lua_gettop(L);

  /* Check whether method is already defined in metatable */
  lua_pushvalue(L,key_index); /* copy of the key */
  lua_gettable(L,metatable_index);
  if( !lua_isnil(L,-1) ) {
    lua_pop(L,1);
    return -1;
  }
  lua_pop(L,1); 

  /* Iterating over immediate bases */
  for(i=0;clss->bases[i];i++)
  {
    const swig_lua_class *base = clss->bases[i];
    SWIG_Lua_get_class_metatable(L, base->fqname);
    lua_pushvalue(L, key_index);
    lua_rawget(L, -2);
    if( !lua_isnil(L,-1) ) {
      lua_pushvalue(L, key_index); 

      /* Add proxy function */
      lua_pushvalue(L, key_index); /* first closure value is function name */
      lua_pushlightuserdata(L, clss); /* second closure value is swig_lua_class structure */
      lua_pushcclosure(L, SWIG_Lua_resolve_metamethod, 2);
      
      lua_rawset(L, metatable_index);
      success = 1;
    }
    lua_pop(L,1); /* remove function or nil */
    lua_pop(L,1); /* remove base class metatable */

    if( success )
      break;
  }

  return success; 
}

SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class *clss)
{
  int metatable_index;
  int metamethods_info_index;
  int tostring_undefined;
  int eq_undefined = 0;

  SWIG_Lua_get_class_metatable(L, clss->fqname);
  metatable_index = lua_gettop(L);
  SWIG_Lua_get_inheritable_metamethods(L);
  assert(lua_istable(L,-1));
  metamethods_info_index = lua_gettop(L);
  lua_pushnil(L); /* first key */
  while(lua_next(L, metamethods_info_index) != 0 ) {
    /* key at index -2, value at index -1 */
    const int is_inheritable = lua_toboolean(L,-2);
    lua_pop(L,1); /* remove value - we don't need it anymore */

    if(is_inheritable) { /* if metamethod is inheritable */
      SWIG_Lua_add_class_user_metamethod(L,clss,metatable_index);
    }
  }

  lua_pop(L,1); /* remove inheritable metatmethods table */

  /* Special handling for __tostring method */
  lua_pushstring(L, "__tostring");
  lua_pushvalue(L,-1);
  lua_rawget(L,metatable_index);
  tostring_undefined = lua_isnil(L,-1);
  lua_pop(L,1);
  if( tostring_undefined ) {
    lua_pushcfunction(L, SWIG_Lua_class_tostring);
    lua_rawset(L, metatable_index);
  } else {
    lua_pop(L,1); /* remove copy of the key */
  }

  /* Special handling for __eq method */
  lua_pushstring(L, "__eq");
  lua_pushvalue(L,-1);
  lua_rawget(L,metatable_index);
  eq_undefined = lua_isnil(L,-1);
  lua_pop(L,1);
  if( eq_undefined ) {
    lua_pushcfunction(L, SWIG_Lua_class_equal);
    lua_rawset(L, metatable_index);
  } else {
    lua_pop(L,1); /* remove copy of the key */
  }
  /* Warning: __index and __newindex are SWIG-defined. For user-defined operator[]
   * a __getitem/__setitem method should be defined
   */
  lua_pop(L,1); /* pop class metatable */
}

/* Register class static methods,attributes etc as well as constructor proxy */
SWIGINTERN void SWIG_Lua_class_register_static(lua_State *L, swig_lua_class *clss)
{
  const int SWIGUNUSED begin = lua_gettop(L);
  lua_checkstack(L,5); /* just in case */
  assert(lua_istable(L,-1));  /* just in case */
  assert(strcmp(clss->name, clss->cls_static->name) == 0); /* in class those 2 must be equal */

  SWIG_Lua_namespace_register(L,clss->cls_static, 1);

  assert(lua_istable(L,-1)); /* just in case */

  /*  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)
  {
    lua_getmetatable(L,-1);
    assert(lua_istable(L,-1)); /* just in case */
    SWIG_Lua_add_function(L,"__call", clss->constructor);
    lua_pop(L,1);
  }

  assert(lua_istable(L,-1)); /* just in case */
  SWIG_Lua_add_class_static_details(L, clss);

  /* clear stack */
  lua_pop(L,1);
  assert( lua_gettop(L) == begin );
}

/* Performs the instance (non-static) class registration process. Metatable for class is created
 * and added to the class registry.
 */
SWIGINTERN void  SWIG_Lua_class_register_instance(lua_State *L,swig_lua_class *clss)
{
  const int SWIGUNUSED begin = lua_gettop(L);
  int i;
  /* if name already there (class is already registered) then do nothing */
  SWIG_Lua_get_class_registry(L);  /* get the registry */
  lua_pushstring(L,clss->fqname);  /* get the name */
  lua_rawget(L,-2);
  if(!lua_isnil(L,-1)) {
    lua_pop(L,2);
    assert(lua_gettop(L)==begin);
    return;
  }
  lua_pop(L,2); /* tidy stack */
  /* Recursively initialize all bases */
  for(i=0;clss->bases[i];i++)
  {
    SWIG_Lua_class_register_instance(L,clss->bases[i]);
  }
  /* Again, get registry and push name */
  SWIG_Lua_get_class_registry(L);  /* get the registry */
  lua_pushstring(L,clss->fqname);  /* get the name */
  lua_newtable(L);    /* create the metatable */
#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
  /* If squashing is requested, then merges all bases metatable into this one.
   * It would get us all special methods: __getitem, __add etc.
   * This would set .fn, .type, and other .xxx incorrectly, but we will overwrite it right away
   */
  {
    int new_metatable_index = lua_absindex(L,-1);
    for(i=0;clss->bases[i];i++)
    {
      int base_metatable;
      SWIG_Lua_get_class_metatable(L,clss->bases[i]->fqname);
      base_metatable = lua_absindex(L,-1);
      SWIG_Lua_merge_tables_by_index(L,new_metatable_index, base_metatable);
      lua_pop(L,1);
    }
  }
  /* And now we will overwrite all incorrectly set data */
#endif
  /* add string of class name called ".type" */
  lua_pushstring(L,".type");
  lua_pushstring(L,clss->fqname);
  lua_rawset(L,-3);
  /* add a table called bases */
  lua_pushstring(L,".bases");
  lua_newtable(L);
  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);
  /* add manual disown method */
  SWIG_Lua_add_function(L,"__disown",SWIG_Lua_class_disown);
  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) */
  assert(lua_gettop(L) == begin);

#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
  /* Now merge all symbols from .fn, .set, .get etc from bases to our tables */
  SWIG_Lua_class_squash_bases(L,clss);
#endif
  SWIG_Lua_get_class_metatable(L,clss->fqname);
  SWIG_Lua_add_class_instance_details(L,clss);  /* recursive adding of details (atts & ops) */
  lua_pop(L,1);      /* tidy stack (remove class metatable) */
  assert( lua_gettop(L) == begin );
}

SWIGINTERN void  SWIG_Lua_class_register(lua_State *L,swig_lua_class *clss)
{
  int SWIGUNUSED begin;
  assert(lua_istable(L,-1)); /* This is a table (module or namespace) where classes will be added */
  SWIG_Lua_class_register_instance(L,clss);
  SWIG_Lua_class_register_static(L,clss);

  /* Add links from static part to instance part and vice versa */
  /* [SWIG registry]                                   [Module]
   *    "MyClass" ----> [MyClass metatable] <=====     "MyClass" -+> [static part]
   *                     ".get" ----> ...        |                |     getmetatable()----|
   *                     ".set" ----> ...        |                |                       |
   *                     ".static" --------------)----------------/           [static part metatable]
   *                                             |                                ".get" --> ...
   *                                             |                                ".set" --> ....
   *                                             |=============================== ".instance"
   */
  begin = lua_gettop(L);
  lua_pushstring(L,clss->cls_static->name);
  lua_rawget(L,-2); /* get class static table */
  assert(lua_istable(L,-1));
  lua_getmetatable(L,-1);
  assert(lua_istable(L,-1)); /* get class static metatable */
  lua_pushstring(L,".instance"); /* prepare key */

  SWIG_Lua_get_class_metatable(L,clss->fqname); /* get class metatable */
  assert(lua_istable(L,-1));
  lua_pushstring(L,".static"); /* prepare key */
  lua_pushvalue(L, -4); /* push static class TABLE */
  assert(lua_istable(L,-1));
  lua_rawset(L,-3); /* assign static class table(!NOT metatable) as ".static" member of class metatable */
  lua_rawset(L,-3); /* assign class metatable as ".instance" member of class static METATABLE */
  lua_pop(L,2);
  assert(lua_gettop(L) == begin);
}
#endif /* SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA */

#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
SWIGINTERN void SWIG_Lua_elua_class_register_instance(lua_State *L, swig_lua_class *clss)
{
  const int SWIGUNUSED begin = lua_gettop(L);
  int i;
  /* if name already there (class is already registered) then do nothing */
  SWIG_Lua_get_class_registry(L);  /* get the registry */
  lua_pushstring(L,clss->fqname);  /* get the name */
  lua_rawget(L,-2);
  if(!lua_isnil(L,-1)) {
    lua_pop(L,2);
    assert(lua_gettop(L)==begin);
    return;
  }
  lua_pop(L,2); /* tidy stack */
  /* Recursively initialize all bases */
  for(i=0;clss->bases[i];i++)
  {
    SWIG_Lua_elua_class_register_instance(L,clss->bases[i]);
  }
  /* Again, get registry and push name */
  SWIG_Lua_get_class_registry(L);  /* get the registry */
  lua_pushstring(L,clss->fqname);  /* get the name */
  assert(clss->metatable);
  lua_pushrotable(L, (void*)(clss->metatable));    /* create the metatable */
  lua_rawset(L,-3);
  lua_pop(L,1);
  assert(lua_gettop(L) == begin);
}
#endif /* elua && eluac */

/* -----------------------------------------------------------------------------
 * 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))->fqname);
    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;
#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
  SWIG_Lua_AddMetatable(L,type); /* add metatable */
#endif
}

/* 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))){
    luaL_error (L,"Error in %s, expected a %s at argument number %d\n",
		func_name,(type && type->str)?type->str:"void*",argnum);
  }
  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;
}

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

#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
/* 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_pushinteger(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);
      {
        char c = constants[i].lvalue;
        lua_pushlstring(L,&c,1);
      }
      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;
    }
  }
}
#endif

/* -----------------------------------------------------------------------------
 * 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 which is a really simple way of calling lua from C
Unfortunately lua keeps changing its APIs, so we need a conditional compile
In lua 5.0.X it's lua_dostring()
In lua 5.1.X it's 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__BB2Weight swig_types[1]
#define SWIGTYPE_p_Xapian__BM25PlusWeight swig_types[2]
#define SWIGTYPE_p_Xapian__BM25Weight swig_types[3]
#define SWIGTYPE_p_Xapian__BoolWeight swig_types[4]
#define SWIGTYPE_p_Xapian__Compactor swig_types[5]
#define SWIGTYPE_p_Xapian__CoordWeight swig_types[6]
#define SWIGTYPE_p_Xapian__DLHWeight swig_types[7]
#define SWIGTYPE_p_Xapian__DPHWeight swig_types[8]
#define SWIGTYPE_p_Xapian__Database swig_types[9]
#define SWIGTYPE_p_Xapian__DatabaseClosedError swig_types[10]
#define SWIGTYPE_p_Xapian__DatabaseCorruptError swig_types[11]
#define SWIGTYPE_p_Xapian__DatabaseCreateError swig_types[12]
#define SWIGTYPE_p_Xapian__DatabaseError swig_types[13]
#define SWIGTYPE_p_Xapian__DatabaseLockError swig_types[14]
#define SWIGTYPE_p_Xapian__DatabaseModifiedError swig_types[15]
#define SWIGTYPE_p_Xapian__DatabaseNotFoundError swig_types[16]
#define SWIGTYPE_p_Xapian__DatabaseOpeningError swig_types[17]
#define SWIGTYPE_p_Xapian__DatabaseVersionError swig_types[18]
#define SWIGTYPE_p_Xapian__DateRangeProcessor swig_types[19]
#define SWIGTYPE_p_Xapian__DateValueRangeProcessor swig_types[20]
#define SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource swig_types[21]
#define SWIGTYPE_p_Xapian__DocNotFoundError swig_types[22]
#define SWIGTYPE_p_Xapian__Document swig_types[23]
#define SWIGTYPE_p_Xapian__ESet swig_types[24]
#define SWIGTYPE_p_Xapian__ESetIterator swig_types[25]
#define SWIGTYPE_p_Xapian__Enquire swig_types[26]
#define SWIGTYPE_p_Xapian__Error swig_types[27]
#define SWIGTYPE_p_Xapian__ExpandDecider swig_types[28]
#define SWIGTYPE_p_Xapian__ExpandDeciderAnd swig_types[29]
#define SWIGTYPE_p_Xapian__ExpandDeciderFilterPrefix swig_types[30]
#define SWIGTYPE_p_Xapian__ExpandDeciderFilterTerms swig_types[31]
#define SWIGTYPE_p_Xapian__FeatureUnavailableError swig_types[32]
#define SWIGTYPE_p_Xapian__FieldProcessor swig_types[33]
#define SWIGTYPE_p_Xapian__FixedWeightPostingSource swig_types[34]
#define SWIGTYPE_p_Xapian__GreatCircleMetric swig_types[35]
#define SWIGTYPE_p_Xapian__IfB2Weight swig_types[36]
#define SWIGTYPE_p_Xapian__InL2Weight swig_types[37]
#define SWIGTYPE_p_Xapian__IneB2Weight swig_types[38]
#define SWIGTYPE_p_Xapian__InternalError swig_types[39]
#define SWIGTYPE_p_Xapian__InvalidArgumentError swig_types[40]
#define SWIGTYPE_p_Xapian__InvalidOperationError swig_types[41]
#define SWIGTYPE_p_Xapian__KeyMaker swig_types[42]
#define SWIGTYPE_p_Xapian__LMWeight swig_types[43]
#define SWIGTYPE_p_Xapian__LatLongCoord swig_types[44]
#define SWIGTYPE_p_Xapian__LatLongCoords swig_types[45]
#define SWIGTYPE_p_Xapian__LatLongCoordsIterator swig_types[46]
#define SWIGTYPE_p_Xapian__LatLongDistanceKeyMaker swig_types[47]
#define SWIGTYPE_p_Xapian__LatLongDistancePostingSource swig_types[48]
#define SWIGTYPE_p_Xapian__LatLongMetric swig_types[49]
#define SWIGTYPE_p_Xapian__LogicError swig_types[50]
#define SWIGTYPE_p_Xapian__MSet swig_types[51]
#define SWIGTYPE_p_Xapian__MSetIterator swig_types[52]
#define SWIGTYPE_p_Xapian__MatchDecider swig_types[53]
#define SWIGTYPE_p_Xapian__MatchSpy swig_types[54]
#define SWIGTYPE_p_Xapian__MultiValueKeyMaker swig_types[55]
#define SWIGTYPE_p_Xapian__NetworkError swig_types[56]
#define SWIGTYPE_p_Xapian__NetworkTimeoutError swig_types[57]
#define SWIGTYPE_p_Xapian__NumberRangeProcessor swig_types[58]
#define SWIGTYPE_p_Xapian__NumberValueRangeProcessor swig_types[59]
#define SWIGTYPE_p_Xapian__PL2PlusWeight swig_types[60]
#define SWIGTYPE_p_Xapian__PL2Weight swig_types[61]
#define SWIGTYPE_p_Xapian__PositionIterator swig_types[62]
#define SWIGTYPE_p_Xapian__PostingIterator swig_types[63]
#define SWIGTYPE_p_Xapian__PostingSource swig_types[64]
#define SWIGTYPE_p_Xapian__Query swig_types[65]
#define SWIGTYPE_p_Xapian__QueryParser swig_types[66]
#define SWIGTYPE_p_Xapian__QueryParserError swig_types[67]
#define SWIGTYPE_p_Xapian__RSet swig_types[68]
#define SWIGTYPE_p_Xapian__RangeError swig_types[69]
#define SWIGTYPE_p_Xapian__RangeProcessor swig_types[70]
#define SWIGTYPE_p_Xapian__Registry swig_types[71]
#define SWIGTYPE_p_Xapian__RuntimeError swig_types[72]
#define SWIGTYPE_p_Xapian__SerialisationError swig_types[73]
#define SWIGTYPE_p_Xapian__SimpleStopper swig_types[74]
#define SWIGTYPE_p_Xapian__Stem swig_types[75]
#define SWIGTYPE_p_Xapian__StemImplementation swig_types[76]
#define SWIGTYPE_p_Xapian__Stopper swig_types[77]
#define SWIGTYPE_p_Xapian__StringValueRangeProcessor swig_types[78]
#define SWIGTYPE_p_Xapian__TermGenerator swig_types[79]
#define SWIGTYPE_p_Xapian__TermIterator swig_types[80]
#define SWIGTYPE_p_Xapian__TfIdfWeight swig_types[81]
#define SWIGTYPE_p_Xapian__TradWeight swig_types[82]
#define SWIGTYPE_p_Xapian__UnimplementedError swig_types[83]
#define SWIGTYPE_p_Xapian__ValueCountMatchSpy swig_types[84]
#define SWIGTYPE_p_Xapian__ValueIterator swig_types[85]
#define SWIGTYPE_p_Xapian__ValueMapPostingSource swig_types[86]
#define SWIGTYPE_p_Xapian__ValuePostingSource swig_types[87]
#define SWIGTYPE_p_Xapian__ValueRangeProcessor swig_types[88]
#define SWIGTYPE_p_Xapian__ValueSetMatchDecider swig_types[89]
#define SWIGTYPE_p_Xapian__ValueWeightPostingSource swig_types[90]
#define SWIGTYPE_p_Xapian__Weight swig_types[91]
#define SWIGTYPE_p_Xapian__WildcardError swig_types[92]
#define SWIGTYPE_p_Xapian__WritableDatabase swig_types[93]
#define SWIGTYPE_p_compaction_level swig_types[94]
#define SWIGTYPE_p_docid_order swig_types[95]
#define SWIGTYPE_p_double swig_types[96]
#define SWIGTYPE_p_feature_flag swig_types[97]
#define SWIGTYPE_p_flags swig_types[98]
#define SWIGTYPE_p_int swig_types[99]
#define SWIGTYPE_p_std__string swig_types[100]
#define SWIGTYPE_p_stem_strategy swig_types[101]
#define SWIGTYPE_p_stop_strategy swig_types[102]
#define SWIGTYPE_p_type_smoothing swig_types[103]
#define SWIGTYPE_p_unsigned_int swig_types[104]
#define SWIGTYPE_p_unsigned_long swig_types[105]
static swig_type_info *swig_types[107];
static swig_module_info swig_module = {swig_types, 106, 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;
}


/* lua.i: SWIG interface file for the Lua bindings
 *
 * Copyright (C) 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
 */


/** @file xapian-head.i
 * @brief Header for SWIG interface file for Xapian.
 */
/* Copyright (C) 2005,2006,2007,2008,2009,2011,2012,2013,2014,2015,2016 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

#include <xapian.h>

#include <fstream>
#include <iostream>
#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_CHERT_BACKEND
    namespace Chert {
	static Database open(const string &) {
	    throw FeatureUnavailableError("Chert backend not supported");
	}
	static WritableDatabase open(const string &, int, int = 0) {
	    throw FeatureUnavailableError("Chert 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, useconds_t = 0, useconds_t = 0) {
	    throw FeatureUnavailableError("Remote backend not supported");
	}

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

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

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

}


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


#include <typeinfo>
#include <stdexcept>


#include <typeinfo>
#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>


#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


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, term.data(), 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, term.data(), 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, word.data(), 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 luaRangeProcessor : public Xapian::RangeProcessor {
    int r;
    lua_State* L;

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

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

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

	lua_pushlstring(L, begin.data(), begin.length());
	lua_pushlstring(L, end.data(), end.length());

	if (lua_pcall(L, 2, 1, 0) != 0) {
	    luaL_error(L, "error running function: %s", lua_tostring(L, -1));
	}

	// Allow the function to return a string or Query object.
	if (lua_isstring(L, -1)) {
	    size_t len;
	    const char * p = lua_tolstring(L, -1, &len);
	    std::string result(p, len);
	    lua_pop(L, 1);
	    return Xapian::Query(result);
	}

	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_error(L, "function must return a string or Query object");
	}

	lua_pop(L, 1);
	return *subq;
    }
};


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 number");
	}
	Xapian::valueno result(lua_tonumber(L, -1));
	lua_pop(L, 1);
	return result;
    }
};


class luaFieldProcessor : public Xapian::FieldProcessor {
    int r;
    lua_State* L;

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

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

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

	lua_pushlstring(L, str.data(), str.length());

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

        // Allow the function to return a string or Query object.
	if (lua_isstring(L, -1)) {
            size_t len;
            const char * p = lua_tolstring(L, -1, &len);
            std::string result(p, len);
            lua_pop(L, 1);
            return Xapian::Query(result);
        }

	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_error(L, "function must return a string or Query object");
	}

	lua_pop(L, 1);
	return *subq;
    }
};


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, double 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));
	}
    }
};


class XapianSWIGQueryItor {
    lua_State* L;
    int index;
    int i;

  public:
    typedef std::random_access_iterator_tag iterator_category;
    typedef Xapian::Query value_type;
    typedef Xapian::termcount_diff difference_type;
    typedef Xapian::Query * pointer;
    typedef Xapian::Query & reference;

    XapianSWIGQueryItor() { }

    void begin(lua_State * S, int index_) {
	L = S;
	index = index_;
	i = 0;
    }

    void end(lua_State * S, int index_, int n) {
	L = S;
	index = index_;
	i = n;
    }

    void end() {
	i = 0;
    }

    XapianSWIGQueryItor & operator++() {
	++i;
	return *this;
    }

    Xapian::Query operator*() const {
	lua_rawgeti(L, index, i+1);
	if (lua_isstring(L, -1)) {
	    size_t len = 0;
	    const char *p = lua_tolstring(L, -1, &len);
	    lua_pop(L,1);
	    return Xapian::Query(string(p, len));
	}

	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, index,
			  "elements must be Query objects or strings");
	}

	lua_pop(L, 1);
	return *subq;
    }

    bool operator==(const XapianSWIGQueryItor & o) {
	return i == o.i;
    }

    bool operator!=(const XapianSWIGQueryItor & o) {
	return !(*this == o);
    }

    difference_type operator-(const XapianSWIGQueryItor &o) const {
        return i - o.i;
    }
};



namespace Xapian {
void handle_exception(lua_State* L) {
    try {
	throw;
    } catch (const Xapian::DatabaseClosedError &e) {
	SWIG_NewPointerObj(L, (void *)new DatabaseClosedError(e), SWIGTYPE_p_Xapian__DatabaseClosedError, 1);
    } catch (const Xapian::DatabaseNotFoundError &e) {
	SWIG_NewPointerObj(L, (void *)new DatabaseNotFoundError(e), SWIGTYPE_p_Xapian__DatabaseNotFoundError, 1);
    } catch (const Xapian::WildcardError &e) {
	SWIG_NewPointerObj(L, (void *)new WildcardError(e), SWIGTYPE_p_Xapian__WildcardError, 1);
    } 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");
    }
}
}


/* xapian-headers.i: Getting SWIG to parse Xapian's C++ headers.
 *
 * Copyright 2004,2006,2011,2012,2013,2014,2015,2016,2019 Olly Betts
 * Copyright 2014 Assem Chelli
 *
 * 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
 */

SWIGINTERN bool Xapian_PositionIterator_equals(Xapian::PositionIterator const *self,Xapian::PositionIterator const &o){ return *self == o; }
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_PostingIterator_equals(Xapian::PostingIterator const *self,Xapian::PostingIterator const &o){ return *self == o; }
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_TermIterator_equals(Xapian::TermIterator const *self,Xapian::TermIterator const &o){ return *self == o; }
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_ValueIterator_equals(Xapian::ValueIterator const *self,Xapian::ValueIterator const &o){ return *self == o; }
SWIGINTERN std::string Xapian_ValueIterator_get_value(Xapian::ValueIterator const *self){ return **self; }
SWIGINTERN void Xapian_ValueIterator_next(Xapian::ValueIterator *self){ ++(*self); }
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 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 std::pair< Xapian::MSetIterator,Xapian::MSetIterator > Xapian_MSet_items(Xapian::MSet *self){
	return std::make_pair(self->begin(), self->end());
    }
SWIGINTERN Xapian::docid Xapian_MSet_get_docid(Xapian::MSet const *self,Xapian::doccount i){
	return *(*self)[i];
    }
SWIGINTERN Xapian::Document Xapian_MSet_get_document(Xapian::MSet const *self,Xapian::doccount i){
	return (*self)[i].get_document();
    }
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 bool Xapian_MSetIterator_equals(Xapian::MSetIterator const *self,Xapian::MSetIterator const &o){ return *self == o; }
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 std::pair< Xapian::ESetIterator,Xapian::ESetIterator > Xapian_ESet_terms(Xapian::ESet *self){
	return std::make_pair(self->begin(), self->end());
    }
SWIGINTERN bool Xapian_ESetIterator_equals(Xapian::ESetIterator const *self,Xapian::ESetIterator const &o){ return *self == o; }
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 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 Xapian::SimpleStopper *new_Xapian_SimpleStopper__SWIG_2(std::string const &file){
	ifstream in_file(file.c_str());
	if (!in_file.is_open())
	    throw Xapian::InvalidArgumentError("Stopword file not found: " + file);
	istream_iterator<std::string> in_iter(in_file);
	istream_iterator<std::string> eof;
	return new Xapian::SimpleStopper(in_iter, eof);
    }
SWIGINTERN std::pair< Xapian::TermIterator,Xapian::TermIterator > Xapian_QueryParser_stoplist(Xapian::QueryParser *self){
	return std::make_pair(self->stoplist_begin(), self->stoplist_end());
    }
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 bool Xapian_LatLongCoordsIterator_equals(Xapian::LatLongCoordsIterator const *self,Xapian::LatLongCoordsIterator const &o){ return *self == o; }
SWIGINTERN Xapian::LatLongCoord Xapian_LatLongCoordsIterator_get_coord(Xapian::LatLongCoordsIterator const *self){ return **self; }
SWIGINTERN void Xapian_LatLongCoordsIterator_next(Xapian::LatLongCoordsIterator *self){ ++(*self); }
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));
    }
#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);
    }
  }
  
  SWIG_Lua_pusherrstring(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 int _proxy__wrap_new_string(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_string);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_string_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_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_method swig_string_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_string_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_string_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_string_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_string_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_string_Sf_SwigStatic = {
    "string",
    swig_string_Sf_SwigStatic_methods,
    swig_string_Sf_SwigStatic_attributes,
    swig_string_Sf_SwigStatic_constants,
    swig_string_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_string_bases[] = {0};
static const char *swig_string_base_names[] = {0};
static swig_lua_class _wrap_class_string = { "string", "string", &SWIGTYPE_p_std__string,_proxy__wrap_new_string, swig_delete_string, swig_string_methods, swig_string_attributes, &swig_string_Sf_SwigStatic, swig_string_meta, swig_string_bases, swig_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_attribute swig_Error_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_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_method swig_Error_meta[] = {
    { "__tostring", _wrap_Error___tostring},
    {0,0}
};

static swig_lua_attribute swig_Error_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_Error_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_Error_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_Error_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_Error_Sf_SwigStatic = {
    "Error",
    swig_Error_Sf_SwigStatic_methods,
    swig_Error_Sf_SwigStatic_attributes,
    swig_Error_Sf_SwigStatic_constants,
    swig_Error_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_Error_bases[] = {0};
static const char *swig_Error_base_names[] = {0};
static swig_lua_class _wrap_class_Error = { "Error", "Error", &SWIGTYPE_p_Xapian__Error,0, swig_delete_Error, swig_Error_methods, swig_Error_attributes, &swig_Error_Sf_SwigStatic, swig_Error_meta, swig_Error_bases, swig_Error_base_names };

static void swig_delete_LogicError(void *obj) {
Xapian::LogicError *arg1 = (Xapian::LogicError *) obj;
delete arg1;
}
static swig_lua_attribute swig_LogicError_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_LogicError_methods[]= {
    {0,0}
};
static swig_lua_method swig_LogicError_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_LogicError_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_LogicError_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_LogicError_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_LogicError_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_LogicError_Sf_SwigStatic = {
    "LogicError",
    swig_LogicError_Sf_SwigStatic_methods,
    swig_LogicError_Sf_SwigStatic_attributes,
    swig_LogicError_Sf_SwigStatic_constants,
    swig_LogicError_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_LogicError_bases[] = {0,0};
static const char *swig_LogicError_base_names[] = {"Xapian::Error *",0};
static swig_lua_class _wrap_class_LogicError = { "LogicError", "LogicError", &SWIGTYPE_p_Xapian__LogicError,0, swig_delete_LogicError, swig_LogicError_methods, swig_LogicError_attributes, &swig_LogicError_Sf_SwigStatic, swig_LogicError_meta, swig_LogicError_bases, swig_LogicError_base_names };

static void swig_delete_RuntimeError(void *obj) {
Xapian::RuntimeError *arg1 = (Xapian::RuntimeError *) obj;
delete arg1;
}
static swig_lua_attribute swig_RuntimeError_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_RuntimeError_methods[]= {
    {0,0}
};
static swig_lua_method swig_RuntimeError_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_RuntimeError_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_RuntimeError_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_RuntimeError_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_RuntimeError_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_RuntimeError_Sf_SwigStatic = {
    "RuntimeError",
    swig_RuntimeError_Sf_SwigStatic_methods,
    swig_RuntimeError_Sf_SwigStatic_attributes,
    swig_RuntimeError_Sf_SwigStatic_constants,
    swig_RuntimeError_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_RuntimeError_bases[] = {0,0};
static const char *swig_RuntimeError_base_names[] = {"Xapian::Error *",0};
static swig_lua_class _wrap_class_RuntimeError = { "RuntimeError", "RuntimeError", &SWIGTYPE_p_Xapian__RuntimeError,0, swig_delete_RuntimeError, swig_RuntimeError_methods, swig_RuntimeError_attributes, &swig_RuntimeError_Sf_SwigStatic, swig_RuntimeError_meta, swig_RuntimeError_bases, swig_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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 int _proxy__wrap_new_AssertionError(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_AssertionError);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_AssertionError_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_AssertionError_methods[]= {
    {0,0}
};
static swig_lua_method swig_AssertionError_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_AssertionError_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_AssertionError_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_AssertionError_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_AssertionError_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_AssertionError_Sf_SwigStatic = {
    "AssertionError",
    swig_AssertionError_Sf_SwigStatic_methods,
    swig_AssertionError_Sf_SwigStatic_attributes,
    swig_AssertionError_Sf_SwigStatic_constants,
    swig_AssertionError_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_AssertionError_bases[] = {0,0};
static const char *swig_AssertionError_base_names[] = {"Xapian::LogicError *",0};
static swig_lua_class _wrap_class_AssertionError = { "AssertionError", "AssertionError", &SWIGTYPE_p_Xapian__AssertionError,_proxy__wrap_new_AssertionError, swig_delete_AssertionError, swig_AssertionError_methods, swig_AssertionError_attributes, &swig_AssertionError_Sf_SwigStatic, swig_AssertionError_meta, swig_AssertionError_bases, swig_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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 int _proxy__wrap_new_InvalidArgumentError(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_InvalidArgumentError);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_InvalidArgumentError_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_InvalidArgumentError_methods[]= {
    {0,0}
};
static swig_lua_method swig_InvalidArgumentError_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_InvalidArgumentError_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_InvalidArgumentError_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_InvalidArgumentError_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_InvalidArgumentError_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_InvalidArgumentError_Sf_SwigStatic = {
    "InvalidArgumentError",
    swig_InvalidArgumentError_Sf_SwigStatic_methods,
    swig_InvalidArgumentError_Sf_SwigStatic_attributes,
    swig_InvalidArgumentError_Sf_SwigStatic_constants,
    swig_InvalidArgumentError_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_InvalidArgumentError_bases[] = {0,0};
static const char *swig_InvalidArgumentError_base_names[] = {"Xapian::LogicError *",0};
static swig_lua_class _wrap_class_InvalidArgumentError = { "InvalidArgumentError", "InvalidArgumentError", &SWIGTYPE_p_Xapian__InvalidArgumentError,_proxy__wrap_new_InvalidArgumentError, swig_delete_InvalidArgumentError, swig_InvalidArgumentError_methods, swig_InvalidArgumentError_attributes, &swig_InvalidArgumentError_Sf_SwigStatic, swig_InvalidArgumentError_meta, swig_InvalidArgumentError_bases, swig_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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 int _proxy__wrap_new_InvalidOperationError(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_InvalidOperationError);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_InvalidOperationError_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_InvalidOperationError_methods[]= {
    {0,0}
};
static swig_lua_method swig_InvalidOperationError_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_InvalidOperationError_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_InvalidOperationError_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_InvalidOperationError_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_InvalidOperationError_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_InvalidOperationError_Sf_SwigStatic = {
    "InvalidOperationError",
    swig_InvalidOperationError_Sf_SwigStatic_methods,
    swig_InvalidOperationError_Sf_SwigStatic_attributes,
    swig_InvalidOperationError_Sf_SwigStatic_constants,
    swig_InvalidOperationError_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_InvalidOperationError_bases[] = {0,0};
static const char *swig_InvalidOperationError_base_names[] = {"Xapian::LogicError *",0};
static swig_lua_class _wrap_class_InvalidOperationError = { "InvalidOperationError", "InvalidOperationError", &SWIGTYPE_p_Xapian__InvalidOperationError,_proxy__wrap_new_InvalidOperationError, swig_delete_InvalidOperationError, swig_InvalidOperationError_methods, swig_InvalidOperationError_attributes, &swig_InvalidOperationError_Sf_SwigStatic, swig_InvalidOperationError_meta, swig_InvalidOperationError_bases, swig_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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 int _proxy__wrap_new_UnimplementedError(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_UnimplementedError);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_UnimplementedError_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_UnimplementedError_methods[]= {
    {0,0}
};
static swig_lua_method swig_UnimplementedError_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_UnimplementedError_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_UnimplementedError_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_UnimplementedError_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_UnimplementedError_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_UnimplementedError_Sf_SwigStatic = {
    "UnimplementedError",
    swig_UnimplementedError_Sf_SwigStatic_methods,
    swig_UnimplementedError_Sf_SwigStatic_attributes,
    swig_UnimplementedError_Sf_SwigStatic_constants,
    swig_UnimplementedError_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_UnimplementedError_bases[] = {0,0};
static const char *swig_UnimplementedError_base_names[] = {"Xapian::LogicError *",0};
static swig_lua_class _wrap_class_UnimplementedError = { "UnimplementedError", "UnimplementedError", &SWIGTYPE_p_Xapian__UnimplementedError,_proxy__wrap_new_UnimplementedError, swig_delete_UnimplementedError, swig_UnimplementedError_methods, swig_UnimplementedError_attributes, &swig_UnimplementedError_Sf_SwigStatic, swig_UnimplementedError_meta, swig_UnimplementedError_bases, swig_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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 int _proxy__wrap_new_DatabaseError(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_DatabaseError);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_DatabaseError_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_DatabaseError_methods[]= {
    {0,0}
};
static swig_lua_method swig_DatabaseError_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_DatabaseError_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_DatabaseError_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_DatabaseError_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_DatabaseError_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_DatabaseError_Sf_SwigStatic = {
    "DatabaseError",
    swig_DatabaseError_Sf_SwigStatic_methods,
    swig_DatabaseError_Sf_SwigStatic_attributes,
    swig_DatabaseError_Sf_SwigStatic_constants,
    swig_DatabaseError_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_DatabaseError_bases[] = {0,0};
static const char *swig_DatabaseError_base_names[] = {"Xapian::RuntimeError *",0};
static swig_lua_class _wrap_class_DatabaseError = { "DatabaseError", "DatabaseError", &SWIGTYPE_p_Xapian__DatabaseError,_proxy__wrap_new_DatabaseError, swig_delete_DatabaseError, swig_DatabaseError_methods, swig_DatabaseError_attributes, &swig_DatabaseError_Sf_SwigStatic, swig_DatabaseError_meta, swig_DatabaseError_bases, swig_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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 int _proxy__wrap_new_DatabaseCorruptError(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_DatabaseCorruptError);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_DatabaseCorruptError_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_DatabaseCorruptError_methods[]= {
    {0,0}
};
static swig_lua_method swig_DatabaseCorruptError_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_DatabaseCorruptError_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_DatabaseCorruptError_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_DatabaseCorruptError_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_DatabaseCorruptError_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_DatabaseCorruptError_Sf_SwigStatic = {
    "DatabaseCorruptError",
    swig_DatabaseCorruptError_Sf_SwigStatic_methods,
    swig_DatabaseCorruptError_Sf_SwigStatic_attributes,
    swig_DatabaseCorruptError_Sf_SwigStatic_constants,
    swig_DatabaseCorruptError_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_DatabaseCorruptError_bases[] = {0,0};
static const char *swig_DatabaseCorruptError_base_names[] = {"Xapian::DatabaseError *",0};
static swig_lua_class _wrap_class_DatabaseCorruptError = { "DatabaseCorruptError", "DatabaseCorruptError", &SWIGTYPE_p_Xapian__DatabaseCorruptError,_proxy__wrap_new_DatabaseCorruptError, swig_delete_DatabaseCorruptError, swig_DatabaseCorruptError_methods, swig_DatabaseCorruptError_attributes, &swig_DatabaseCorruptError_Sf_SwigStatic, swig_DatabaseCorruptError_meta, swig_DatabaseCorruptError_bases, swig_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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 int _proxy__wrap_new_DatabaseCreateError(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_DatabaseCreateError);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_DatabaseCreateError_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_DatabaseCreateError_methods[]= {
    {0,0}
};
static swig_lua_method swig_DatabaseCreateError_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_DatabaseCreateError_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_DatabaseCreateError_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_DatabaseCreateError_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_DatabaseCreateError_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_DatabaseCreateError_Sf_SwigStatic = {
    "DatabaseCreateError",
    swig_DatabaseCreateError_Sf_SwigStatic_methods,
    swig_DatabaseCreateError_Sf_SwigStatic_attributes,
    swig_DatabaseCreateError_Sf_SwigStatic_constants,
    swig_DatabaseCreateError_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_DatabaseCreateError_bases[] = {0,0};
static const char *swig_DatabaseCreateError_base_names[] = {"Xapian::DatabaseError *",0};
static swig_lua_class _wrap_class_DatabaseCreateError = { "DatabaseCreateError", "DatabaseCreateError", &SWIGTYPE_p_Xapian__DatabaseCreateError,_proxy__wrap_new_DatabaseCreateError, swig_delete_DatabaseCreateError, swig_DatabaseCreateError_methods, swig_DatabaseCreateError_attributes, &swig_DatabaseCreateError_Sf_SwigStatic, swig_DatabaseCreateError_meta, swig_DatabaseCreateError_bases, swig_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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 int _proxy__wrap_new_DatabaseLockError(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_DatabaseLockError);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_DatabaseLockError_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_DatabaseLockError_methods[]= {
    {0,0}
};
static swig_lua_method swig_DatabaseLockError_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_DatabaseLockError_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_DatabaseLockError_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_DatabaseLockError_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_DatabaseLockError_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_DatabaseLockError_Sf_SwigStatic = {
    "DatabaseLockError",
    swig_DatabaseLockError_Sf_SwigStatic_methods,
    swig_DatabaseLockError_Sf_SwigStatic_attributes,
    swig_DatabaseLockError_Sf_SwigStatic_constants,
    swig_DatabaseLockError_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_DatabaseLockError_bases[] = {0,0};
static const char *swig_DatabaseLockError_base_names[] = {"Xapian::DatabaseError *",0};
static swig_lua_class _wrap_class_DatabaseLockError = { "DatabaseLockError", "DatabaseLockError", &SWIGTYPE_p_Xapian__DatabaseLockError,_proxy__wrap_new_DatabaseLockError, swig_delete_DatabaseLockError, swig_DatabaseLockError_methods, swig_DatabaseLockError_attributes, &swig_DatabaseLockError_Sf_SwigStatic, swig_DatabaseLockError_meta, swig_DatabaseLockError_bases, swig_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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 int _proxy__wrap_new_DatabaseModifiedError(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_DatabaseModifiedError);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_DatabaseModifiedError_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_DatabaseModifiedError_methods[]= {
    {0,0}
};
static swig_lua_method swig_DatabaseModifiedError_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_DatabaseModifiedError_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_DatabaseModifiedError_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_DatabaseModifiedError_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_DatabaseModifiedError_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_DatabaseModifiedError_Sf_SwigStatic = {
    "DatabaseModifiedError",
    swig_DatabaseModifiedError_Sf_SwigStatic_methods,
    swig_DatabaseModifiedError_Sf_SwigStatic_attributes,
    swig_DatabaseModifiedError_Sf_SwigStatic_constants,
    swig_DatabaseModifiedError_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_DatabaseModifiedError_bases[] = {0,0};
static const char *swig_DatabaseModifiedError_base_names[] = {"Xapian::DatabaseError *",0};
static swig_lua_class _wrap_class_DatabaseModifiedError = { "DatabaseModifiedError", "DatabaseModifiedError", &SWIGTYPE_p_Xapian__DatabaseModifiedError,_proxy__wrap_new_DatabaseModifiedError, swig_delete_DatabaseModifiedError, swig_DatabaseModifiedError_methods, swig_DatabaseModifiedError_attributes, &swig_DatabaseModifiedError_Sf_SwigStatic, swig_DatabaseModifiedError_meta, swig_DatabaseModifiedError_bases, swig_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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 int _proxy__wrap_new_DatabaseOpeningError(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_DatabaseOpeningError);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_DatabaseOpeningError_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_DatabaseOpeningError_methods[]= {
    {0,0}
};
static swig_lua_method swig_DatabaseOpeningError_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_DatabaseOpeningError_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_DatabaseOpeningError_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_DatabaseOpeningError_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_DatabaseOpeningError_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_DatabaseOpeningError_Sf_SwigStatic = {
    "DatabaseOpeningError",
    swig_DatabaseOpeningError_Sf_SwigStatic_methods,
    swig_DatabaseOpeningError_Sf_SwigStatic_attributes,
    swig_DatabaseOpeningError_Sf_SwigStatic_constants,
    swig_DatabaseOpeningError_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_DatabaseOpeningError_bases[] = {0,0};
static const char *swig_DatabaseOpeningError_base_names[] = {"Xapian::DatabaseError *",0};
static swig_lua_class _wrap_class_DatabaseOpeningError = { "DatabaseOpeningError", "DatabaseOpeningError", &SWIGTYPE_p_Xapian__DatabaseOpeningError,_proxy__wrap_new_DatabaseOpeningError, swig_delete_DatabaseOpeningError, swig_DatabaseOpeningError_methods, swig_DatabaseOpeningError_attributes, &swig_DatabaseOpeningError_Sf_SwigStatic, swig_DatabaseOpeningError_meta, swig_DatabaseOpeningError_bases, swig_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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 int _proxy__wrap_new_DatabaseVersionError(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_DatabaseVersionError);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_DatabaseVersionError_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_DatabaseVersionError_methods[]= {
    {0,0}
};
static swig_lua_method swig_DatabaseVersionError_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_DatabaseVersionError_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_DatabaseVersionError_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_DatabaseVersionError_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_DatabaseVersionError_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_DatabaseVersionError_Sf_SwigStatic = {
    "DatabaseVersionError",
    swig_DatabaseVersionError_Sf_SwigStatic_methods,
    swig_DatabaseVersionError_Sf_SwigStatic_attributes,
    swig_DatabaseVersionError_Sf_SwigStatic_constants,
    swig_DatabaseVersionError_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_DatabaseVersionError_bases[] = {0,0};
static const char *swig_DatabaseVersionError_base_names[] = {"Xapian::DatabaseOpeningError *",0};
static swig_lua_class _wrap_class_DatabaseVersionError = { "DatabaseVersionError", "DatabaseVersionError", &SWIGTYPE_p_Xapian__DatabaseVersionError,_proxy__wrap_new_DatabaseVersionError, swig_delete_DatabaseVersionError, swig_DatabaseVersionError_methods, swig_DatabaseVersionError_attributes, &swig_DatabaseVersionError_Sf_SwigStatic, swig_DatabaseVersionError_meta, swig_DatabaseVersionError_bases, swig_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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 int _proxy__wrap_new_DocNotFoundError(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_DocNotFoundError);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_DocNotFoundError_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_DocNotFoundError_methods[]= {
    {0,0}
};
static swig_lua_method swig_DocNotFoundError_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_DocNotFoundError_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_DocNotFoundError_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_DocNotFoundError_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_DocNotFoundError_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_DocNotFoundError_Sf_SwigStatic = {
    "DocNotFoundError",
    swig_DocNotFoundError_Sf_SwigStatic_methods,
    swig_DocNotFoundError_Sf_SwigStatic_attributes,
    swig_DocNotFoundError_Sf_SwigStatic_constants,
    swig_DocNotFoundError_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_DocNotFoundError_bases[] = {0,0};
static const char *swig_DocNotFoundError_base_names[] = {"Xapian::RuntimeError *",0};
static swig_lua_class _wrap_class_DocNotFoundError = { "DocNotFoundError", "DocNotFoundError", &SWIGTYPE_p_Xapian__DocNotFoundError,_proxy__wrap_new_DocNotFoundError, swig_delete_DocNotFoundError, swig_DocNotFoundError_methods, swig_DocNotFoundError_attributes, &swig_DocNotFoundError_Sf_SwigStatic, swig_DocNotFoundError_meta, swig_DocNotFoundError_bases, swig_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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 int _proxy__wrap_new_FeatureUnavailableError(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_FeatureUnavailableError);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_FeatureUnavailableError_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_FeatureUnavailableError_methods[]= {
    {0,0}
};
static swig_lua_method swig_FeatureUnavailableError_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_FeatureUnavailableError_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_FeatureUnavailableError_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_FeatureUnavailableError_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_FeatureUnavailableError_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_FeatureUnavailableError_Sf_SwigStatic = {
    "FeatureUnavailableError",
    swig_FeatureUnavailableError_Sf_SwigStatic_methods,
    swig_FeatureUnavailableError_Sf_SwigStatic_attributes,
    swig_FeatureUnavailableError_Sf_SwigStatic_constants,
    swig_FeatureUnavailableError_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_FeatureUnavailableError_bases[] = {0,0};
static const char *swig_FeatureUnavailableError_base_names[] = {"Xapian::RuntimeError *",0};
static swig_lua_class _wrap_class_FeatureUnavailableError = { "FeatureUnavailableError", "FeatureUnavailableError", &SWIGTYPE_p_Xapian__FeatureUnavailableError,_proxy__wrap_new_FeatureUnavailableError, swig_delete_FeatureUnavailableError, swig_FeatureUnavailableError_methods, swig_FeatureUnavailableError_attributes, &swig_FeatureUnavailableError_Sf_SwigStatic, swig_FeatureUnavailableError_meta, swig_FeatureUnavailableError_bases, swig_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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 int _proxy__wrap_new_InternalError(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_InternalError);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_InternalError_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_InternalError_methods[]= {
    {0,0}
};
static swig_lua_method swig_InternalError_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_InternalError_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_InternalError_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_InternalError_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_InternalError_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_InternalError_Sf_SwigStatic = {
    "InternalError",
    swig_InternalError_Sf_SwigStatic_methods,
    swig_InternalError_Sf_SwigStatic_attributes,
    swig_InternalError_Sf_SwigStatic_constants,
    swig_InternalError_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_InternalError_bases[] = {0,0};
static const char *swig_InternalError_base_names[] = {"Xapian::RuntimeError *",0};
static swig_lua_class _wrap_class_InternalError = { "InternalError", "InternalError", &SWIGTYPE_p_Xapian__InternalError,_proxy__wrap_new_InternalError, swig_delete_InternalError, swig_InternalError_methods, swig_InternalError_attributes, &swig_InternalError_Sf_SwigStatic, swig_InternalError_meta, swig_InternalError_bases, swig_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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 int _proxy__wrap_new_NetworkError(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_NetworkError);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_NetworkError_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_NetworkError_methods[]= {
    {0,0}
};
static swig_lua_method swig_NetworkError_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_NetworkError_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_NetworkError_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_NetworkError_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_NetworkError_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_NetworkError_Sf_SwigStatic = {
    "NetworkError",
    swig_NetworkError_Sf_SwigStatic_methods,
    swig_NetworkError_Sf_SwigStatic_attributes,
    swig_NetworkError_Sf_SwigStatic_constants,
    swig_NetworkError_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_NetworkError_bases[] = {0,0};
static const char *swig_NetworkError_base_names[] = {"Xapian::RuntimeError *",0};
static swig_lua_class _wrap_class_NetworkError = { "NetworkError", "NetworkError", &SWIGTYPE_p_Xapian__NetworkError,_proxy__wrap_new_NetworkError, swig_delete_NetworkError, swig_NetworkError_methods, swig_NetworkError_attributes, &swig_NetworkError_Sf_SwigStatic, swig_NetworkError_meta, swig_NetworkError_bases, swig_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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 int _proxy__wrap_new_NetworkTimeoutError(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_NetworkTimeoutError);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_NetworkTimeoutError_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_NetworkTimeoutError_methods[]= {
    {0,0}
};
static swig_lua_method swig_NetworkTimeoutError_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_NetworkTimeoutError_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_NetworkTimeoutError_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_NetworkTimeoutError_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_NetworkTimeoutError_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_NetworkTimeoutError_Sf_SwigStatic = {
    "NetworkTimeoutError",
    swig_NetworkTimeoutError_Sf_SwigStatic_methods,
    swig_NetworkTimeoutError_Sf_SwigStatic_attributes,
    swig_NetworkTimeoutError_Sf_SwigStatic_constants,
    swig_NetworkTimeoutError_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_NetworkTimeoutError_bases[] = {0,0};
static const char *swig_NetworkTimeoutError_base_names[] = {"Xapian::NetworkError *",0};
static swig_lua_class _wrap_class_NetworkTimeoutError = { "NetworkTimeoutError", "NetworkTimeoutError", &SWIGTYPE_p_Xapian__NetworkTimeoutError,_proxy__wrap_new_NetworkTimeoutError, swig_delete_NetworkTimeoutError, swig_NetworkTimeoutError_methods, swig_NetworkTimeoutError_attributes, &swig_NetworkTimeoutError_Sf_SwigStatic, swig_NetworkTimeoutError_meta, swig_NetworkTimeoutError_bases, swig_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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 int _proxy__wrap_new_QueryParserError(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_QueryParserError);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_QueryParserError_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_QueryParserError_methods[]= {
    {0,0}
};
static swig_lua_method swig_QueryParserError_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_QueryParserError_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_QueryParserError_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_QueryParserError_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_QueryParserError_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_QueryParserError_Sf_SwigStatic = {
    "QueryParserError",
    swig_QueryParserError_Sf_SwigStatic_methods,
    swig_QueryParserError_Sf_SwigStatic_attributes,
    swig_QueryParserError_Sf_SwigStatic_constants,
    swig_QueryParserError_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_QueryParserError_bases[] = {0,0};
static const char *swig_QueryParserError_base_names[] = {"Xapian::RuntimeError *",0};
static swig_lua_class _wrap_class_QueryParserError = { "QueryParserError", "QueryParserError", &SWIGTYPE_p_Xapian__QueryParserError,_proxy__wrap_new_QueryParserError, swig_delete_QueryParserError, swig_QueryParserError_methods, swig_QueryParserError_attributes, &swig_QueryParserError_Sf_SwigStatic, swig_QueryParserError_meta, swig_QueryParserError_bases, swig_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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 int _proxy__wrap_new_SerialisationError(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_SerialisationError);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_SerialisationError_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_SerialisationError_methods[]= {
    {0,0}
};
static swig_lua_method swig_SerialisationError_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_SerialisationError_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_SerialisationError_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_SerialisationError_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_SerialisationError_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_SerialisationError_Sf_SwigStatic = {
    "SerialisationError",
    swig_SerialisationError_Sf_SwigStatic_methods,
    swig_SerialisationError_Sf_SwigStatic_attributes,
    swig_SerialisationError_Sf_SwigStatic_constants,
    swig_SerialisationError_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_SerialisationError_bases[] = {0,0};
static const char *swig_SerialisationError_base_names[] = {"Xapian::RuntimeError *",0};
static swig_lua_class _wrap_class_SerialisationError = { "SerialisationError", "SerialisationError", &SWIGTYPE_p_Xapian__SerialisationError,_proxy__wrap_new_SerialisationError, swig_delete_SerialisationError, swig_SerialisationError_methods, swig_SerialisationError_attributes, &swig_SerialisationError_Sf_SwigStatic, swig_SerialisationError_meta, swig_SerialisationError_bases, swig_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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 int _proxy__wrap_new_RangeError(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_RangeError);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_RangeError_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_RangeError_methods[]= {
    {0,0}
};
static swig_lua_method swig_RangeError_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_RangeError_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_RangeError_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_RangeError_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_RangeError_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_RangeError_Sf_SwigStatic = {
    "RangeError",
    swig_RangeError_Sf_SwigStatic_methods,
    swig_RangeError_Sf_SwigStatic_attributes,
    swig_RangeError_Sf_SwigStatic_constants,
    swig_RangeError_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_RangeError_bases[] = {0,0};
static const char *swig_RangeError_base_names[] = {"Xapian::RuntimeError *",0};
static swig_lua_class _wrap_class_RangeError = { "RangeError", "RangeError", &SWIGTYPE_p_Xapian__RangeError,_proxy__wrap_new_RangeError, swig_delete_RangeError, swig_RangeError_methods, swig_RangeError_attributes, &swig_RangeError_Sf_SwigStatic, swig_RangeError_meta, swig_RangeError_bases, swig_RangeError_base_names };

static int _wrap_new_WildcardError__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::WildcardError *result = 0 ;
  
  SWIG_check_num_args("Xapian::WildcardError::WildcardError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::WildcardError::WildcardError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::WildcardError::WildcardError",2,"std::string const &");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("Xapian::WildcardError::WildcardError",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::WildcardError *)new Xapian::WildcardError((std::string const &)*arg1,(std::string const &)*arg2,(char const *)arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__WildcardError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_WildcardError__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::WildcardError *result = 0 ;
  
  SWIG_check_num_args("Xapian::WildcardError::WildcardError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::WildcardError::WildcardError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::WildcardError::WildcardError",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::WildcardError::WildcardError",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::WildcardError *)new Xapian::WildcardError((std::string const &)*arg1,(std::string const &)*arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__WildcardError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_WildcardError__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::WildcardError *result = 0 ;
  
  SWIG_check_num_args("Xapian::WildcardError::WildcardError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::WildcardError::WildcardError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::WildcardError::WildcardError",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::WildcardError *)new Xapian::WildcardError((std::string const &)*arg1,(std::string const &)*arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__WildcardError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


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


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


static int _wrap_new_WildcardError(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_WildcardError__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_WildcardError__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_WildcardError__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_WildcardError__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_WildcardError__SWIG_0(L);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_WildcardError'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::WildcardError::WildcardError(std::string const &,std::string const &,char const *)\n"
    "    Xapian::WildcardError::WildcardError(std::string const &,std::string const &,int)\n"
    "    Xapian::WildcardError::WildcardError(std::string const &,std::string const &)\n"
    "    Xapian::WildcardError::WildcardError(std::string const &)\n"
    "    Xapian::WildcardError::WildcardError(std::string const &,int)\n");
  lua_error(L);return 0;
}


static void swig_delete_WildcardError(void *obj) {
Xapian::WildcardError *arg1 = (Xapian::WildcardError *) obj;
delete arg1;
}
static int _proxy__wrap_new_WildcardError(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_WildcardError);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_WildcardError_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_WildcardError_methods[]= {
    {0,0}
};
static swig_lua_method swig_WildcardError_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_WildcardError_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_WildcardError_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_WildcardError_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_WildcardError_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_WildcardError_Sf_SwigStatic = {
    "WildcardError",
    swig_WildcardError_Sf_SwigStatic_methods,
    swig_WildcardError_Sf_SwigStatic_attributes,
    swig_WildcardError_Sf_SwigStatic_constants,
    swig_WildcardError_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_WildcardError_bases[] = {0,0};
static const char *swig_WildcardError_base_names[] = {"Xapian::RuntimeError *",0};
static swig_lua_class _wrap_class_WildcardError = { "WildcardError", "WildcardError", &SWIGTYPE_p_Xapian__WildcardError,_proxy__wrap_new_WildcardError, swig_delete_WildcardError, swig_WildcardError_methods, swig_WildcardError_attributes, &swig_WildcardError_Sf_SwigStatic, swig_WildcardError_meta, swig_WildcardError_bases, swig_WildcardError_base_names };

static int _wrap_new_DatabaseNotFoundError__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::DatabaseNotFoundError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseNotFoundError::DatabaseNotFoundError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseNotFoundError::DatabaseNotFoundError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DatabaseNotFoundError::DatabaseNotFoundError",2,"std::string const &");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("Xapian::DatabaseNotFoundError::DatabaseNotFoundError",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::DatabaseNotFoundError *)new Xapian::DatabaseNotFoundError((std::string const &)*arg1,(std::string const &)*arg2,(char const *)arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseNotFoundError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseNotFoundError__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::DatabaseNotFoundError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseNotFoundError::DatabaseNotFoundError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseNotFoundError::DatabaseNotFoundError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DatabaseNotFoundError::DatabaseNotFoundError",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::DatabaseNotFoundError::DatabaseNotFoundError",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::DatabaseNotFoundError *)new Xapian::DatabaseNotFoundError((std::string const &)*arg1,(std::string const &)*arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseNotFoundError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseNotFoundError__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::DatabaseNotFoundError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseNotFoundError::DatabaseNotFoundError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseNotFoundError::DatabaseNotFoundError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DatabaseNotFoundError::DatabaseNotFoundError",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::DatabaseNotFoundError *)new Xapian::DatabaseNotFoundError((std::string const &)*arg1,(std::string const &)*arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseNotFoundError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


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


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


static int _wrap_new_DatabaseNotFoundError(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_DatabaseNotFoundError__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_DatabaseNotFoundError__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_DatabaseNotFoundError__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_DatabaseNotFoundError__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_DatabaseNotFoundError__SWIG_0(L);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_DatabaseNotFoundError'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::DatabaseNotFoundError::DatabaseNotFoundError(std::string const &,std::string const &,char const *)\n"
    "    Xapian::DatabaseNotFoundError::DatabaseNotFoundError(std::string const &,std::string const &,int)\n"
    "    Xapian::DatabaseNotFoundError::DatabaseNotFoundError(std::string const &,std::string const &)\n"
    "    Xapian::DatabaseNotFoundError::DatabaseNotFoundError(std::string const &)\n"
    "    Xapian::DatabaseNotFoundError::DatabaseNotFoundError(std::string const &,int)\n");
  lua_error(L);return 0;
}


static void swig_delete_DatabaseNotFoundError(void *obj) {
Xapian::DatabaseNotFoundError *arg1 = (Xapian::DatabaseNotFoundError *) obj;
delete arg1;
}
static int _proxy__wrap_new_DatabaseNotFoundError(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_DatabaseNotFoundError);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_DatabaseNotFoundError_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_DatabaseNotFoundError_methods[]= {
    {0,0}
};
static swig_lua_method swig_DatabaseNotFoundError_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_DatabaseNotFoundError_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_DatabaseNotFoundError_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_DatabaseNotFoundError_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_DatabaseNotFoundError_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_DatabaseNotFoundError_Sf_SwigStatic = {
    "DatabaseNotFoundError",
    swig_DatabaseNotFoundError_Sf_SwigStatic_methods,
    swig_DatabaseNotFoundError_Sf_SwigStatic_attributes,
    swig_DatabaseNotFoundError_Sf_SwigStatic_constants,
    swig_DatabaseNotFoundError_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_DatabaseNotFoundError_bases[] = {0,0};
static const char *swig_DatabaseNotFoundError_base_names[] = {"Xapian::DatabaseOpeningError *",0};
static swig_lua_class _wrap_class_DatabaseNotFoundError = { "DatabaseNotFoundError", "DatabaseNotFoundError", &SWIGTYPE_p_Xapian__DatabaseNotFoundError,_proxy__wrap_new_DatabaseNotFoundError, swig_delete_DatabaseNotFoundError, swig_DatabaseNotFoundError_methods, swig_DatabaseNotFoundError_attributes, &swig_DatabaseNotFoundError_Sf_SwigStatic, swig_DatabaseNotFoundError_meta, swig_DatabaseNotFoundError_bases, swig_DatabaseNotFoundError_base_names };

static int _wrap_new_DatabaseClosedError__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::DatabaseClosedError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseClosedError::DatabaseClosedError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseClosedError::DatabaseClosedError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DatabaseClosedError::DatabaseClosedError",2,"std::string const &");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("Xapian::DatabaseClosedError::DatabaseClosedError",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::DatabaseClosedError *)new Xapian::DatabaseClosedError((std::string const &)*arg1,(std::string const &)*arg2,(char const *)arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseClosedError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseClosedError__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::DatabaseClosedError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseClosedError::DatabaseClosedError",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseClosedError::DatabaseClosedError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DatabaseClosedError::DatabaseClosedError",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::DatabaseClosedError::DatabaseClosedError",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::DatabaseClosedError *)new Xapian::DatabaseClosedError((std::string const &)*arg1,(std::string const &)*arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseClosedError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DatabaseClosedError__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string temp1 ;
  std::string temp2 ;
  Xapian::DatabaseClosedError *result = 0 ;
  
  SWIG_check_num_args("Xapian::DatabaseClosedError::DatabaseClosedError",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::DatabaseClosedError::DatabaseClosedError",1,"std::string const &");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DatabaseClosedError::DatabaseClosedError",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::DatabaseClosedError *)new Xapian::DatabaseClosedError((std::string const &)*arg1,(std::string const &)*arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DatabaseClosedError,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


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


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


static int _wrap_new_DatabaseClosedError(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_DatabaseClosedError__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_DatabaseClosedError__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_DatabaseClosedError__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_DatabaseClosedError__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_DatabaseClosedError__SWIG_0(L);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_DatabaseClosedError'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::DatabaseClosedError::DatabaseClosedError(std::string const &,std::string const &,char const *)\n"
    "    Xapian::DatabaseClosedError::DatabaseClosedError(std::string const &,std::string const &,int)\n"
    "    Xapian::DatabaseClosedError::DatabaseClosedError(std::string const &,std::string const &)\n"
    "    Xapian::DatabaseClosedError::DatabaseClosedError(std::string const &)\n"
    "    Xapian::DatabaseClosedError::DatabaseClosedError(std::string const &,int)\n");
  lua_error(L);return 0;
}


static void swig_delete_DatabaseClosedError(void *obj) {
Xapian::DatabaseClosedError *arg1 = (Xapian::DatabaseClosedError *) obj;
delete arg1;
}
static int _proxy__wrap_new_DatabaseClosedError(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_DatabaseClosedError);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_DatabaseClosedError_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_DatabaseClosedError_methods[]= {
    {0,0}
};
static swig_lua_method swig_DatabaseClosedError_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_DatabaseClosedError_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_DatabaseClosedError_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_DatabaseClosedError_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_DatabaseClosedError_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_DatabaseClosedError_Sf_SwigStatic = {
    "DatabaseClosedError",
    swig_DatabaseClosedError_Sf_SwigStatic_methods,
    swig_DatabaseClosedError_Sf_SwigStatic_attributes,
    swig_DatabaseClosedError_Sf_SwigStatic_constants,
    swig_DatabaseClosedError_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_DatabaseClosedError_bases[] = {0,0};
static const char *swig_DatabaseClosedError_base_names[] = {"Xapian::DatabaseError *",0};
static swig_lua_class _wrap_class_DatabaseClosedError = { "DatabaseClosedError", "DatabaseClosedError", &SWIGTYPE_p_Xapian__DatabaseClosedError,_proxy__wrap_new_DatabaseClosedError, swig_delete_DatabaseClosedError, swig_DatabaseClosedError_methods, swig_DatabaseClosedError_attributes, &swig_DatabaseClosedError_Sf_SwigStatic, swig_DatabaseClosedError_meta, swig_DatabaseClosedError_bases, swig_DatabaseClosedError_base_names };

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(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PositionIterator *result = 0 ;
  
  SWIG_check_num_args("Xapian::PositionIterator::PositionIterator",0,0)
  result = (Xapian::PositionIterator *)new Xapian::PositionIterator();
  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_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 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_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 void swig_delete_PositionIterator(void *obj) {
Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) obj;
delete arg1;
}
static int _proxy__wrap_new_PositionIterator(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_PositionIterator);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_PositionIterator_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_PositionIterator_methods[]= {
    { "skip_to", _wrap_PositionIterator_skip_to},
    { "__tostring", _wrap_PositionIterator___tostring},
    { "equals", _wrap_PositionIterator_equals},
    { "get_termpos", _wrap_PositionIterator_get_termpos},
    { "next", _wrap_PositionIterator_next},
    {0,0}
};
static swig_lua_method swig_PositionIterator_meta[] = {
    { "__tostring", _wrap_PositionIterator___tostring},
    {0,0}
};

static swig_lua_attribute swig_PositionIterator_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_PositionIterator_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_PositionIterator_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_PositionIterator_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_PositionIterator_Sf_SwigStatic = {
    "PositionIterator",
    swig_PositionIterator_Sf_SwigStatic_methods,
    swig_PositionIterator_Sf_SwigStatic_attributes,
    swig_PositionIterator_Sf_SwigStatic_constants,
    swig_PositionIterator_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_PositionIterator_bases[] = {0};
static const char *swig_PositionIterator_base_names[] = {0};
static swig_lua_class _wrap_class_PositionIterator = { "PositionIterator", "PositionIterator", &SWIGTYPE_p_Xapian__PositionIterator,_proxy__wrap_new_PositionIterator, swig_delete_PositionIterator, swig_PositionIterator_methods, swig_PositionIterator_attributes, &swig_PositionIterator_Sf_SwigStatic, swig_PositionIterator_meta, swig_PositionIterator_bases, swig_PositionIterator_base_names };

static int _wrap___eq__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PositionIterator *arg1 = 0 ;
  Xapian::PositionIterator *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("Xapian::operator ==",2,2)
  if(!lua_isuserdata(L,1)) SWIG_fail_arg("Xapian::operator ==",1,"Xapian::PositionIterator const &");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::operator ==",2,"Xapian::PositionIterator const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PositionIterator,0))){
    SWIG_fail_ptr("__eq",1,SWIGTYPE_p_Xapian__PositionIterator);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__PositionIterator,0))){
    SWIG_fail_ptr("__eq",2,SWIGTYPE_p_Xapian__PositionIterator);
  }
  
  {
    try {
      result = (bool)Xapian::operator ==((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_new_PostingIterator(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PostingIterator *result = 0 ;
  
  SWIG_check_num_args("Xapian::PostingIterator::PostingIterator",0,0)
  result = (Xapian::PostingIterator *)new Xapian::PostingIterator();
  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_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_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_unique_terms(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::termcount result;
  
  SWIG_check_num_args("Xapian::PostingIterator::get_unique_terms",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PostingIterator::get_unique_terms",1,"Xapian::PostingIterator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PostingIterator,0))){
    SWIG_fail_ptr("PostingIterator_get_unique_terms",1,SWIGTYPE_p_Xapian__PostingIterator);
  }
  
  {
    try {
      result = (Xapian::termcount)((Xapian::PostingIterator const *)arg1)->get_unique_terms();
    } 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);
  }
  
  result = ((Xapian::PostingIterator const *)arg1)->positionlist_end();
  {
    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_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___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_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 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 void swig_delete_PostingIterator(void *obj) {
Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) obj;
delete arg1;
}
static int _proxy__wrap_new_PostingIterator(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_PostingIterator);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_PostingIterator_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_PostingIterator_methods[]= {
    { "get_wdf", _wrap_PostingIterator_get_wdf},
    { "get_doclength", _wrap_PostingIterator_get_doclength},
    { "get_unique_terms", _wrap_PostingIterator_get_unique_terms},
    { "positionlist_begin", _wrap_PostingIterator_positionlist_begin},
    { "positionlist_end", _wrap_PostingIterator_positionlist_end},
    { "skip_to", _wrap_PostingIterator_skip_to},
    { "__tostring", _wrap_PostingIterator___tostring},
    { "equals", _wrap_PostingIterator_equals},
    { "get_docid", _wrap_PostingIterator_get_docid},
    { "next", _wrap_PostingIterator_next},
    {0,0}
};
static swig_lua_method swig_PostingIterator_meta[] = {
    { "__tostring", _wrap_PostingIterator___tostring},
    {0,0}
};

static swig_lua_attribute swig_PostingIterator_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_PostingIterator_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_PostingIterator_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_PostingIterator_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_PostingIterator_Sf_SwigStatic = {
    "PostingIterator",
    swig_PostingIterator_Sf_SwigStatic_methods,
    swig_PostingIterator_Sf_SwigStatic_attributes,
    swig_PostingIterator_Sf_SwigStatic_constants,
    swig_PostingIterator_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_PostingIterator_bases[] = {0};
static const char *swig_PostingIterator_base_names[] = {0};
static swig_lua_class _wrap_class_PostingIterator = { "PostingIterator", "PostingIterator", &SWIGTYPE_p_Xapian__PostingIterator,_proxy__wrap_new_PostingIterator, swig_delete_PostingIterator, swig_PostingIterator_methods, swig_PostingIterator_attributes, &swig_PostingIterator_Sf_SwigStatic, swig_PostingIterator_meta, swig_PostingIterator_bases, swig_PostingIterator_base_names };

static int _wrap___eq__SWIG_1(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(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermIterator *result = 0 ;
  
  SWIG_check_num_args("Xapian::TermIterator::TermIterator",0,0)
  result = (Xapian::TermIterator *)new Xapian::TermIterator();
  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_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 const *");
  
  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 = ((Xapian::TermIterator 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_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 const *");
  
  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);
  }
  
  result = ((Xapian::TermIterator const *)arg1)->positionlist_end();
  {
    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_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___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 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_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 void swig_delete_TermIterator(void *obj) {
Xapian::TermIterator *arg1 = (Xapian::TermIterator *) obj;
delete arg1;
}
static int _proxy__wrap_new_TermIterator(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_TermIterator);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_TermIterator_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_TermIterator_methods[]= {
    { "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},
    { "skip_to", _wrap_TermIterator_skip_to},
    { "__tostring", _wrap_TermIterator___tostring},
    { "equals", _wrap_TermIterator_equals},
    { "get_term", _wrap_TermIterator_get_term},
    { "next", _wrap_TermIterator_next},
    {0,0}
};
static swig_lua_method swig_TermIterator_meta[] = {
    { "__tostring", _wrap_TermIterator___tostring},
    {0,0}
};

static swig_lua_attribute swig_TermIterator_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_TermIterator_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_TermIterator_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_TermIterator_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_TermIterator_Sf_SwigStatic = {
    "TermIterator",
    swig_TermIterator_Sf_SwigStatic_methods,
    swig_TermIterator_Sf_SwigStatic_attributes,
    swig_TermIterator_Sf_SwigStatic_constants,
    swig_TermIterator_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_TermIterator_bases[] = {0};
static const char *swig_TermIterator_base_names[] = {0};
static swig_lua_class _wrap_class_TermIterator = { "TermIterator", "TermIterator", &SWIGTYPE_p_Xapian__TermIterator,_proxy__wrap_new_TermIterator, swig_delete_TermIterator, swig_TermIterator_methods, swig_TermIterator_attributes, &swig_TermIterator_Sf_SwigStatic, swig_TermIterator_meta, swig_TermIterator_bases, swig_TermIterator_base_names };

static int _wrap___eq__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermIterator *arg1 = 0 ;
  Xapian::TermIterator *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("Xapian::operator ==",2,2)
  if(!lua_isuserdata(L,1)) SWIG_fail_arg("Xapian::operator ==",1,"Xapian::TermIterator const &");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::operator ==",2,"Xapian::TermIterator const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermIterator,0))){
    SWIG_fail_ptr("__eq",1,SWIGTYPE_p_Xapian__TermIterator);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__TermIterator,0))){
    SWIG_fail_ptr("__eq",2,SWIGTYPE_p_Xapian__TermIterator);
  }
  
  {
    try {
      result = (bool)Xapian::operator ==((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_new_ValueIterator(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueIterator *result = 0 ;
  
  SWIG_check_num_args("Xapian::ValueIterator::ValueIterator",0,0)
  result = (Xapian::ValueIterator *)new Xapian::ValueIterator();
  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_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 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_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 void swig_delete_ValueIterator(void *obj) {
Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) obj;
delete arg1;
}
static int _proxy__wrap_new_ValueIterator(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_ValueIterator);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_ValueIterator_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_ValueIterator_methods[]= {
    { "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},
    { "equals", _wrap_ValueIterator_equals},
    { "get_value", _wrap_ValueIterator_get_value},
    { "next", _wrap_ValueIterator_next},
    {0,0}
};
static swig_lua_method swig_ValueIterator_meta[] = {
    { "__tostring", _wrap_ValueIterator___tostring},
    {0,0}
};

static swig_lua_attribute swig_ValueIterator_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_ValueIterator_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_ValueIterator_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_ValueIterator_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_ValueIterator_Sf_SwigStatic = {
    "ValueIterator",
    swig_ValueIterator_Sf_SwigStatic_methods,
    swig_ValueIterator_Sf_SwigStatic_attributes,
    swig_ValueIterator_Sf_SwigStatic_constants,
    swig_ValueIterator_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_ValueIterator_bases[] = {0};
static const char *swig_ValueIterator_base_names[] = {0};
static swig_lua_class _wrap_class_ValueIterator = { "ValueIterator", "ValueIterator", &SWIGTYPE_p_Xapian__ValueIterator,_proxy__wrap_new_ValueIterator, swig_delete_ValueIterator, swig_ValueIterator_methods, swig_ValueIterator_attributes, &swig_ValueIterator_Sf_SwigStatic, swig_ValueIterator_meta, swig_ValueIterator_bases, swig_ValueIterator_base_names };

static int _wrap___eq__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueIterator *arg1 = 0 ;
  Xapian::ValueIterator *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("Xapian::operator ==",2,2)
  if(!lua_isuserdata(L,1)) SWIG_fail_arg("Xapian::operator ==",1,"Xapian::ValueIterator const &");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::operator ==",2,"Xapian::ValueIterator const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ValueIterator,0))){
    SWIG_fail_ptr("__eq",1,SWIGTYPE_p_Xapian__ValueIterator);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__ValueIterator,0))){
    SWIG_fail_ptr("__eq",2,SWIGTYPE_p_Xapian__ValueIterator);
  }
  
  {
    try {
      result = (bool)Xapian::operator ==((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_new_Document(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_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);
          }
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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);
          }
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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_postings__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termpos arg3 ;
  Xapian::termpos arg4 ;
  Xapian::termcount arg5 ;
  std::string temp2 ;
  Xapian::termpos result;
  
  SWIG_check_num_args("Xapian::Document::remove_postings",5,5)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Document::remove_postings",1,"Xapian::Document *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Document::remove_postings",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Document::remove_postings",3,"Xapian::termpos");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::Document::remove_postings",4,"Xapian::termpos");
  if(!lua_isnumber(L,5)) SWIG_fail_arg("Xapian::Document::remove_postings",5,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("Document_remove_postings",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::termpos)lua_tonumber(L, 4);
  SWIG_contract_assert((lua_tonumber(L,5)>=0),"number must not be negative")
  arg5 = (Xapian::termcount)lua_tonumber(L, 5);
  {
    try {
      result = (Xapian::termpos)(arg1)->remove_postings((std::string const &)*arg2,arg3,arg4,arg5);
    } 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_remove_postings__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termpos arg3 ;
  Xapian::termpos arg4 ;
  std::string temp2 ;
  Xapian::termpos result;
  
  SWIG_check_num_args("Xapian::Document::remove_postings",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Document::remove_postings",1,"Xapian::Document *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Document::remove_postings",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Document::remove_postings",3,"Xapian::termpos");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::Document::remove_postings",4,"Xapian::termpos");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("Document_remove_postings",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::termpos)lua_tonumber(L, 4);
  {
    try {
      result = (Xapian::termpos)(arg1)->remove_postings((std::string const &)*arg2,arg3,arg4);
    } 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_remove_postings(lua_State* L) {
  int argc;
  int argv[6]={
    1,2,3,4,5,6
  };
  
  argc = lua_gettop(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_postings__SWIG_1(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__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) {
            {
              _v = lua_isnumber(L,argv[4]);
            }
            if (_v) {
              return _wrap_Document_remove_postings__SWIG_0(L);
            }
          }
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Document_remove_postings'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Document::remove_postings(std::string const &,Xapian::termpos,Xapian::termpos,Xapian::termcount)\n"
    "    Xapian::Document::remove_postings(std::string const &,Xapian::termpos,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);
  }
  
  result = ((Xapian::Document const *)arg1)->termlist_end();
  {
    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);
  }
  
  result = ((Xapian::Document const *)arg1)->values_end();
  {
    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 ;
  SwigValueWrapper< 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 int _proxy__wrap_new_Document(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_Document);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_Document_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_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_postings", _wrap_Document_remove_postings},
    { "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_method swig_Document_meta[] = {
    { "__tostring", _wrap_Document___tostring},
    {0,0}
};

static swig_lua_attribute swig_Document_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_Document_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_Document_Sf_SwigStatic_methods[]= {
    { "unserialise", _wrap_Document_unserialise},
    {0,0}
};
static swig_lua_class* swig_Document_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_Document_Sf_SwigStatic = {
    "Document",
    swig_Document_Sf_SwigStatic_methods,
    swig_Document_Sf_SwigStatic_attributes,
    swig_Document_Sf_SwigStatic_constants,
    swig_Document_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_Document_bases[] = {0};
static const char *swig_Document_base_names[] = {0};
static swig_lua_class _wrap_class_Document = { "Document", "Document", &SWIGTYPE_p_Xapian__Document,_proxy__wrap_new_Document, swig_delete_Document, swig_Document_methods, swig_Document_attributes, &swig_Document_Sf_SwigStatic, swig_Document_meta, swig_Document_bases, swig_Document_base_names };

static int _wrap_new_Registry(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_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 int _wrap_Registry_register_lat_long_metric(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Registry *arg1 = (Xapian::Registry *) 0 ;
  Xapian::LatLongMetric *arg2 = 0 ;
  
  SWIG_check_num_args("Xapian::Registry::register_lat_long_metric",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Registry::register_lat_long_metric",1,"Xapian::Registry *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::Registry::register_lat_long_metric",2,"Xapian::LatLongMetric const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Registry,0))){
    SWIG_fail_ptr("Registry_register_lat_long_metric",1,SWIGTYPE_p_Xapian__Registry);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__LatLongMetric,0))){
    SWIG_fail_ptr("Registry_register_lat_long_metric",2,SWIGTYPE_p_Xapian__LatLongMetric);
  }
  
  {
    try {
      (arg1)->register_lat_long_metric((Xapian::LatLongMetric 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_lat_long_metric(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Registry *arg1 = (Xapian::Registry *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  Xapian::LatLongMetric *result = 0 ;
  
  SWIG_check_num_args("Xapian::Registry::get_lat_long_metric",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Registry::get_lat_long_metric",1,"Xapian::Registry const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Registry::get_lat_long_metric",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Registry,0))){
    SWIG_fail_ptr("Registry_get_lat_long_metric",1,SWIGTYPE_p_Xapian__Registry);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = (Xapian::LatLongMetric *)((Xapian::Registry const *)arg1)->get_lat_long_metric((std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__LatLongMetric,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 int _proxy__wrap_new_Registry(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_Registry);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_Registry_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_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},
    { "register_lat_long_metric", _wrap_Registry_register_lat_long_metric},
    { "get_lat_long_metric", _wrap_Registry_get_lat_long_metric},
    {0,0}
};
static swig_lua_method swig_Registry_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_Registry_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_Registry_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_Registry_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_Registry_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_Registry_Sf_SwigStatic = {
    "Registry",
    swig_Registry_Sf_SwigStatic_methods,
    swig_Registry_Sf_SwigStatic_attributes,
    swig_Registry_Sf_SwigStatic_constants,
    swig_Registry_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_Registry_bases[] = {0};
static const char *swig_Registry_base_names[] = {0};
static swig_lua_class _wrap_class_Registry = { "Registry", "Registry", &SWIGTYPE_p_Xapian__Registry,_proxy__wrap_new_Registry, swig_delete_Registry, swig_Registry_methods, swig_Registry_attributes, &swig_Registry_Sf_SwigStatic, swig_Registry_meta, swig_Registry_bases, swig_Registry_base_names };

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_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_new_Query__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Query *result = 0 ;
  
  SWIG_check_num_args("Xapian::Query::Query",0,0)
  result = (Xapian::Query *)new Xapian::Query();
  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;
  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_2(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_3(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_4(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_new_Query__SWIG_5(lua_State* L) {
  int SWIG_arg = 0;
  double arg1 ;
  Xapian::Query *arg2 = 0 ;
  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,"double");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::Query::Query",2,"Xapian::Query const &");
  arg1 = (double)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);
  }
  
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1,(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__SWIG_6(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Query::op arg1 ;
  Xapian::Query *arg2 = 0 ;
  double arg3 ;
  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_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**)&arg2,SWIGTYPE_p_Xapian__Query,0))){
    SWIG_fail_ptr("new_Query",2,SWIGTYPE_p_Xapian__Query);
  }
  
  arg3 = (double)lua_tonumber(L, 3);
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1,(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_7(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_8(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::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_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 ;
  std::string *arg2 = 0 ;
  Xapian::termcount arg3 ;
  int arg4 ;
  Xapian::Query::op arg5 ;
  std::string temp2 ;
  Xapian::Query *result = 0 ;
  
  SWIG_check_num_args("Xapian::Query::Query",5,5)
  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_isnumber(L,3)) SWIG_fail_arg("Xapian::Query::Query",3,"Xapian::termcount");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::Query::Query",4,"int");
  if(!lua_isnumber(L,5)) SWIG_fail_arg("Xapian::Query::Query",5,"Xapian::Query::op");
  arg1 = (Xapian::Query::op)(int)lua_tonumber(L, 1);
  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);
  arg4 = (int)lua_tonumber(L, 4);
  arg5 = (Xapian::Query::op)(int)lua_tonumber(L, 5);
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1,(std::string const &)*arg2,arg3,arg4,arg5);
    } 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::Query::op arg1 ;
  std::string *arg2 = 0 ;
  Xapian::termcount arg3 ;
  int arg4 ;
  std::string temp2 ;
  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_isstring(L,2)) SWIG_fail_arg("Xapian::Query::Query",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Query::Query",3,"Xapian::termcount");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::Query::Query",4,"int");
  arg1 = (Xapian::Query::op)(int)lua_tonumber(L, 1);
  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);
  arg4 = (int)lua_tonumber(L, 4);
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1,(std::string const &)*arg2,arg3,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_13(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Query::op arg1 ;
  std::string *arg2 = 0 ;
  Xapian::termcount arg3 ;
  std::string temp2 ;
  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_isnumber(L,3)) SWIG_fail_arg("Xapian::Query::Query",3,"Xapian::termcount");
  arg1 = (Xapian::Query::op)(int)lua_tonumber(L, 1);
  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 {
      result = (Xapian::Query *)new Xapian::Query(arg1,(std::string 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::string *arg2 = 0 ;
  std::string temp2 ;
  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");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Query::Query",2,"std::string const &");
  arg1 = (Xapian::Query::op)(int)lua_tonumber(L, 1);
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1,(std::string 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__SWIG_17(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Query::op arg1 ;
  XapianSWIGQueryItor arg2 ;
  XapianSWIGQueryItor arg3 ;
  Xapian::termcount arg4 ;
  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);
  {
    if (lua_istable(L, 2)) {
      (&arg2)->begin(L, 2);
      (&arg3)->end(L, 2, lua_rawlen(L, 2));
    } else {
      (&arg2)->end();
      (&arg3)->end();
    }
  }
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg4 = (Xapian::termcount)lua_tonumber(L, 3);
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1,arg2,arg3,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_18(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Query::op arg1 ;
  XapianSWIGQueryItor arg2 ;
  XapianSWIGQueryItor arg3 ;
  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);
  {
    if (lua_istable(L, 2)) {
      (&arg2)->begin(L, 2);
      (&arg3)->end(L, 2, lua_rawlen(L, 2));
    } else {
      (&arg2)->end();
      (&arg3)->end();
    }
  }
  {
    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_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);
  }
  
  result = ((Xapian::Query const *)arg1)->get_terms_end();
  {
    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_unique_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_unique_terms_begin",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Query::get_unique_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_unique_terms_begin",1,SWIGTYPE_p_Xapian__Query);
  }
  
  {
    try {
      result = ((Xapian::Query const *)arg1)->get_unique_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_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);
  }
  
  result = (Xapian::termcount)((Xapian::Query const *)arg1)->get_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_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);
  }
  
  result = (bool)((Xapian::Query 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_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 ;
  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__SWIG_1(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(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_1(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_0(L);
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Query_unserialise'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Query::unserialise(std::string const &,Xapian::Registry const &)\n"
    "    Xapian::Query::unserialise(std::string const &)\n");
  lua_error(L);return 0;
}


static int _wrap_Query_get_type(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  Xapian::Query::op result;
  
  SWIG_check_num_args("Xapian::Query::get_type",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Query::get_type",1,"Xapian::Query const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Query,0))){
    SWIG_fail_ptr("Query_get_type",1,SWIGTYPE_p_Xapian__Query);
  }
  
  result = (Xapian::Query::op)((Xapian::Query const *)arg1)->get_type();
  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_Query_get_num_subqueries(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  size_t result;
  
  SWIG_check_num_args("Xapian::Query::get_num_subqueries",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Query::get_num_subqueries",1,"Xapian::Query const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Query,0))){
    SWIG_fail_ptr("Query_get_num_subqueries",1,SWIGTYPE_p_Xapian__Query);
  }
  
  result = ((Xapian::Query const *)arg1)->get_num_subqueries();
  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_subquery(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  size_t arg2 ;
  Xapian::Query result;
  
  SWIG_check_num_args("Xapian::Query::get_subquery",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Query::get_subquery",1,"Xapian::Query const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Query::get_subquery",2,"size_t");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Query,0))){
    SWIG_fail_ptr("Query_get_subquery",1,SWIGTYPE_p_Xapian__Query);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (size_t)lua_tonumber(L, 2);
  {
    try {
      result = ((Xapian::Query const *)arg1)->get_subquery(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___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_new_Query__SWIG_19(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Query::op arg1 ;
  Xapian::Query *result = 0 ;
  
  SWIG_check_num_args("Xapian::Query::Query",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::Query::Query",1,"Xapian::Query::op");
  arg1 = (Xapian::Query::op)(int)lua_tonumber(L, 1);
  {
    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_new_Query(lua_State* L) {
  int argc;
  int argv[6]={
    1,2,3,4,5,6
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    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_4(L);
    }
  }
  if (argc == 1) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_Query__SWIG_19(L);
    }
  }
  if (argc == 1) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_Query__SWIG_3(L);
    }
  }
  if (argc == 2) {
    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) {
        return _wrap_new_Query__SWIG_5(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_Query__SWIG_14(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) {
        if (argc <= 2) {
          return _wrap_new_Query__SWIG_18(L);
        }
        return _wrap_new_Query__SWIG_18(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_2(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_7(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_6(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_9(L);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_Query__SWIG_13(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_8(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_17(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_1(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);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    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_new_Query__SWIG_12(L);
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    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) {
            {
              _v = lua_isnumber(L,argv[4]);
            }
            if (_v) {
              return _wrap_new_Query__SWIG_11(L);
            }
          }
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_Query'\n"
    "  Possible C/C++ prototypes are:\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::PostingSource *)\n"
    "    Xapian::Query::Query(double,Xapian::Query const &)\n"
    "    Xapian::Query::Query(Xapian::Query::op,Xapian::Query const &,double)\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::valueno,std::string const &)\n"
    "    Xapian::Query::Query(Xapian::Query::op,Xapian::valueno,std::string const &,std::string const &)\n"
    "    Xapian::Query::Query(Xapian::Query::op,std::string const &,Xapian::termcount,int,Xapian::Query::op)\n"
    "    Xapian::Query::Query(Xapian::Query::op,std::string const &,Xapian::termcount,int)\n"
    "    Xapian::Query::Query(Xapian::Query::op,std::string const &,Xapian::termcount)\n"
    "    Xapian::Query::Query(Xapian::Query::op,std::string const &)\n"
    "    Xapian::Query::Query(Xapian::Query::op,XapianSWIGQueryItor,XapianSWIGQueryItor,Xapian::termcount)\n"
    "    Xapian::Query::Query(Xapian::Query::op,XapianSWIGQueryItor,XapianSWIGQueryItor)\n"
    "    Xapian::Query::Query(Xapian::Query::op)\n");
  lua_error(L);return 0;
}


static int _wrap_Query_get_terms(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  SwigValueWrapper< 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 void swig_delete_Query(void *obj) {
Xapian::Query *arg1 = (Xapian::Query *) obj;
delete arg1;
}
static int _proxy__wrap_new_Query(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_Query);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_Query_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_Query_methods[]= {
    { "get_terms_begin", _wrap_Query_get_terms_begin},
    { "get_terms_end", _wrap_Query_get_terms_end},
    { "get_unique_terms_begin", _wrap_Query_get_unique_terms_begin},
    { "get_length", _wrap_Query_get_length},
    { "empty", _wrap_Query_empty},
    { "serialise", _wrap_Query_serialise},
    { "get_type", _wrap_Query_get_type},
    { "get_num_subqueries", _wrap_Query_get_num_subqueries},
    { "get_subquery", _wrap_Query_get_subquery},
    { "__tostring", _wrap_Query___tostring},
    { "get_terms", _wrap_Query_get_terms},
    {0,0}
};
static swig_lua_method swig_Query_meta[] = {
    { "__tostring", _wrap_Query___tostring},
    {0,0}
};

static swig_lua_attribute swig_Query_Sf_SwigStatic_attributes[] = {
    { "MatchNothing", _wrap_Query_MatchNothing_get, SWIG_Lua_set_immutable },
    { "MatchAll", _wrap_Query_MatchAll_get, SWIG_Lua_set_immutable },
    {0,0,0}
};
static swig_lua_const_info swig_Query_Sf_SwigStatic_constants[]= {
    {SWIG_LUA_CONSTTAB_INT("OP_AND", Xapian::Query::OP_AND)},
    {SWIG_LUA_CONSTTAB_INT("OP_OR", Xapian::Query::OP_OR)},
    {SWIG_LUA_CONSTTAB_INT("OP_AND_NOT", Xapian::Query::OP_AND_NOT)},
    {SWIG_LUA_CONSTTAB_INT("OP_XOR", Xapian::Query::OP_XOR)},
    {SWIG_LUA_CONSTTAB_INT("OP_AND_MAYBE", Xapian::Query::OP_AND_MAYBE)},
    {SWIG_LUA_CONSTTAB_INT("OP_FILTER", Xapian::Query::OP_FILTER)},
    {SWIG_LUA_CONSTTAB_INT("OP_NEAR", Xapian::Query::OP_NEAR)},
    {SWIG_LUA_CONSTTAB_INT("OP_PHRASE", Xapian::Query::OP_PHRASE)},
    {SWIG_LUA_CONSTTAB_INT("OP_VALUE_RANGE", Xapian::Query::OP_VALUE_RANGE)},
    {SWIG_LUA_CONSTTAB_INT("OP_SCALE_WEIGHT", Xapian::Query::OP_SCALE_WEIGHT)},
    {SWIG_LUA_CONSTTAB_INT("OP_ELITE_SET", Xapian::Query::OP_ELITE_SET)},
    {SWIG_LUA_CONSTTAB_INT("OP_VALUE_GE", Xapian::Query::OP_VALUE_GE)},
    {SWIG_LUA_CONSTTAB_INT("OP_VALUE_LE", Xapian::Query::OP_VALUE_LE)},
    {SWIG_LUA_CONSTTAB_INT("OP_SYNONYM", Xapian::Query::OP_SYNONYM)},
    {SWIG_LUA_CONSTTAB_INT("OP_MAX", Xapian::Query::OP_MAX)},
    {SWIG_LUA_CONSTTAB_INT("OP_WILDCARD", Xapian::Query::OP_WILDCARD)},
    {SWIG_LUA_CONSTTAB_INT("OP_INVALID", Xapian::Query::OP_INVALID)},
    {SWIG_LUA_CONSTTAB_INT("WILDCARD_LIMIT_ERROR", Xapian::Query::WILDCARD_LIMIT_ERROR)},
    {SWIG_LUA_CONSTTAB_INT("WILDCARD_LIMIT_FIRST", Xapian::Query::WILDCARD_LIMIT_FIRST)},
    {SWIG_LUA_CONSTTAB_INT("WILDCARD_LIMIT_MOST_FREQUENT", Xapian::Query::WILDCARD_LIMIT_MOST_FREQUENT)},
    {0,0,0,0,0,0}
};
static swig_lua_method swig_Query_Sf_SwigStatic_methods[]= {
    { "unserialise", _wrap_Query_unserialise},
    {0,0}
};
static swig_lua_class* swig_Query_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_Query_Sf_SwigStatic = {
    "Query",
    swig_Query_Sf_SwigStatic_methods,
    swig_Query_Sf_SwigStatic_attributes,
    swig_Query_Sf_SwigStatic_constants,
    swig_Query_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_Query_bases[] = {0};
static const char *swig_Query_base_names[] = {0};
static swig_lua_class _wrap_class_Query = { "Query", "Query", &SWIGTYPE_p_Xapian__Query,_proxy__wrap_new_Query, swig_delete_Query, swig_Query_methods, swig_Query_attributes, &swig_Query_Sf_SwigStatic, swig_Query_meta, swig_Query_bases, swig_Query_base_names };

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);
    }
  }
  
  SWIG_Lua_pusherrstring(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 int _proxy__wrap_new_Stem(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_Stem);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_Stem_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_Stem_methods[]= {
    { "__call", _wrap_Stem___call},
    { "__tostring", _wrap_Stem___tostring},
    {0,0}
};
static swig_lua_method swig_Stem_meta[] = {
    { "__call", _wrap_Stem___call},
    { "__tostring", _wrap_Stem___tostring},
    {0,0}
};

static swig_lua_attribute swig_Stem_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_Stem_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_Stem_Sf_SwigStatic_methods[]= {
    { "get_available_languages", _wrap_Stem_get_available_languages},
    {0,0}
};
static swig_lua_class* swig_Stem_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_Stem_Sf_SwigStatic = {
    "Stem",
    swig_Stem_Sf_SwigStatic_methods,
    swig_Stem_Sf_SwigStatic_attributes,
    swig_Stem_Sf_SwigStatic_constants,
    swig_Stem_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_Stem_bases[] = {0};
static const char *swig_Stem_base_names[] = {0};
static swig_lua_class _wrap_class_Stem = { "Stem", "Stem", &SWIGTYPE_p_Xapian__Stem,_proxy__wrap_new_Stem, swig_delete_Stem, swig_Stem_methods, swig_Stem_attributes, &swig_Stem_Sf_SwigStatic, swig_Stem_meta, swig_Stem_bases, swig_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);
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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)lua_tonumber(L, 2);
  arg3 = (Xapian::TermGenerator::flags)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) 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)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) 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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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_stopper_strategy(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  Xapian::TermGenerator::stop_strategy arg2 ;
  
  SWIG_check_num_args("Xapian::TermGenerator::set_stopper_strategy",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TermGenerator::set_stopper_strategy",1,"Xapian::TermGenerator *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::TermGenerator::set_stopper_strategy",2,"Xapian::TermGenerator::stop_strategy");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TermGenerator,0))){
    SWIG_fail_ptr("TermGenerator_set_stopper_strategy",1,SWIGTYPE_p_Xapian__TermGenerator);
  }
  
  arg2 = (Xapian::TermGenerator::stop_strategy)(int)lua_tonumber(L, 2);
  {
    try {
      (arg1)->set_stopper_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);
          }
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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);
          }
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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::termpos 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::termpos");
  
  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::termpos)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);
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'TermGenerator_increase_termpos'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::TermGenerator::increase_termpos(Xapian::termpos)\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::termpos 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::termpos)((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::termpos 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::termpos");
  
  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::termpos)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 int _proxy__wrap_new_TermGenerator(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_TermGenerator);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_TermGenerator_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_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_stopper_strategy", _wrap_TermGenerator_set_stopper_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_method swig_TermGenerator_meta[] = {
    { "__tostring", _wrap_TermGenerator___tostring},
    {0,0}
};

static swig_lua_attribute swig_TermGenerator_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_TermGenerator_Sf_SwigStatic_constants[]= {
    {SWIG_LUA_CONSTTAB_INT("FLAG_SPELLING", Xapian::TermGenerator::FLAG_SPELLING)},
    {SWIG_LUA_CONSTTAB_INT("FLAG_CJK_NGRAM", Xapian::TermGenerator::FLAG_CJK_NGRAM)},
    {SWIG_LUA_CONSTTAB_INT("STEM_NONE", Xapian::TermGenerator::STEM_NONE)},
    {SWIG_LUA_CONSTTAB_INT("STEM_SOME", Xapian::TermGenerator::STEM_SOME)},
    {SWIG_LUA_CONSTTAB_INT("STEM_ALL", Xapian::TermGenerator::STEM_ALL)},
    {SWIG_LUA_CONSTTAB_INT("STEM_ALL_Z", Xapian::TermGenerator::STEM_ALL_Z)},
    {SWIG_LUA_CONSTTAB_INT("STEM_SOME_FULL_POS", Xapian::TermGenerator::STEM_SOME_FULL_POS)},
    {SWIG_LUA_CONSTTAB_INT("STOP_NONE", Xapian::TermGenerator::STOP_NONE)},
    {SWIG_LUA_CONSTTAB_INT("STOP_ALL", Xapian::TermGenerator::STOP_ALL)},
    {SWIG_LUA_CONSTTAB_INT("STOP_STEMMED", Xapian::TermGenerator::STOP_STEMMED)},
    {0,0,0,0,0,0}
};
static swig_lua_method swig_TermGenerator_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_TermGenerator_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_TermGenerator_Sf_SwigStatic = {
    "TermGenerator",
    swig_TermGenerator_Sf_SwigStatic_methods,
    swig_TermGenerator_Sf_SwigStatic_attributes,
    swig_TermGenerator_Sf_SwigStatic_constants,
    swig_TermGenerator_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_TermGenerator_bases[] = {0};
static const char *swig_TermGenerator_base_names[] = {0};
static swig_lua_class _wrap_class_TermGenerator = { "TermGenerator", "TermGenerator", &SWIGTYPE_p_Xapian__TermGenerator,_proxy__wrap_new_TermGenerator, swig_delete_TermGenerator, swig_TermGenerator_methods, swig_TermGenerator_attributes, &swig_TermGenerator_Sf_SwigStatic, swig_TermGenerator_meta, swig_TermGenerator_bases, swig_TermGenerator_base_names };

static int _wrap_new_MSet(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_MSet_convert_to_percent__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  double arg2 ;
  int 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,"double");
  
  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 = (double)lua_tonumber(L, 2);
  {
    try {
      result = (int)((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 ;
  int 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 = (int)((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);
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'MSet_convert_to_percent'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::MSet::convert_to_percent(double) 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 = 0 ;
  std::string temp2 ;
  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 const &");
  
  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);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet 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_MSet_get_termweight(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  double 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 const &");
  
  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);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = (double)((Xapian::MSet const *)arg1)->get_termweight((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_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_attained(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  double 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 const *");
  
  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 = (double)((Xapian::MSet const *)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_get_max_possible(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  double 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 const *");
  
  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 = (double)((Xapian::MSet const *)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_snippet__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  std::string *arg2 = 0 ;
  size_t arg3 ;
  Xapian::Stem *arg4 = 0 ;
  unsigned int arg5 ;
  std::string *arg6 = 0 ;
  std::string *arg7 = 0 ;
  std::string *arg8 = 0 ;
  std::string temp2 ;
  std::string temp6 ;
  std::string temp7 ;
  std::string temp8 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::MSet::snippet",8,8)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::snippet",1,"Xapian::MSet const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::MSet::snippet",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::MSet::snippet",3,"size_t");
  if(!lua_isuserdata(L,4)) SWIG_fail_arg("Xapian::MSet::snippet",4,"Xapian::Stem const &");
  if(!lua_isnumber(L,5)) SWIG_fail_arg("Xapian::MSet::snippet",5,"unsigned int");
  if(!lua_isstring(L,6)) SWIG_fail_arg("Xapian::MSet::snippet",6,"std::string const &");
  if(!lua_isstring(L,7)) SWIG_fail_arg("Xapian::MSet::snippet",7,"std::string const &");
  if(!lua_isstring(L,8)) SWIG_fail_arg("Xapian::MSet::snippet",8,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet_snippet",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  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_Xapian__Stem,0))){
    SWIG_fail_ptr("MSet_snippet",4,SWIGTYPE_p_Xapian__Stem);
  }
  
  SWIG_contract_assert((lua_tonumber(L,5)>=0),"number must not be negative")
  arg5 = (unsigned int)lua_tonumber(L, 5);
  temp6.assign(lua_tostring(L,6),lua_rawlen(L,6)); arg6=&temp6;
  temp7.assign(lua_tostring(L,7),lua_rawlen(L,7)); arg7=&temp7;
  temp8.assign(lua_tostring(L,8),lua_rawlen(L,8)); arg8=&temp8;
  {
    try {
      result = ((Xapian::MSet const *)arg1)->snippet((std::string const &)*arg2,arg3,(Xapian::Stem const &)*arg4,arg5,(std::string const &)*arg6,(std::string const &)*arg7,(std::string const &)*arg8);
    } 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_snippet__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  std::string *arg2 = 0 ;
  size_t arg3 ;
  Xapian::Stem *arg4 = 0 ;
  unsigned int arg5 ;
  std::string *arg6 = 0 ;
  std::string *arg7 = 0 ;
  std::string temp2 ;
  std::string temp6 ;
  std::string temp7 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::MSet::snippet",7,7)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::snippet",1,"Xapian::MSet const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::MSet::snippet",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::MSet::snippet",3,"size_t");
  if(!lua_isuserdata(L,4)) SWIG_fail_arg("Xapian::MSet::snippet",4,"Xapian::Stem const &");
  if(!lua_isnumber(L,5)) SWIG_fail_arg("Xapian::MSet::snippet",5,"unsigned int");
  if(!lua_isstring(L,6)) SWIG_fail_arg("Xapian::MSet::snippet",6,"std::string const &");
  if(!lua_isstring(L,7)) SWIG_fail_arg("Xapian::MSet::snippet",7,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet_snippet",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  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_Xapian__Stem,0))){
    SWIG_fail_ptr("MSet_snippet",4,SWIGTYPE_p_Xapian__Stem);
  }
  
  SWIG_contract_assert((lua_tonumber(L,5)>=0),"number must not be negative")
  arg5 = (unsigned int)lua_tonumber(L, 5);
  temp6.assign(lua_tostring(L,6),lua_rawlen(L,6)); arg6=&temp6;
  temp7.assign(lua_tostring(L,7),lua_rawlen(L,7)); arg7=&temp7;
  {
    try {
      result = ((Xapian::MSet const *)arg1)->snippet((std::string const &)*arg2,arg3,(Xapian::Stem const &)*arg4,arg5,(std::string const &)*arg6,(std::string const &)*arg7);
    } 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_snippet__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  std::string *arg2 = 0 ;
  size_t arg3 ;
  Xapian::Stem *arg4 = 0 ;
  unsigned int arg5 ;
  std::string *arg6 = 0 ;
  std::string temp2 ;
  std::string temp6 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::MSet::snippet",6,6)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::snippet",1,"Xapian::MSet const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::MSet::snippet",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::MSet::snippet",3,"size_t");
  if(!lua_isuserdata(L,4)) SWIG_fail_arg("Xapian::MSet::snippet",4,"Xapian::Stem const &");
  if(!lua_isnumber(L,5)) SWIG_fail_arg("Xapian::MSet::snippet",5,"unsigned int");
  if(!lua_isstring(L,6)) SWIG_fail_arg("Xapian::MSet::snippet",6,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet_snippet",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  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_Xapian__Stem,0))){
    SWIG_fail_ptr("MSet_snippet",4,SWIGTYPE_p_Xapian__Stem);
  }
  
  SWIG_contract_assert((lua_tonumber(L,5)>=0),"number must not be negative")
  arg5 = (unsigned int)lua_tonumber(L, 5);
  temp6.assign(lua_tostring(L,6),lua_rawlen(L,6)); arg6=&temp6;
  {
    try {
      result = ((Xapian::MSet const *)arg1)->snippet((std::string const &)*arg2,arg3,(Xapian::Stem const &)*arg4,arg5,(std::string const &)*arg6);
    } 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_snippet__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  std::string *arg2 = 0 ;
  size_t arg3 ;
  Xapian::Stem *arg4 = 0 ;
  unsigned int arg5 ;
  std::string temp2 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::MSet::snippet",5,5)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::snippet",1,"Xapian::MSet const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::MSet::snippet",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::MSet::snippet",3,"size_t");
  if(!lua_isuserdata(L,4)) SWIG_fail_arg("Xapian::MSet::snippet",4,"Xapian::Stem const &");
  if(!lua_isnumber(L,5)) SWIG_fail_arg("Xapian::MSet::snippet",5,"unsigned int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet_snippet",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  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_Xapian__Stem,0))){
    SWIG_fail_ptr("MSet_snippet",4,SWIGTYPE_p_Xapian__Stem);
  }
  
  SWIG_contract_assert((lua_tonumber(L,5)>=0),"number must not be negative")
  arg5 = (unsigned int)lua_tonumber(L, 5);
  {
    try {
      result = ((Xapian::MSet const *)arg1)->snippet((std::string const &)*arg2,arg3,(Xapian::Stem const &)*arg4,arg5);
    } 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_snippet__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  std::string *arg2 = 0 ;
  size_t arg3 ;
  Xapian::Stem *arg4 = 0 ;
  std::string temp2 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::MSet::snippet",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::snippet",1,"Xapian::MSet const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::MSet::snippet",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::MSet::snippet",3,"size_t");
  if(!lua_isuserdata(L,4)) SWIG_fail_arg("Xapian::MSet::snippet",4,"Xapian::Stem const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet_snippet",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  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_Xapian__Stem,0))){
    SWIG_fail_ptr("MSet_snippet",4,SWIGTYPE_p_Xapian__Stem);
  }
  
  {
    try {
      result = ((Xapian::MSet const *)arg1)->snippet((std::string const &)*arg2,arg3,(Xapian::Stem 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 int _wrap_MSet_snippet__SWIG_5(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  std::string *arg2 = 0 ;
  size_t arg3 ;
  std::string temp2 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::MSet::snippet",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::snippet",1,"Xapian::MSet const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::MSet::snippet",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::MSet::snippet",3,"size_t");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet_snippet",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  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);
  {
    try {
      result = ((Xapian::MSet const *)arg1)->snippet((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_MSet_snippet__SWIG_6(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::MSet::snippet",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSet::snippet",1,"Xapian::MSet const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::MSet::snippet",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSet_snippet",1,SWIGTYPE_p_Xapian__MSet);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = ((Xapian::MSet const *)arg1)->snippet((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_MSet_snippet(lua_State* L) {
  int argc;
  int argv[9]={
    1,2,3,4,5,6,7,8,9
  };
  
  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) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_MSet_snippet__SWIG_6(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) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_MSet_snippet__SWIG_5(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__MSet, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          {
            void *ptr;
            if (lua_isuserdata(L,argv[3])==0 || SWIG_ConvertPtr(L,argv[3], (void **) &ptr, SWIGTYPE_p_Xapian__Stem, 0)) {
              _v = 0;
            } else {
              _v = 1;
            }
          }
          if (_v) {
            return _wrap_MSet_snippet__SWIG_4(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__MSet, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          {
            void *ptr;
            if (lua_isuserdata(L,argv[3])==0 || SWIG_ConvertPtr(L,argv[3], (void **) &ptr, SWIGTYPE_p_Xapian__Stem, 0)) {
              _v = 0;
            } else {
              _v = 1;
            }
          }
          if (_v) {
            {
              _v = lua_isnumber(L,argv[4]);
            }
            if (_v) {
              return _wrap_MSet_snippet__SWIG_3(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__MSet, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          {
            void *ptr;
            if (lua_isuserdata(L,argv[3])==0 || SWIG_ConvertPtr(L,argv[3], (void **) &ptr, SWIGTYPE_p_Xapian__Stem, 0)) {
              _v = 0;
            } else {
              _v = 1;
            }
          }
          if (_v) {
            {
              _v = lua_isnumber(L,argv[4]);
            }
            if (_v) {
              {
                _v = lua_isstring(L,argv[5]);
              }
              if (_v) {
                return _wrap_MSet_snippet__SWIG_2(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__MSet, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          {
            void *ptr;
            if (lua_isuserdata(L,argv[3])==0 || SWIG_ConvertPtr(L,argv[3], (void **) &ptr, SWIGTYPE_p_Xapian__Stem, 0)) {
              _v = 0;
            } else {
              _v = 1;
            }
          }
          if (_v) {
            {
              _v = lua_isnumber(L,argv[4]);
            }
            if (_v) {
              {
                _v = lua_isstring(L,argv[5]);
              }
              if (_v) {
                {
                  _v = lua_isstring(L,argv[6]);
                }
                if (_v) {
                  return _wrap_MSet_snippet__SWIG_1(L);
                }
              }
            }
          }
        }
      }
    }
  }
  if (argc == 8) {
    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_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          {
            void *ptr;
            if (lua_isuserdata(L,argv[3])==0 || SWIG_ConvertPtr(L,argv[3], (void **) &ptr, SWIGTYPE_p_Xapian__Stem, 0)) {
              _v = 0;
            } else {
              _v = 1;
            }
          }
          if (_v) {
            {
              _v = lua_isnumber(L,argv[4]);
            }
            if (_v) {
              {
                _v = lua_isstring(L,argv[5]);
              }
              if (_v) {
                {
                  _v = lua_isstring(L,argv[6]);
                }
                if (_v) {
                  {
                    _v = lua_isstring(L,argv[7]);
                  }
                  if (_v) {
                    return _wrap_MSet_snippet__SWIG_0(L);
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'MSet_snippet'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::MSet::snippet(std::string const &,size_t,Xapian::Stem const &,unsigned int,std::string const &,std::string const &,std::string const &) const\n"
    "    Xapian::MSet::snippet(std::string const &,size_t,Xapian::Stem const &,unsigned int,std::string const &,std::string const &) const\n"
    "    Xapian::MSet::snippet(std::string const &,size_t,Xapian::Stem const &,unsigned int,std::string const &) const\n"
    "    Xapian::MSet::snippet(std::string const &,size_t,Xapian::Stem const &,unsigned int) const\n"
    "    Xapian::MSet::snippet(std::string const &,size_t,Xapian::Stem const &) const\n"
    "    Xapian::MSet::snippet(std::string const &,size_t) const\n"
    "    Xapian::MSet::snippet(std::string const &) 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 const &");
  if(!lua_isuserdata(L,3)) SWIG_fail_arg("Xapian::MSet::fetch",3,"Xapian::MSetIterator 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);
  }
  
  
  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((Xapian::MSetIterator const &)*arg2,(Xapian::MSetIterator 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_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 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);
  }
  
  
  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((Xapian::MSetIterator 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_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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'MSet_fetch'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::MSet::fetch(Xapian::MSetIterator const &,Xapian::MSetIterator const &) const\n"
    "    Xapian::MSet::fetch(Xapian::MSetIterator const &) const\n"
    "    Xapian::MSet::fetch() const\n");
  lua_error(L);return 0;
}


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___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 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_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_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 void swig_delete_MSet(void *obj) {
Xapian::MSet *arg1 = (Xapian::MSet *) obj;
delete arg1;
}
static int _proxy__wrap_new_MSet(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_MSet);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_MSet_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_MSet_methods[]= {
    { "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_attained", _wrap_MSet_get_max_attained},
    { "get_max_possible", _wrap_MSet_get_max_possible},
    { "snippet", _wrap_MSet_snippet},
    { "fetch", _wrap_MSet_fetch},
    { "size", _wrap_MSet_size},
    { "empty", _wrap_MSet_empty},
    { "begin", _wrap_MSet_begin},
    { "_end", _wrap_MSet__end},
    { "back", _wrap_MSet_back},
    { "__tostring", _wrap_MSet___tostring},
    { "items", _wrap_MSet_items},
    { "get_docid", _wrap_MSet_get_docid},
    { "get_document", _wrap_MSet_get_document},
    { "get_hit", _wrap_MSet_get_hit},
    { "get_document_percentage", _wrap_MSet_get_document_percentage},
    {0,0}
};
static swig_lua_method swig_MSet_meta[] = {
    { "__tostring", _wrap_MSet___tostring},
    {0,0}
};

static swig_lua_attribute swig_MSet_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_MSet_Sf_SwigStatic_constants[]= {
    {SWIG_LUA_CONSTTAB_INT("SNIPPET_BACKGROUND_MODEL", Xapian::MSet::SNIPPET_BACKGROUND_MODEL)},
    {SWIG_LUA_CONSTTAB_INT("SNIPPET_EXHAUSTIVE", Xapian::MSet::SNIPPET_EXHAUSTIVE)},
    {SWIG_LUA_CONSTTAB_INT("SNIPPET_EMPTY_WITHOUT_MATCH", Xapian::MSet::SNIPPET_EMPTY_WITHOUT_MATCH)},
    {SWIG_LUA_CONSTTAB_INT("SNIPPET_CJK_NGRAM", Xapian::MSet::SNIPPET_CJK_NGRAM)},
    {0,0,0,0,0,0}
};
static swig_lua_method swig_MSet_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_MSet_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_MSet_Sf_SwigStatic = {
    "MSet",
    swig_MSet_Sf_SwigStatic_methods,
    swig_MSet_Sf_SwigStatic_attributes,
    swig_MSet_Sf_SwigStatic_constants,
    swig_MSet_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_MSet_bases[] = {0};
static const char *swig_MSet_base_names[] = {0};
static swig_lua_class _wrap_class_MSet = { "MSet", "MSet", &SWIGTYPE_p_Xapian__MSet,_proxy__wrap_new_MSet, swig_delete_MSet, swig_MSet_methods, swig_MSet_attributes, &swig_MSet_Sf_SwigStatic, swig_MSet_meta, swig_MSet_bases, swig_MSet_base_names };

static int _wrap_MSetIterator_mset_set(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::MSet *arg2 = (Xapian::MSet *) 0 ;
  
  SWIG_check_num_args("Xapian::MSetIterator::mset",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSetIterator::mset",1,"Xapian::MSetIterator *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Xapian::MSetIterator::mset",2,"Xapian::MSet *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("MSetIterator_mset_set",1,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__MSet,0))){
    SWIG_fail_ptr("MSetIterator_mset_set",2,SWIGTYPE_p_Xapian__MSet);
  }
  
  if (arg1) (arg1)->mset = *arg2;
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSetIterator_mset_get(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::MSet *result = 0 ;
  
  SWIG_check_num_args("Xapian::MSetIterator::mset",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSetIterator::mset",1,"Xapian::MSetIterator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("MSetIterator_mset_get",1,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  result = (Xapian::MSet *)& ((arg1)->mset);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__MSet,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSetIterator_off_from_end_set(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::MSet::size_type arg2 ;
  
  SWIG_check_num_args("Xapian::MSetIterator::off_from_end",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSetIterator::off_from_end",1,"Xapian::MSetIterator *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::MSetIterator::off_from_end",2,"Xapian::MSet::size_type");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("MSetIterator_off_from_end_set",1,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::MSet::size_type)lua_tonumber(L, 2);
  if (arg1) (arg1)->off_from_end = arg2;
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_MSetIterator_off_from_end_get(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::MSet::size_type result;
  
  SWIG_check_num_args("Xapian::MSetIterator::off_from_end",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSetIterator::off_from_end",1,"Xapian::MSetIterator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("MSetIterator_off_from_end_get",1,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  result = (Xapian::MSet::size_type) ((arg1)->off_from_end);
  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_MSetIterator(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_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_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_weight(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  double 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 = (double)((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_sort_key(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::MSetIterator::get_sort_key",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MSetIterator::get_sort_key",1,"Xapian::MSetIterator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("MSetIterator_get_sort_key",1,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  {
    try {
      result = ((Xapian::MSetIterator const *)arg1)->get_sort_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_percent(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  int 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 = (int)((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 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_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 void swig_delete_MSetIterator(void *obj) {
Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) obj;
delete arg1;
}
static int _proxy__wrap_new_MSetIterator(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_MSetIterator);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_MSetIterator_attributes[] = {
    { "mset", _wrap_MSetIterator_mset_get, _wrap_MSetIterator_mset_set },
    { "off_from_end", _wrap_MSetIterator_off_from_end_get, _wrap_MSetIterator_off_from_end_set },
    {0,0,0}
};
static swig_lua_method swig_MSetIterator_methods[]= {
    { "get_rank", _wrap_MSetIterator_get_rank},
    { "get_document", _wrap_MSetIterator_get_document},
    { "get_weight", _wrap_MSetIterator_get_weight},
    { "get_collapse_key", _wrap_MSetIterator_get_collapse_key},
    { "get_collapse_count", _wrap_MSetIterator_get_collapse_count},
    { "get_sort_key", _wrap_MSetIterator_get_sort_key},
    { "get_percent", _wrap_MSetIterator_get_percent},
    { "__tostring", _wrap_MSetIterator___tostring},
    { "equals", _wrap_MSetIterator_equals},
    { "get_docid", _wrap_MSetIterator_get_docid},
    { "next", _wrap_MSetIterator_next},
    { "prev", _wrap_MSetIterator_prev},
    {0,0}
};
static swig_lua_method swig_MSetIterator_meta[] = {
    { "__tostring", _wrap_MSetIterator___tostring},
    {0,0}
};

static swig_lua_attribute swig_MSetIterator_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_MSetIterator_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_MSetIterator_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_MSetIterator_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_MSetIterator_Sf_SwigStatic = {
    "MSetIterator",
    swig_MSetIterator_Sf_SwigStatic_methods,
    swig_MSetIterator_Sf_SwigStatic_attributes,
    swig_MSetIterator_Sf_SwigStatic_constants,
    swig_MSetIterator_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_MSetIterator_bases[] = {0};
static const char *swig_MSetIterator_base_names[] = {0};
static swig_lua_class _wrap_class_MSetIterator = { "MSetIterator", "MSetIterator", &SWIGTYPE_p_Xapian__MSetIterator,_proxy__wrap_new_MSetIterator, swig_delete_MSetIterator, swig_MSetIterator_methods, swig_MSetIterator_attributes, &swig_MSetIterator_Sf_SwigStatic, swig_MSetIterator_meta, swig_MSetIterator_bases, swig_MSetIterator_base_names };

static int _wrap___eq__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSetIterator *arg1 = 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("Xapian::operator ==",2,2)
  if(!lua_isuserdata(L,1)) SWIG_fail_arg("Xapian::operator ==",1,"Xapian::MSetIterator const &");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::operator ==",2,"Xapian::MSetIterator const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("__eq",1,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("__eq",2,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  {
    try {
      result = (bool)Xapian::operator ==((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___lt__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSetIterator *arg1 = 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("Xapian::operator <",2,2)
  if(!lua_isuserdata(L,1)) SWIG_fail_arg("Xapian::operator <",1,"Xapian::MSetIterator const &");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::operator <",2,"Xapian::MSetIterator const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("__lt",1,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("__lt",2,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  {
    try {
      result = (bool)Xapian::operator <((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___le__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSetIterator *arg1 = 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("Xapian::operator <=",2,2)
  if(!lua_isuserdata(L,1)) SWIG_fail_arg("Xapian::operator <=",1,"Xapian::MSetIterator const &");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::operator <=",2,"Xapian::MSetIterator const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("__le",1,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("__le",2,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  {
    try {
      result = (bool)Xapian::operator <=((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___add__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MSetIterator::difference_type arg1 ;
  Xapian::MSetIterator *arg2 = 0 ;
  Xapian::MSetIterator result;
  
  SWIG_check_num_args("Xapian::operator +",2,2)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::operator +",1,"Xapian::MSetIterator::difference_type");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::operator +",2,"Xapian::MSetIterator const &");
  arg1 = (Xapian::MSetIterator::difference_type)lua_tonumber(L, 1);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__MSetIterator,0))){
    SWIG_fail_ptr("__add",2,SWIGTYPE_p_Xapian__MSetIterator);
  }
  
  {
    try {
      result = Xapian::operator +(arg1,(Xapian::MSetIterator const &)*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_new_ESet(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_ESet_size(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  Xapian::doccount 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::doccount)((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_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_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 int _proxy__wrap_new_ESet(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_ESet);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_ESet_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_ESet_methods[]= {
    { "size", _wrap_ESet_size},
    { "empty", _wrap_ESet_empty},
    { "get_ebound", _wrap_ESet_get_ebound},
    { "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_method swig_ESet_meta[] = {
    { "__tostring", _wrap_ESet___tostring},
    {0,0}
};

static swig_lua_attribute swig_ESet_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_ESet_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_ESet_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_ESet_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_ESet_Sf_SwigStatic = {
    "ESet",
    swig_ESet_Sf_SwigStatic_methods,
    swig_ESet_Sf_SwigStatic_attributes,
    swig_ESet_Sf_SwigStatic_constants,
    swig_ESet_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_ESet_bases[] = {0};
static const char *swig_ESet_base_names[] = {0};
static swig_lua_class _wrap_class_ESet = { "ESet", "ESet", &SWIGTYPE_p_Xapian__ESet,_proxy__wrap_new_ESet, swig_delete_ESet, swig_ESet_methods, swig_ESet_attributes, &swig_ESet_Sf_SwigStatic, swig_ESet_meta, swig_ESet_bases, swig_ESet_base_names };

static int _wrap_ESetIterator_eset_set(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  Xapian::ESet *arg2 = (Xapian::ESet *) 0 ;
  
  SWIG_check_num_args("Xapian::ESetIterator::eset",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ESetIterator::eset",1,"Xapian::ESetIterator *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Xapian::ESetIterator::eset",2,"Xapian::ESet *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ESetIterator,0))){
    SWIG_fail_ptr("ESetIterator_eset_set",1,SWIGTYPE_p_Xapian__ESetIterator);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__ESet,0))){
    SWIG_fail_ptr("ESetIterator_eset_set",2,SWIGTYPE_p_Xapian__ESet);
  }
  
  if (arg1) (arg1)->eset = *arg2;
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ESetIterator_eset_get(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  Xapian::ESet *result = 0 ;
  
  SWIG_check_num_args("Xapian::ESetIterator::eset",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ESetIterator::eset",1,"Xapian::ESetIterator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ESetIterator,0))){
    SWIG_fail_ptr("ESetIterator_eset_get",1,SWIGTYPE_p_Xapian__ESetIterator);
  }
  
  result = (Xapian::ESet *)& ((arg1)->eset);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__ESet,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ESetIterator_off_from_end_set(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  Xapian::ESet::size_type arg2 ;
  
  SWIG_check_num_args("Xapian::ESetIterator::off_from_end",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ESetIterator::off_from_end",1,"Xapian::ESetIterator *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::ESetIterator::off_from_end",2,"Xapian::ESet::size_type");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ESetIterator,0))){
    SWIG_fail_ptr("ESetIterator_off_from_end_set",1,SWIGTYPE_p_Xapian__ESetIterator);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::ESet::size_type)lua_tonumber(L, 2);
  if (arg1) (arg1)->off_from_end = arg2;
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ESetIterator_off_from_end_get(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  Xapian::ESet::size_type result;
  
  SWIG_check_num_args("Xapian::ESetIterator::off_from_end",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ESetIterator::off_from_end",1,"Xapian::ESetIterator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ESetIterator,0))){
    SWIG_fail_ptr("ESetIterator_off_from_end_get",1,SWIGTYPE_p_Xapian__ESetIterator);
  }
  
  result = (Xapian::ESet::size_type) ((arg1)->off_from_end);
  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_ESetIterator(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_ESetIterator_get_weight(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  double 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 = (double)((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 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_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 void swig_delete_ESetIterator(void *obj) {
Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) obj;
delete arg1;
}
static int _proxy__wrap_new_ESetIterator(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_ESetIterator);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_ESetIterator_attributes[] = {
    { "eset", _wrap_ESetIterator_eset_get, _wrap_ESetIterator_eset_set },
    { "off_from_end", _wrap_ESetIterator_off_from_end_get, _wrap_ESetIterator_off_from_end_set },
    {0,0,0}
};
static swig_lua_method swig_ESetIterator_methods[]= {
    { "get_weight", _wrap_ESetIterator_get_weight},
    { "__tostring", _wrap_ESetIterator___tostring},
    { "equals", _wrap_ESetIterator_equals},
    { "get_term", _wrap_ESetIterator_get_term},
    { "next", _wrap_ESetIterator_next},
    { "prev", _wrap_ESetIterator_prev},
    {0,0}
};
static swig_lua_method swig_ESetIterator_meta[] = {
    { "__tostring", _wrap_ESetIterator___tostring},
    {0,0}
};

static swig_lua_attribute swig_ESetIterator_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_ESetIterator_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_ESetIterator_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_ESetIterator_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_ESetIterator_Sf_SwigStatic = {
    "ESetIterator",
    swig_ESetIterator_Sf_SwigStatic_methods,
    swig_ESetIterator_Sf_SwigStatic_attributes,
    swig_ESetIterator_Sf_SwigStatic_constants,
    swig_ESetIterator_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_ESetIterator_bases[] = {0};
static const char *swig_ESetIterator_base_names[] = {0};
static swig_lua_class _wrap_class_ESetIterator = { "ESetIterator", "ESetIterator", &SWIGTYPE_p_Xapian__ESetIterator,_proxy__wrap_new_ESetIterator, swig_delete_ESetIterator, swig_ESetIterator_methods, swig_ESetIterator_attributes, &swig_ESetIterator_Sf_SwigStatic, swig_ESetIterator_meta, swig_ESetIterator_bases, swig_ESetIterator_base_names };

static int _wrap___eq__SWIG_5(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ESetIterator *arg1 = 0 ;
  Xapian::ESetIterator *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("Xapian::operator ==",2,2)
  if(!lua_isuserdata(L,1)) SWIG_fail_arg("Xapian::operator ==",1,"Xapian::ESetIterator const &");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::operator ==",2,"Xapian::ESetIterator const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ESetIterator,0))){
    SWIG_fail_ptr("__eq",1,SWIGTYPE_p_Xapian__ESetIterator);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__ESetIterator,0))){
    SWIG_fail_ptr("__eq",2,SWIGTYPE_p_Xapian__ESetIterator);
  }
  
  {
    try {
      result = (bool)Xapian::operator ==((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___eq(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    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) {
      {
        void *ptr;
        if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_Xapian__PositionIterator, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        return _wrap___eq__SWIG_0(L);
      }
    }
  }
  if (argc == 2) {
    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) {
      {
        void *ptr;
        if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_Xapian__PostingIterator, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        return _wrap___eq__SWIG_1(L);
      }
    }
  }
  if (argc == 2) {
    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) {
      {
        void *ptr;
        if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_Xapian__TermIterator, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        return _wrap___eq__SWIG_2(L);
      }
    }
  }
  if (argc == 2) {
    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) {
      {
        void *ptr;
        if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_Xapian__ValueIterator, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        return _wrap___eq__SWIG_3(L);
      }
    }
  }
  if (argc == 2) {
    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) {
      {
        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___eq__SWIG_4(L);
      }
    }
  }
  if (argc == 2) {
    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) {
      {
        void *ptr;
        if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_Xapian__ESetIterator, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        return _wrap___eq__SWIG_5(L);
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function '__eq'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::operator ==(Xapian::PositionIterator const &,Xapian::PositionIterator const &)\n"
    "    Xapian::operator ==(Xapian::PostingIterator const &,Xapian::PostingIterator const &)\n"
    "    Xapian::operator ==(Xapian::TermIterator const &,Xapian::TermIterator const &)\n"
    "    Xapian::operator ==(Xapian::ValueIterator const &,Xapian::ValueIterator const &)\n"
    "    Xapian::operator ==(Xapian::MSetIterator const &,Xapian::MSetIterator const &)\n"
    "    Xapian::operator ==(Xapian::ESetIterator const &,Xapian::ESetIterator const &)\n");
  lua_error(L);return 0;
}


static int _wrap___lt__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ESetIterator *arg1 = 0 ;
  Xapian::ESetIterator *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("Xapian::operator <",2,2)
  if(!lua_isuserdata(L,1)) SWIG_fail_arg("Xapian::operator <",1,"Xapian::ESetIterator const &");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::operator <",2,"Xapian::ESetIterator const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ESetIterator,0))){
    SWIG_fail_ptr("__lt",1,SWIGTYPE_p_Xapian__ESetIterator);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__ESetIterator,0))){
    SWIG_fail_ptr("__lt",2,SWIGTYPE_p_Xapian__ESetIterator);
  }
  
  {
    try {
      result = (bool)Xapian::operator <((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___lt(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    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) {
      {
        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___lt__SWIG_0(L);
      }
    }
  }
  if (argc == 2) {
    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) {
      {
        void *ptr;
        if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_Xapian__ESetIterator, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        return _wrap___lt__SWIG_1(L);
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function '__lt'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::operator <(Xapian::MSetIterator const &,Xapian::MSetIterator const &)\n"
    "    Xapian::operator <(Xapian::ESetIterator const &,Xapian::ESetIterator const &)\n");
  lua_error(L);return 0;
}


static int _wrap___le__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ESetIterator *arg1 = 0 ;
  Xapian::ESetIterator *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("Xapian::operator <=",2,2)
  if(!lua_isuserdata(L,1)) SWIG_fail_arg("Xapian::operator <=",1,"Xapian::ESetIterator const &");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::operator <=",2,"Xapian::ESetIterator const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ESetIterator,0))){
    SWIG_fail_ptr("__le",1,SWIGTYPE_p_Xapian__ESetIterator);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__ESetIterator,0))){
    SWIG_fail_ptr("__le",2,SWIGTYPE_p_Xapian__ESetIterator);
  }
  
  {
    try {
      result = (bool)Xapian::operator <=((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___le(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    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) {
      {
        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___le__SWIG_0(L);
      }
    }
  }
  if (argc == 2) {
    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) {
      {
        void *ptr;
        if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_Xapian__ESetIterator, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        return _wrap___le__SWIG_1(L);
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function '__le'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::operator <=(Xapian::MSetIterator const &,Xapian::MSetIterator const &)\n"
    "    Xapian::operator <=(Xapian::ESetIterator const &,Xapian::ESetIterator const &)\n");
  lua_error(L);return 0;
}


static int _wrap___add__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ESetIterator::difference_type arg1 ;
  Xapian::ESetIterator *arg2 = 0 ;
  Xapian::ESetIterator result;
  
  SWIG_check_num_args("Xapian::operator +",2,2)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::operator +",1,"Xapian::ESetIterator::difference_type");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::operator +",2,"Xapian::ESetIterator const &");
  arg1 = (Xapian::ESetIterator::difference_type)lua_tonumber(L, 1);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__ESetIterator,0))){
    SWIG_fail_ptr("__add",2,SWIGTYPE_p_Xapian__ESetIterator);
  }
  
  {
    try {
      result = Xapian::operator +(arg1,(Xapian::ESetIterator const &)*arg2);
    } 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___add(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    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__MSetIterator, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        return _wrap___add__SWIG_0(L);
      }
    }
  }
  if (argc == 2) {
    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__ESetIterator, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        return _wrap___add__SWIG_1(L);
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function '__add'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::operator +(Xapian::MSetIterator::difference_type,Xapian::MSetIterator const &)\n"
    "    Xapian::operator +(Xapian::ESetIterator::difference_type,Xapian::ESetIterator const &)\n");
  lua_error(L);return 0;
}


static int _wrap_new_RSet(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_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 const &");
  
  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((Xapian::MSetIterator 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_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);
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 const &)\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 const &");
  
  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((Xapian::MSetIterator 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_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);
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 const &)\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 const *");
  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)((Xapian::RSet const *)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 const *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::RSet::contains",2,"Xapian::MSetIterator const &");
  
  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)((Xapian::RSet const *)arg1)->contains((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_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);
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'RSet_contains'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::RSet::contains(Xapian::docid) const\n"
    "    Xapian::RSet::contains(Xapian::MSetIterator const &) const\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 int _proxy__wrap_new_RSet(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_RSet);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_RSet_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_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_method swig_RSet_meta[] = {
    { "__tostring", _wrap_RSet___tostring},
    {0,0}
};

static swig_lua_attribute swig_RSet_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_RSet_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_RSet_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_RSet_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_RSet_Sf_SwigStatic = {
    "RSet",
    swig_RSet_Sf_SwigStatic_methods,
    swig_RSet_Sf_SwigStatic_attributes,
    swig_RSet_Sf_SwigStatic_constants,
    swig_RSet_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_RSet_bases[] = {0};
static const char *swig_RSet_base_names[] = {0};
static swig_lua_class _wrap_class_RSet = { "RSet", "RSet", &SWIGTYPE_p_Xapian__RSet,_proxy__wrap_new_RSet, swig_delete_RSet, swig_RSet_methods, swig_RSet_attributes, &swig_RSet_Sf_SwigStatic, swig_RSet_meta, swig_RSet_bases, swig_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_attribute swig_MatchDecider_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_MatchDecider_methods[]= {
    { "__call", _wrap_MatchDecider___call},
    {0,0}
};
static swig_lua_method swig_MatchDecider_meta[] = {
    { "__call", _wrap_MatchDecider___call},
    {0,0}
};

static swig_lua_attribute swig_MatchDecider_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_MatchDecider_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_MatchDecider_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_MatchDecider_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_MatchDecider_Sf_SwigStatic = {
    "MatchDecider",
    swig_MatchDecider_Sf_SwigStatic_methods,
    swig_MatchDecider_Sf_SwigStatic_attributes,
    swig_MatchDecider_Sf_SwigStatic_constants,
    swig_MatchDecider_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_MatchDecider_bases[] = {0};
static const char *swig_MatchDecider_base_names[] = {0};
static swig_lua_class _wrap_class_MatchDecider = { "MatchDecider", "MatchDecider", &SWIGTYPE_p_Xapian__MatchDecider,0, swig_delete_MatchDecider, swig_MatchDecider_methods, swig_MatchDecider_attributes, &swig_MatchDecider_Sf_SwigStatic, swig_MatchDecider_meta, swig_MatchDecider_bases, swig_MatchDecider_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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 const *");
  
  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 *) &((Xapian::Enquire const *)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_expansion_scheme__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  std::string *arg2 = 0 ;
  double arg3 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::Enquire::set_expansion_scheme",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::set_expansion_scheme",1,"Xapian::Enquire const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Enquire::set_expansion_scheme",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Enquire::set_expansion_scheme",3,"double");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_set_expansion_scheme",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  arg3 = (double)lua_tonumber(L, 3);
  {
    try {
      ((Xapian::Enquire const *)arg1)->set_expansion_scheme((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_Enquire_set_expansion_scheme__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::Enquire::set_expansion_scheme",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::set_expansion_scheme",1,"Xapian::Enquire const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Enquire::set_expansion_scheme",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_set_expansion_scheme",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      ((Xapian::Enquire const *)arg1)->set_expansion_scheme((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_Enquire_set_expansion_scheme(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_isstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_Enquire_set_expansion_scheme__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_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_Enquire_set_expansion_scheme__SWIG_0(L);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Enquire_set_expansion_scheme'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Enquire::set_expansion_scheme(std::string const &,double) const\n"
    "    Xapian::Enquire::set_expansion_scheme(std::string const &) const\n");
  lua_error(L);return 0;
}


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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 ;
  double 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,"double");
  
  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 = (double)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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Enquire_set_cutoff'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Enquire::set_cutoff(int,double)\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(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_key(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_value_then_relevance(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_key_then_relevance(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_relevance_then_value(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_key(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_time_limit(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  double arg2 ;
  
  SWIG_check_num_args("Xapian::Enquire::set_time_limit",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Enquire::set_time_limit",1,"Xapian::Enquire *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Enquire::set_time_limit",2,"double");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Enquire,0))){
    SWIG_fail_ptr("Enquire_set_time_limit",1,SWIGTYPE_p_Xapian__Enquire);
  }
  
  arg2 = (double)lua_tonumber(L, 2);
  {
    try {
      (arg1)->set_time_limit(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_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::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_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::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_2(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_3(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_4(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_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::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[7]={
    1,2,3,4,5,6,7
  };
  
  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_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) {
        {
          _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_5(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_2(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_4(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_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) {
        {
          _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_0(L);
              }
            }
          }
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 *) 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 ;
  Xapian::ExpandDecider *arg5 = (Xapian::ExpandDecider *) 0 ;
  double arg6 ;
  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,6)) SWIG_fail_arg("Xapian::Enquire::get_eset",6,"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);
  {
    if (lua_isfunction(L, 5)) {
      arg5 = new luaExpandDecider(L);
    } else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 5, (void**)&arg5, SWIGTYPE_p_Xapian__ExpandDecider, 0))) {
        SWIG_fail;
      }
    }
  }
  arg6 = (double)lua_tonumber(L, 6);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_eset(arg2,(Xapian::RSet const &)*arg3,arg4,(Xapian::ExpandDecider const *)arg5,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 ;
  Xapian::ExpandDecider *arg5 = (Xapian::ExpandDecider *) 0 ;
  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 (!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);
  {
    if (lua_isfunction(L, 5)) {
      arg5 = new luaExpandDecider(L);
    } else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 5, (void**)&arg5, SWIGTYPE_p_Xapian__ExpandDecider, 0))) {
        SWIG_fail;
      }
    }
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_eset(arg2,(Xapian::RSet const &)*arg3,arg4,(Xapian::ExpandDecider const *)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 ;
  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__SWIG_5(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 ;
  double 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,"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;
      }
    }
  }
  arg7 = (double)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_6(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_7(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(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_4(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_7(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) {
            {
              void *ptr;
              if (lua_isfunction(L, argv[4]) || (SWIG_isptrtype(L, argv[4]) && !SWIG_ConvertPtr(L, argv[4], (void **) &ptr, SWIGTYPE_p_Xapian__ExpandDecider, 0))) {
                _v = 1;
              } else {
                _v = 0;
              }
            }
            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_6(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) {
            {
              void *ptr;
              if (lua_isfunction(L, argv[4]) || (SWIG_isptrtype(L, argv[4]) && !SWIG_ConvertPtr(L, argv[4], (void **) &ptr, SWIGTYPE_p_Xapian__ExpandDecider, 0))) {
                _v = 1;
              } else {
                _v = 0;
              }
            }
            if (_v) {
              {
                _v = lua_isnumber(L,argv[5]);
              }
              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_5(L);
                }
              }
            }
          }
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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,Xapian::ExpandDecider const *,double) const\n"
    "    Xapian::Enquire::get_eset(Xapian::termcount,Xapian::RSet const &,int,Xapian::ExpandDecider const *) 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 &,Xapian::ExpandDecider const *) const\n"
    "    Xapian::Enquire::get_eset(Xapian::termcount,Xapian::RSet const &,int,double,Xapian::ExpandDecider const *,double) const\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");
  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);
  result = ((Xapian::Enquire const *)arg1)->get_matching_terms_end(arg2);
  {
    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);
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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);
  }
  
  result = ((Xapian::Enquire const *)arg1)->get_matching_terms_end((Xapian::MSetIterator const &)*arg2);
  {
    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);
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 ;
  SwigValueWrapper< 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 ;
  SwigValueWrapper< 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);
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 int _proxy__wrap_new_Enquire(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_Enquire);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_Enquire_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_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_expansion_scheme", _wrap_Enquire_set_expansion_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_key", _wrap_Enquire_set_sort_by_key},
    { "set_sort_by_value_then_relevance", _wrap_Enquire_set_sort_by_value_then_relevance},
    { "set_sort_by_key_then_relevance", _wrap_Enquire_set_sort_by_key_then_relevance},
    { "set_sort_by_relevance_then_value", _wrap_Enquire_set_sort_by_relevance_then_value},
    { "set_sort_by_relevance_then_key", _wrap_Enquire_set_sort_by_relevance_then_key},
    { "set_time_limit", _wrap_Enquire_set_time_limit},
    { "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_method swig_Enquire_meta[] = {
    { "__tostring", _wrap_Enquire___tostring},
    {0,0}
};

static swig_lua_attribute swig_Enquire_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_Enquire_Sf_SwigStatic_constants[]= {
    {SWIG_LUA_CONSTTAB_INT("ASCENDING", Xapian::Enquire::ASCENDING)},
    {SWIG_LUA_CONSTTAB_INT("DESCENDING", Xapian::Enquire::DESCENDING)},
    {SWIG_LUA_CONSTTAB_INT("DONT_CARE", Xapian::Enquire::DONT_CARE)},
    {SWIG_LUA_CONSTTAB_INT("INCLUDE_QUERY_TERMS", Xapian::Enquire::INCLUDE_QUERY_TERMS)},
    {SWIG_LUA_CONSTTAB_INT("USE_EXACT_TERMFREQ", Xapian::Enquire::USE_EXACT_TERMFREQ)},
    {0,0,0,0,0,0}
};
static swig_lua_method swig_Enquire_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_Enquire_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_Enquire_Sf_SwigStatic = {
    "Enquire",
    swig_Enquire_Sf_SwigStatic_methods,
    swig_Enquire_Sf_SwigStatic_attributes,
    swig_Enquire_Sf_SwigStatic_constants,
    swig_Enquire_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_Enquire_bases[] = {0};
static const char *swig_Enquire_base_names[] = {0};
static swig_lua_class _wrap_class_Enquire = { "Enquire", "Enquire", &SWIGTYPE_p_Xapian__Enquire,_proxy__wrap_new_Enquire, swig_delete_Enquire, swig_Enquire_methods, swig_Enquire_attributes, &swig_Enquire_Sf_SwigStatic, swig_Enquire_meta, swig_Enquire_bases, swig_Enquire_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 int _wrap_ExpandDecider_release(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ExpandDecider *arg1 = (Xapian::ExpandDecider *) 0 ;
  Xapian::ExpandDecider *result = 0 ;
  
  SWIG_check_num_args("Xapian::ExpandDecider::release",1,1)
  {
    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;
      }
    }
  }
  {
    try {
      result = (Xapian::ExpandDecider *)((Xapian::ExpandDecider const *)arg1)->release();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__ExpandDecider,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_attribute swig_ExpandDecider_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_ExpandDecider_methods[]= {
    { "__call", _wrap_ExpandDecider___call},
    { "release", _wrap_ExpandDecider_release},
    {0,0}
};
static swig_lua_method swig_ExpandDecider_meta[] = {
    { "__call", _wrap_ExpandDecider___call},
    {0,0}
};

static swig_lua_attribute swig_ExpandDecider_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_ExpandDecider_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_ExpandDecider_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_ExpandDecider_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_ExpandDecider_Sf_SwigStatic = {
    "ExpandDecider",
    swig_ExpandDecider_Sf_SwigStatic_methods,
    swig_ExpandDecider_Sf_SwigStatic_attributes,
    swig_ExpandDecider_Sf_SwigStatic_constants,
    swig_ExpandDecider_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_ExpandDecider_bases[] = {0};
static const char *swig_ExpandDecider_base_names[] = {0};
static swig_lua_class _wrap_class_ExpandDecider = { "ExpandDecider", "ExpandDecider", &SWIGTYPE_p_Xapian__ExpandDecider,0, swig_delete_ExpandDecider, swig_ExpandDecider_methods, swig_ExpandDecider_attributes, &swig_ExpandDecider_Sf_SwigStatic, swig_ExpandDecider_meta, swig_ExpandDecider_bases, swig_ExpandDecider_base_names };

static int _wrap_new_ExpandDeciderAnd(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ExpandDecider *arg1 = 0 ;
  Xapian::ExpandDecider *arg2 = 0 ;
  Xapian::ExpandDeciderAnd *result = 0 ;
  
  SWIG_check_num_args("Xapian::ExpandDeciderAnd::ExpandDeciderAnd",2,2)
  if(!lua_isuserdata(L,1)) SWIG_fail_arg("Xapian::ExpandDeciderAnd::ExpandDeciderAnd",1,"Xapian::ExpandDecider const &");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::ExpandDeciderAnd::ExpandDeciderAnd",2,"Xapian::ExpandDecider const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ExpandDecider,0))){
    SWIG_fail_ptr("new_ExpandDeciderAnd",1,SWIGTYPE_p_Xapian__ExpandDecider);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__ExpandDecider,0))){
    SWIG_fail_ptr("new_ExpandDeciderAnd",2,SWIGTYPE_p_Xapian__ExpandDecider);
  }
  
  {
    try {
      result = (Xapian::ExpandDeciderAnd *)new Xapian::ExpandDeciderAnd((Xapian::ExpandDecider const &)*arg1,(Xapian::ExpandDecider const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__ExpandDeciderAnd,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_ExpandDeciderAnd___call(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ExpandDeciderAnd *arg1 = (Xapian::ExpandDeciderAnd *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  bool result;
  
  SWIG_check_num_args("Xapian::ExpandDeciderAnd::operator ()",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ExpandDeciderAnd::operator ()",1,"Xapian::ExpandDeciderAnd const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::ExpandDeciderAnd::operator ()",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ExpandDeciderAnd,0))){
    SWIG_fail_ptr("ExpandDeciderAnd___call",1,SWIGTYPE_p_Xapian__ExpandDeciderAnd);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = (bool)((Xapian::ExpandDeciderAnd 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_ExpandDeciderAnd(void *obj) {
Xapian::ExpandDeciderAnd *arg1 = (Xapian::ExpandDeciderAnd *) obj;
delete arg1;
}
static int _proxy__wrap_new_ExpandDeciderAnd(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_ExpandDeciderAnd);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_ExpandDeciderAnd_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_ExpandDeciderAnd_methods[]= {
    { "__call", _wrap_ExpandDeciderAnd___call},
    {0,0}
};
static swig_lua_method swig_ExpandDeciderAnd_meta[] = {
    { "__call", _wrap_ExpandDeciderAnd___call},
    {0,0}
};

static swig_lua_attribute swig_ExpandDeciderAnd_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_ExpandDeciderAnd_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_ExpandDeciderAnd_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_ExpandDeciderAnd_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_ExpandDeciderAnd_Sf_SwigStatic = {
    "ExpandDeciderAnd",
    swig_ExpandDeciderAnd_Sf_SwigStatic_methods,
    swig_ExpandDeciderAnd_Sf_SwigStatic_attributes,
    swig_ExpandDeciderAnd_Sf_SwigStatic_constants,
    swig_ExpandDeciderAnd_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_ExpandDeciderAnd_bases[] = {0,0};
static const char *swig_ExpandDeciderAnd_base_names[] = {"Xapian::ExpandDecider *",0};
static swig_lua_class _wrap_class_ExpandDeciderAnd = { "ExpandDeciderAnd", "ExpandDeciderAnd", &SWIGTYPE_p_Xapian__ExpandDeciderAnd,_proxy__wrap_new_ExpandDeciderAnd, swig_delete_ExpandDeciderAnd, swig_ExpandDeciderAnd_methods, swig_ExpandDeciderAnd_attributes, &swig_ExpandDeciderAnd_Sf_SwigStatic, swig_ExpandDeciderAnd_meta, swig_ExpandDeciderAnd_bases, swig_ExpandDeciderAnd_base_names };

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


static int _wrap_ExpandDeciderFilterPrefix___call(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ExpandDeciderFilterPrefix *arg1 = (Xapian::ExpandDeciderFilterPrefix *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  bool result;
  
  SWIG_check_num_args("Xapian::ExpandDeciderFilterPrefix::operator ()",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::ExpandDeciderFilterPrefix::operator ()",1,"Xapian::ExpandDeciderFilterPrefix const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::ExpandDeciderFilterPrefix::operator ()",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__ExpandDeciderFilterPrefix,0))){
    SWIG_fail_ptr("ExpandDeciderFilterPrefix___call",1,SWIGTYPE_p_Xapian__ExpandDeciderFilterPrefix);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = (bool)((Xapian::ExpandDeciderFilterPrefix 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_ExpandDeciderFilterPrefix(void *obj) {
Xapian::ExpandDeciderFilterPrefix *arg1 = (Xapian::ExpandDeciderFilterPrefix *) obj;
delete arg1;
}
static int _proxy__wrap_new_ExpandDeciderFilterPrefix(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_ExpandDeciderFilterPrefix);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_ExpandDeciderFilterPrefix_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_ExpandDeciderFilterPrefix_methods[]= {
    { "__call", _wrap_ExpandDeciderFilterPrefix___call},
    {0,0}
};
static swig_lua_method swig_ExpandDeciderFilterPrefix_meta[] = {
    { "__call", _wrap_ExpandDeciderFilterPrefix___call},
    {0,0}
};

static swig_lua_attribute swig_ExpandDeciderFilterPrefix_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_ExpandDeciderFilterPrefix_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_ExpandDeciderFilterPrefix_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_ExpandDeciderFilterPrefix_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_ExpandDeciderFilterPrefix_Sf_SwigStatic = {
    "ExpandDeciderFilterPrefix",
    swig_ExpandDeciderFilterPrefix_Sf_SwigStatic_methods,
    swig_ExpandDeciderFilterPrefix_Sf_SwigStatic_attributes,
    swig_ExpandDeciderFilterPrefix_Sf_SwigStatic_constants,
    swig_ExpandDeciderFilterPrefix_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_ExpandDeciderFilterPrefix_bases[] = {0,0};
static const char *swig_ExpandDeciderFilterPrefix_base_names[] = {"Xapian::ExpandDecider *",0};
static swig_lua_class _wrap_class_ExpandDeciderFilterPrefix = { "ExpandDeciderFilterPrefix", "ExpandDeciderFilterPrefix", &SWIGTYPE_p_Xapian__ExpandDeciderFilterPrefix,_proxy__wrap_new_ExpandDeciderFilterPrefix, swig_delete_ExpandDeciderFilterPrefix, swig_ExpandDeciderFilterPrefix_methods, swig_ExpandDeciderFilterPrefix_attributes, &swig_ExpandDeciderFilterPrefix_Sf_SwigStatic, swig_ExpandDeciderFilterPrefix_meta, swig_ExpandDeciderFilterPrefix_bases, swig_ExpandDeciderFilterPrefix_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 int _wrap_KeyMaker_release(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::KeyMaker *arg1 = (Xapian::KeyMaker *) 0 ;
  Xapian::KeyMaker *result = 0 ;
  
  SWIG_check_num_args("Xapian::KeyMaker::release",1,1)
  {
    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;
      }
    }
  }
  {
    try {
      result = (Xapian::KeyMaker *)((Xapian::KeyMaker const *)arg1)->release();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__KeyMaker,0); 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_attribute swig_KeyMaker_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_KeyMaker_methods[]= {
    { "__call", _wrap_KeyMaker___call},
    { "release", _wrap_KeyMaker_release},
    {0,0}
};
static swig_lua_method swig_KeyMaker_meta[] = {
    { "__call", _wrap_KeyMaker___call},
    {0,0}
};

static swig_lua_attribute swig_KeyMaker_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_KeyMaker_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_KeyMaker_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_KeyMaker_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_KeyMaker_Sf_SwigStatic = {
    "KeyMaker",
    swig_KeyMaker_Sf_SwigStatic_methods,
    swig_KeyMaker_Sf_SwigStatic_attributes,
    swig_KeyMaker_Sf_SwigStatic_constants,
    swig_KeyMaker_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_KeyMaker_bases[] = {0};
static const char *swig_KeyMaker_base_names[] = {0};
static swig_lua_class _wrap_class_KeyMaker = { "KeyMaker", "KeyMaker", &SWIGTYPE_p_Xapian__KeyMaker,0, swig_delete_KeyMaker, swig_KeyMaker_methods, swig_KeyMaker_attributes, &swig_KeyMaker_Sf_SwigStatic, swig_KeyMaker_meta, swig_KeyMaker_bases, swig_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 ;
  std::string *arg4 = 0 ;
  std::string temp4 ;
  
  SWIG_check_num_args("Xapian::MultiValueKeyMaker::add_value",4,4)
  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(!lua_isstring(L,4)) SWIG_fail_arg("Xapian::MultiValueKeyMaker::add_value",4,"std::string const &");
  
  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);
  temp4.assign(lua_tostring(L,4),lua_rawlen(L,4)); arg4=&temp4;
  {
    try {
      (arg1)->add_value(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_MultiValueKeyMaker_add_value__SWIG_1(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_2(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[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__MultiValueKeyMaker, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_MultiValueKeyMaker_add_value__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__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_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__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) {
          {
            _v = lua_isstring(L,argv[3]);
          }
          if (_v) {
            return _wrap_MultiValueKeyMaker_add_value__SWIG_0(L);
          }
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'MultiValueKeyMaker_add_value'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::MultiValueKeyMaker::add_value(Xapian::valueno,bool,std::string const &)\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 int _proxy__wrap_new_MultiValueKeyMaker(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_MultiValueKeyMaker);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_MultiValueKeyMaker_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_MultiValueKeyMaker_methods[]= {
    { "__call", _wrap_MultiValueKeyMaker___call},
    { "add_value", _wrap_MultiValueKeyMaker_add_value},
    {0,0}
};
static swig_lua_method swig_MultiValueKeyMaker_meta[] = {
    { "__call", _wrap_MultiValueKeyMaker___call},
    {0,0}
};

static swig_lua_attribute swig_MultiValueKeyMaker_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_MultiValueKeyMaker_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_MultiValueKeyMaker_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_MultiValueKeyMaker_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_MultiValueKeyMaker_Sf_SwigStatic = {
    "MultiValueKeyMaker",
    swig_MultiValueKeyMaker_Sf_SwigStatic_methods,
    swig_MultiValueKeyMaker_Sf_SwigStatic_attributes,
    swig_MultiValueKeyMaker_Sf_SwigStatic_constants,
    swig_MultiValueKeyMaker_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_MultiValueKeyMaker_bases[] = {0,0};
static const char *swig_MultiValueKeyMaker_base_names[] = {"Xapian::KeyMaker *",0};
static swig_lua_class _wrap_class_MultiValueKeyMaker = { "MultiValueKeyMaker", "MultiValueKeyMaker", &SWIGTYPE_p_Xapian__MultiValueKeyMaker,_proxy__wrap_new_MultiValueKeyMaker, swig_delete_MultiValueKeyMaker, swig_MultiValueKeyMaker_methods, swig_MultiValueKeyMaker_attributes, &swig_MultiValueKeyMaker_Sf_SwigStatic, swig_MultiValueKeyMaker_meta, swig_MultiValueKeyMaker_bases, swig_MultiValueKeyMaker_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 int _wrap_Stopper_release(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Stopper *arg1 = (Xapian::Stopper *) 0 ;
  Xapian::Stopper *result = 0 ;
  
  SWIG_check_num_args("Xapian::Stopper::release",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 *)((Xapian::Stopper const *)arg1)->release();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__Stopper,0); 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_attribute swig_Stopper_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_Stopper_methods[]= {
    { "__call", _wrap_Stopper___call},
    { "__tostring", _wrap_Stopper___tostring},
    { "release", _wrap_Stopper_release},
    {0,0}
};
static swig_lua_method swig_Stopper_meta[] = {
    { "__call", _wrap_Stopper___call},
    { "__tostring", _wrap_Stopper___tostring},
    {0,0}
};

static swig_lua_attribute swig_Stopper_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_Stopper_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_Stopper_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_Stopper_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_Stopper_Sf_SwigStatic = {
    "Stopper",
    swig_Stopper_Sf_SwigStatic_methods,
    swig_Stopper_Sf_SwigStatic_attributes,
    swig_Stopper_Sf_SwigStatic_constants,
    swig_Stopper_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_Stopper_bases[] = {0};
static const char *swig_Stopper_base_names[] = {0};
static swig_lua_class _wrap_class_Stopper = { "Stopper", "Stopper", &SWIGTYPE_p_Xapian__Stopper,0, swig_delete_Stopper, swig_Stopper_methods, swig_Stopper_attributes, &swig_Stopper_Sf_SwigStatic, swig_Stopper_meta, swig_Stopper_bases, swig_Stopper_base_names };

static int _wrap_new_SimpleStopper__SWIG_0(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 int _wrap_new_SimpleStopper__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string temp1 ;
  Xapian::SimpleStopper *result = 0 ;
  
  SWIG_check_num_args("Xapian::SimpleStopper::SimpleStopper",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::SimpleStopper::SimpleStopper",1,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  {
    try {
      result = (Xapian::SimpleStopper *)new_Xapian_SimpleStopper__SWIG_2((std::string const &)*arg1);
    } 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_new_SimpleStopper(lua_State* L) {
  int argc;
  int argv[2]={
    1,2
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_SimpleStopper__SWIG_0(L);
  }
  if (argc == 1) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_SimpleStopper__SWIG_2(L);
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_SimpleStopper'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::SimpleStopper::SimpleStopper()\n"
    "    Xapian::SimpleStopper::SimpleStopper(std::string const &)\n");
  lua_error(L);return 0;
}


static void swig_delete_SimpleStopper(void *obj) {
Xapian::SimpleStopper *arg1 = (Xapian::SimpleStopper *) obj;
delete arg1;
}
static int _proxy__wrap_new_SimpleStopper(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_SimpleStopper);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_SimpleStopper_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_SimpleStopper_methods[]= {
    { "add", _wrap_SimpleStopper_add},
    { "__call", _wrap_SimpleStopper___call},
    { "__tostring", _wrap_SimpleStopper___tostring},
    {0,0}
};
static swig_lua_method swig_SimpleStopper_meta[] = {
    { "__call", _wrap_SimpleStopper___call},
    { "__tostring", _wrap_SimpleStopper___tostring},
    {0,0}
};

static swig_lua_attribute swig_SimpleStopper_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_SimpleStopper_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_SimpleStopper_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_SimpleStopper_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_SimpleStopper_Sf_SwigStatic = {
    "SimpleStopper",
    swig_SimpleStopper_Sf_SwigStatic_methods,
    swig_SimpleStopper_Sf_SwigStatic_attributes,
    swig_SimpleStopper_Sf_SwigStatic_constants,
    swig_SimpleStopper_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_SimpleStopper_bases[] = {0,0};
static const char *swig_SimpleStopper_base_names[] = {"Xapian::Stopper *",0};
static swig_lua_class _wrap_class_SimpleStopper = { "SimpleStopper", "SimpleStopper", &SWIGTYPE_p_Xapian__SimpleStopper,_proxy__wrap_new_SimpleStopper, swig_delete_SimpleStopper, swig_SimpleStopper_methods, swig_SimpleStopper_attributes, &swig_SimpleStopper_Sf_SwigStatic, swig_SimpleStopper_meta, swig_SimpleStopper_bases, swig_SimpleStopper_base_names };

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


static int _wrap_new_RangeProcessor__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  unsigned int arg3 ;
  std::string temp2 ;
  Xapian::RangeProcessor *result = 0 ;
  
  SWIG_check_num_args("Xapian::RangeProcessor::RangeProcessor",3,3)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::RangeProcessor::RangeProcessor",1,"Xapian::valueno");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::RangeProcessor::RangeProcessor",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::RangeProcessor::RangeProcessor",3,"unsigned 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;
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (unsigned int)lua_tonumber(L, 3);
  {
    try {
      result = (Xapian::RangeProcessor *)new Xapian::RangeProcessor(arg1,(std::string const &)*arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__RangeProcessor,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_RangeProcessor__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  Xapian::RangeProcessor *result = 0 ;
  
  SWIG_check_num_args("Xapian::RangeProcessor::RangeProcessor",2,2)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::RangeProcessor::RangeProcessor",1,"Xapian::valueno");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::RangeProcessor::RangeProcessor",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::RangeProcessor *)new Xapian::RangeProcessor(arg1,(std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__RangeProcessor,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_RangeProcessor__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  Xapian::RangeProcessor *result = 0 ;
  
  SWIG_check_num_args("Xapian::RangeProcessor::RangeProcessor",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::RangeProcessor::RangeProcessor",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::RangeProcessor *)new Xapian::RangeProcessor(arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__RangeProcessor,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_RangeProcessor(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_RangeProcessor__SWIG_0(L);
  }
  if (argc == 1) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_RangeProcessor__SWIG_3(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_RangeProcessor__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_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_RangeProcessor__SWIG_1(L);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_RangeProcessor'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::RangeProcessor::RangeProcessor()\n"
    "    Xapian::RangeProcessor::RangeProcessor(Xapian::valueno,std::string const &,unsigned int)\n"
    "    Xapian::RangeProcessor::RangeProcessor(Xapian::valueno,std::string const &)\n"
    "    Xapian::RangeProcessor::RangeProcessor(Xapian::valueno)\n");
  lua_error(L);return 0;
}


static int _wrap_RangeProcessor_check_range(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::RangeProcessor *arg1 = (Xapian::RangeProcessor *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  std::string temp2 ;
  std::string temp3 ;
  Xapian::Query result;
  
  SWIG_check_num_args("Xapian::RangeProcessor::check_range",3,3)
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::RangeProcessor::check_range",2,"std::string const &");
  if(!lua_isstring(L,3)) SWIG_fail_arg("Xapian::RangeProcessor::check_range",3,"std::string const &");
  {
    if (lua_isfunction(L, 1)) {
      arg1 = new luaRangeProcessor(L);
    } else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 1, (void**)&arg1, SWIGTYPE_p_Xapian__RangeProcessor, 0))) {
        SWIG_fail;
      }
    }
  }
  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 = (arg1)->check_range((std::string const &)*arg2,(std::string const &)*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_RangeProcessor___call(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::RangeProcessor *arg1 = (Xapian::RangeProcessor *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  std::string temp2 ;
  std::string temp3 ;
  Xapian::Query result;
  
  SWIG_check_num_args("Xapian::RangeProcessor::operator ()",3,3)
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::RangeProcessor::operator ()",2,"std::string const &");
  if(!lua_isstring(L,3)) SWIG_fail_arg("Xapian::RangeProcessor::operator ()",3,"std::string const &");
  {
    if (lua_isfunction(L, 1)) {
      arg1 = new luaRangeProcessor(L);
    } else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 1, (void**)&arg1, SWIGTYPE_p_Xapian__RangeProcessor, 0))) {
        SWIG_fail;
      }
    }
  }
  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 = (arg1)->operator ()((std::string const &)*arg2,(std::string const &)*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_RangeProcessor_release(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::RangeProcessor *arg1 = (Xapian::RangeProcessor *) 0 ;
  Xapian::RangeProcessor *result = 0 ;
  
  SWIG_check_num_args("Xapian::RangeProcessor::release",1,1)
  {
    if (lua_isfunction(L, 1)) {
      arg1 = new luaRangeProcessor(L);
    } else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 1, (void**)&arg1, SWIGTYPE_p_Xapian__RangeProcessor, 0))) {
        SWIG_fail;
      }
    }
  }
  {
    try {
      result = (Xapian::RangeProcessor *)((Xapian::RangeProcessor const *)arg1)->release();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__RangeProcessor,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_RangeProcessor(void *obj) {
Xapian::RangeProcessor *arg1 = (Xapian::RangeProcessor *) obj;
delete arg1;
}
static int _proxy__wrap_new_RangeProcessor(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_RangeProcessor);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_RangeProcessor_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_RangeProcessor_methods[]= {
    { "check_range", _wrap_RangeProcessor_check_range},
    { "__call", _wrap_RangeProcessor___call},
    { "release", _wrap_RangeProcessor_release},
    {0,0}
};
static swig_lua_method swig_RangeProcessor_meta[] = {
    { "__call", _wrap_RangeProcessor___call},
    {0,0}
};

static swig_lua_attribute swig_RangeProcessor_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_RangeProcessor_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_RangeProcessor_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_RangeProcessor_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_RangeProcessor_Sf_SwigStatic = {
    "RangeProcessor",
    swig_RangeProcessor_Sf_SwigStatic_methods,
    swig_RangeProcessor_Sf_SwigStatic_attributes,
    swig_RangeProcessor_Sf_SwigStatic_constants,
    swig_RangeProcessor_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_RangeProcessor_bases[] = {0};
static const char *swig_RangeProcessor_base_names[] = {0};
static swig_lua_class _wrap_class_RangeProcessor = { "RangeProcessor", "RangeProcessor", &SWIGTYPE_p_Xapian__RangeProcessor,_proxy__wrap_new_RangeProcessor, swig_delete_RangeProcessor, swig_RangeProcessor_methods, swig_RangeProcessor_attributes, &swig_RangeProcessor_Sf_SwigStatic, swig_RangeProcessor_meta, swig_RangeProcessor_bases, swig_RangeProcessor_base_names };

static int _wrap_new_DateRangeProcessor__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  unsigned int arg2 ;
  int arg3 ;
  Xapian::DateRangeProcessor *result = 0 ;
  
  SWIG_check_num_args("Xapian::DateRangeProcessor::DateRangeProcessor",3,3)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::DateRangeProcessor::DateRangeProcessor",1,"Xapian::valueno");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::DateRangeProcessor::DateRangeProcessor",2,"unsigned int");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::DateRangeProcessor::DateRangeProcessor",3,"int");
  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 = (unsigned int)lua_tonumber(L, 2);
  arg3 = (int)lua_tonumber(L, 3);
  {
    try {
      result = (Xapian::DateRangeProcessor *)new Xapian::DateRangeProcessor(arg1,arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DateRangeProcessor,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DateRangeProcessor__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  unsigned int arg2 ;
  Xapian::DateRangeProcessor *result = 0 ;
  
  SWIG_check_num_args("Xapian::DateRangeProcessor::DateRangeProcessor",2,2)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::DateRangeProcessor::DateRangeProcessor",1,"Xapian::valueno");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::DateRangeProcessor::DateRangeProcessor",2,"unsigned int");
  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 = (unsigned int)lua_tonumber(L, 2);
  {
    try {
      result = (Xapian::DateRangeProcessor *)new Xapian::DateRangeProcessor(arg1,arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DateRangeProcessor,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DateRangeProcessor__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  Xapian::DateRangeProcessor *result = 0 ;
  
  SWIG_check_num_args("Xapian::DateRangeProcessor::DateRangeProcessor",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::DateRangeProcessor::DateRangeProcessor",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::DateRangeProcessor *)new Xapian::DateRangeProcessor(arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DateRangeProcessor,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DateRangeProcessor__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  unsigned int arg3 ;
  int arg4 ;
  std::string temp2 ;
  Xapian::DateRangeProcessor *result = 0 ;
  
  SWIG_check_num_args("Xapian::DateRangeProcessor::DateRangeProcessor",4,4)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::DateRangeProcessor::DateRangeProcessor",1,"Xapian::valueno");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DateRangeProcessor::DateRangeProcessor",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::DateRangeProcessor::DateRangeProcessor",3,"unsigned int");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::DateRangeProcessor::DateRangeProcessor",4,"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;
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (unsigned int)lua_tonumber(L, 3);
  arg4 = (int)lua_tonumber(L, 4);
  {
    try {
      result = (Xapian::DateRangeProcessor *)new Xapian::DateRangeProcessor(arg1,(std::string const &)*arg2,arg3,arg4);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DateRangeProcessor,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DateRangeProcessor__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  unsigned int arg3 ;
  std::string temp2 ;
  Xapian::DateRangeProcessor *result = 0 ;
  
  SWIG_check_num_args("Xapian::DateRangeProcessor::DateRangeProcessor",3,3)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::DateRangeProcessor::DateRangeProcessor",1,"Xapian::valueno");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DateRangeProcessor::DateRangeProcessor",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::DateRangeProcessor::DateRangeProcessor",3,"unsigned 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;
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (unsigned int)lua_tonumber(L, 3);
  {
    try {
      result = (Xapian::DateRangeProcessor *)new Xapian::DateRangeProcessor(arg1,(std::string const &)*arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DateRangeProcessor,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DateRangeProcessor__SWIG_5(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  Xapian::DateRangeProcessor *result = 0 ;
  
  SWIG_check_num_args("Xapian::DateRangeProcessor::DateRangeProcessor",2,2)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::DateRangeProcessor::DateRangeProcessor",1,"Xapian::valueno");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DateRangeProcessor::DateRangeProcessor",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::DateRangeProcessor *)new Xapian::DateRangeProcessor(arg1,(std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__DateRangeProcessor,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_DateRangeProcessor(lua_State* L) {
  int argc;
  int argv[5]={
    1,2,3,4,5
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_DateRangeProcessor__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_DateRangeProcessor__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_DateRangeProcessor__SWIG_5(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_DateRangeProcessor__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_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_DateRangeProcessor__SWIG_4(L);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    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_new_DateRangeProcessor__SWIG_3(L);
          }
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_DateRangeProcessor'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::DateRangeProcessor::DateRangeProcessor(Xapian::valueno,unsigned int,int)\n"
    "    Xapian::DateRangeProcessor::DateRangeProcessor(Xapian::valueno,unsigned int)\n"
    "    Xapian::DateRangeProcessor::DateRangeProcessor(Xapian::valueno)\n"
    "    Xapian::DateRangeProcessor::DateRangeProcessor(Xapian::valueno,std::string const &,unsigned int,int)\n"
    "    Xapian::DateRangeProcessor::DateRangeProcessor(Xapian::valueno,std::string const &,unsigned int)\n"
    "    Xapian::DateRangeProcessor::DateRangeProcessor(Xapian::valueno,std::string const &)\n");
  lua_error(L);return 0;
}


static int _wrap_DateRangeProcessor___call(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::DateRangeProcessor *arg1 = (Xapian::DateRangeProcessor *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  std::string temp2 ;
  std::string temp3 ;
  Xapian::Query result;
  
  SWIG_check_num_args("Xapian::DateRangeProcessor::operator ()",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::DateRangeProcessor::operator ()",1,"Xapian::DateRangeProcessor *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::DateRangeProcessor::operator ()",2,"std::string const &");
  if(!lua_isstring(L,3)) SWIG_fail_arg("Xapian::DateRangeProcessor::operator ()",3,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__DateRangeProcessor,0))){
    SWIG_fail_ptr("DateRangeProcessor___call",1,SWIGTYPE_p_Xapian__DateRangeProcessor);
  }
  
  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 = (arg1)->operator ()((std::string const &)*arg2,(std::string const &)*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 void swig_delete_DateRangeProcessor(void *obj) {
Xapian::DateRangeProcessor *arg1 = (Xapian::DateRangeProcessor *) obj;
delete arg1;
}
static int _proxy__wrap_new_DateRangeProcessor(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_DateRangeProcessor);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_DateRangeProcessor_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_DateRangeProcessor_methods[]= {
    { "__call", _wrap_DateRangeProcessor___call},
    {0,0}
};
static swig_lua_method swig_DateRangeProcessor_meta[] = {
    { "__call", _wrap_DateRangeProcessor___call},
    {0,0}
};

static swig_lua_attribute swig_DateRangeProcessor_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_DateRangeProcessor_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_DateRangeProcessor_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_DateRangeProcessor_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_DateRangeProcessor_Sf_SwigStatic = {
    "DateRangeProcessor",
    swig_DateRangeProcessor_Sf_SwigStatic_methods,
    swig_DateRangeProcessor_Sf_SwigStatic_attributes,
    swig_DateRangeProcessor_Sf_SwigStatic_constants,
    swig_DateRangeProcessor_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_DateRangeProcessor_bases[] = {0,0};
static const char *swig_DateRangeProcessor_base_names[] = {"Xapian::RangeProcessor *",0};
static swig_lua_class _wrap_class_DateRangeProcessor = { "DateRangeProcessor", "DateRangeProcessor", &SWIGTYPE_p_Xapian__DateRangeProcessor,_proxy__wrap_new_DateRangeProcessor, swig_delete_DateRangeProcessor, swig_DateRangeProcessor_methods, swig_DateRangeProcessor_attributes, &swig_DateRangeProcessor_Sf_SwigStatic, swig_DateRangeProcessor_meta, swig_DateRangeProcessor_bases, swig_DateRangeProcessor_base_names };

static int _wrap_new_NumberRangeProcessor__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  unsigned int arg3 ;
  std::string temp2 ;
  Xapian::NumberRangeProcessor *result = 0 ;
  
  SWIG_check_num_args("Xapian::NumberRangeProcessor::NumberRangeProcessor",3,3)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::NumberRangeProcessor::NumberRangeProcessor",1,"Xapian::valueno");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::NumberRangeProcessor::NumberRangeProcessor",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::NumberRangeProcessor::NumberRangeProcessor",3,"unsigned 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;
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (unsigned int)lua_tonumber(L, 3);
  {
    try {
      result = (Xapian::NumberRangeProcessor *)new Xapian::NumberRangeProcessor(arg1,(std::string const &)*arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__NumberRangeProcessor,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_NumberRangeProcessor__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  Xapian::NumberRangeProcessor *result = 0 ;
  
  SWIG_check_num_args("Xapian::NumberRangeProcessor::NumberRangeProcessor",2,2)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::NumberRangeProcessor::NumberRangeProcessor",1,"Xapian::valueno");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::NumberRangeProcessor::NumberRangeProcessor",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::NumberRangeProcessor *)new Xapian::NumberRangeProcessor(arg1,(std::string const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__NumberRangeProcessor,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_NumberRangeProcessor__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  Xapian::NumberRangeProcessor *result = 0 ;
  
  SWIG_check_num_args("Xapian::NumberRangeProcessor::NumberRangeProcessor",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::NumberRangeProcessor::NumberRangeProcessor",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::NumberRangeProcessor *)new Xapian::NumberRangeProcessor(arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__NumberRangeProcessor,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_NumberRangeProcessor(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_NumberRangeProcessor__SWIG_2(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_NumberRangeProcessor__SWIG_1(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_NumberRangeProcessor__SWIG_0(L);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_NumberRangeProcessor'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::NumberRangeProcessor::NumberRangeProcessor(Xapian::valueno,std::string const &,unsigned int)\n"
    "    Xapian::NumberRangeProcessor::NumberRangeProcessor(Xapian::valueno,std::string const &)\n"
    "    Xapian::NumberRangeProcessor::NumberRangeProcessor(Xapian::valueno)\n");
  lua_error(L);return 0;
}


static int _wrap_NumberRangeProcessor___call(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::NumberRangeProcessor *arg1 = (Xapian::NumberRangeProcessor *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  std::string temp2 ;
  std::string temp3 ;
  Xapian::Query result;
  
  SWIG_check_num_args("Xapian::NumberRangeProcessor::operator ()",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::NumberRangeProcessor::operator ()",1,"Xapian::NumberRangeProcessor *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::NumberRangeProcessor::operator ()",2,"std::string const &");
  if(!lua_isstring(L,3)) SWIG_fail_arg("Xapian::NumberRangeProcessor::operator ()",3,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__NumberRangeProcessor,0))){
    SWIG_fail_ptr("NumberRangeProcessor___call",1,SWIGTYPE_p_Xapian__NumberRangeProcessor);
  }
  
  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 = (arg1)->operator ()((std::string const &)*arg2,(std::string const &)*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 void swig_delete_NumberRangeProcessor(void *obj) {
Xapian::NumberRangeProcessor *arg1 = (Xapian::NumberRangeProcessor *) obj;
delete arg1;
}
static int _proxy__wrap_new_NumberRangeProcessor(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_NumberRangeProcessor);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_NumberRangeProcessor_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_NumberRangeProcessor_methods[]= {
    { "__call", _wrap_NumberRangeProcessor___call},
    {0,0}
};
static swig_lua_method swig_NumberRangeProcessor_meta[] = {
    { "__call", _wrap_NumberRangeProcessor___call},
    {0,0}
};

static swig_lua_attribute swig_NumberRangeProcessor_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_NumberRangeProcessor_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_NumberRangeProcessor_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_NumberRangeProcessor_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_NumberRangeProcessor_Sf_SwigStatic = {
    "NumberRangeProcessor",
    swig_NumberRangeProcessor_Sf_SwigStatic_methods,
    swig_NumberRangeProcessor_Sf_SwigStatic_attributes,
    swig_NumberRangeProcessor_Sf_SwigStatic_constants,
    swig_NumberRangeProcessor_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_NumberRangeProcessor_bases[] = {0,0};
static const char *swig_NumberRangeProcessor_base_names[] = {"Xapian::RangeProcessor *",0};
static swig_lua_class _wrap_class_NumberRangeProcessor = { "NumberRangeProcessor", "NumberRangeProcessor", &SWIGTYPE_p_Xapian__NumberRangeProcessor,_proxy__wrap_new_NumberRangeProcessor, swig_delete_NumberRangeProcessor, swig_NumberRangeProcessor_methods, swig_NumberRangeProcessor_attributes, &swig_NumberRangeProcessor_Sf_SwigStatic, swig_NumberRangeProcessor_meta, swig_NumberRangeProcessor_bases, swig_NumberRangeProcessor_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 int _wrap_ValueRangeProcessor_release(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::ValueRangeProcessor *arg1 = (Xapian::ValueRangeProcessor *) 0 ;
  Xapian::ValueRangeProcessor *result = 0 ;
  
  SWIG_check_num_args("Xapian::ValueRangeProcessor::release",1,1)
  {
    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;
      }
    }
  }
  {
    try {
      result = (Xapian::ValueRangeProcessor *)((Xapian::ValueRangeProcessor const *)arg1)->release();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__ValueRangeProcessor,0); 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_attribute swig_ValueRangeProcessor_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_ValueRangeProcessor_methods[]= {
    { "__call", _wrap_ValueRangeProcessor___call},
    { "release", _wrap_ValueRangeProcessor_release},
    {0,0}
};
static swig_lua_method swig_ValueRangeProcessor_meta[] = {
    { "__call", _wrap_ValueRangeProcessor___call},
    {0,0}
};

static swig_lua_attribute swig_ValueRangeProcessor_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_ValueRangeProcessor_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_ValueRangeProcessor_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_ValueRangeProcessor_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_ValueRangeProcessor_Sf_SwigStatic = {
    "ValueRangeProcessor",
    swig_ValueRangeProcessor_Sf_SwigStatic_methods,
    swig_ValueRangeProcessor_Sf_SwigStatic_attributes,
    swig_ValueRangeProcessor_Sf_SwigStatic_constants,
    swig_ValueRangeProcessor_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_ValueRangeProcessor_bases[] = {0};
static const char *swig_ValueRangeProcessor_base_names[] = {0};
static swig_lua_class _wrap_class_ValueRangeProcessor = { "ValueRangeProcessor", "ValueRangeProcessor", &SWIGTYPE_p_Xapian__ValueRangeProcessor,0, swig_delete_ValueRangeProcessor, swig_ValueRangeProcessor_methods, swig_ValueRangeProcessor_attributes, &swig_ValueRangeProcessor_Sf_SwigStatic, swig_ValueRangeProcessor_meta, swig_ValueRangeProcessor_bases, swig_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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 int _proxy__wrap_new_StringValueRangeProcessor(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_StringValueRangeProcessor);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_StringValueRangeProcessor_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_StringValueRangeProcessor_methods[]= {
    { "__call", _wrap_StringValueRangeProcessor___call},
    {0,0}
};
static swig_lua_method swig_StringValueRangeProcessor_meta[] = {
    { "__call", _wrap_StringValueRangeProcessor___call},
    {0,0}
};

static swig_lua_attribute swig_StringValueRangeProcessor_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_StringValueRangeProcessor_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_StringValueRangeProcessor_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_StringValueRangeProcessor_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_StringValueRangeProcessor_Sf_SwigStatic = {
    "StringValueRangeProcessor",
    swig_StringValueRangeProcessor_Sf_SwigStatic_methods,
    swig_StringValueRangeProcessor_Sf_SwigStatic_attributes,
    swig_StringValueRangeProcessor_Sf_SwigStatic_constants,
    swig_StringValueRangeProcessor_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_StringValueRangeProcessor_bases[] = {0,0};
static const char *swig_StringValueRangeProcessor_base_names[] = {"Xapian::ValueRangeProcessor *",0};
static swig_lua_class _wrap_class_StringValueRangeProcessor = { "StringValueRangeProcessor", "StringValueRangeProcessor", &SWIGTYPE_p_Xapian__StringValueRangeProcessor,_proxy__wrap_new_StringValueRangeProcessor, swig_delete_StringValueRangeProcessor, swig_StringValueRangeProcessor_methods, swig_StringValueRangeProcessor_attributes, &swig_StringValueRangeProcessor_Sf_SwigStatic, swig_StringValueRangeProcessor_meta, swig_StringValueRangeProcessor_bases, swig_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);
            }
          }
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 int _proxy__wrap_new_DateValueRangeProcessor(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_DateValueRangeProcessor);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_DateValueRangeProcessor_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_DateValueRangeProcessor_methods[]= {
    { "__call", _wrap_DateValueRangeProcessor___call},
    {0,0}
};
static swig_lua_method swig_DateValueRangeProcessor_meta[] = {
    { "__call", _wrap_DateValueRangeProcessor___call},
    {0,0}
};

static swig_lua_attribute swig_DateValueRangeProcessor_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_DateValueRangeProcessor_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_DateValueRangeProcessor_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_DateValueRangeProcessor_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_DateValueRangeProcessor_Sf_SwigStatic = {
    "DateValueRangeProcessor",
    swig_DateValueRangeProcessor_Sf_SwigStatic_methods,
    swig_DateValueRangeProcessor_Sf_SwigStatic_attributes,
    swig_DateValueRangeProcessor_Sf_SwigStatic_constants,
    swig_DateValueRangeProcessor_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_DateValueRangeProcessor_bases[] = {0,0};
static const char *swig_DateValueRangeProcessor_base_names[] = {"Xapian::StringValueRangeProcessor *",0};
static swig_lua_class _wrap_class_DateValueRangeProcessor = { "DateValueRangeProcessor", "DateValueRangeProcessor", &SWIGTYPE_p_Xapian__DateValueRangeProcessor,_proxy__wrap_new_DateValueRangeProcessor, swig_delete_DateValueRangeProcessor, swig_DateValueRangeProcessor_methods, swig_DateValueRangeProcessor_attributes, &swig_DateValueRangeProcessor_Sf_SwigStatic, swig_DateValueRangeProcessor_meta, swig_DateValueRangeProcessor_bases, swig_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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 int _proxy__wrap_new_NumberValueRangeProcessor(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_NumberValueRangeProcessor);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_NumberValueRangeProcessor_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_NumberValueRangeProcessor_methods[]= {
    { "__call", _wrap_NumberValueRangeProcessor___call},
    {0,0}
};
static swig_lua_method swig_NumberValueRangeProcessor_meta[] = {
    { "__call", _wrap_NumberValueRangeProcessor___call},
    {0,0}
};

static swig_lua_attribute swig_NumberValueRangeProcessor_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_NumberValueRangeProcessor_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_NumberValueRangeProcessor_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_NumberValueRangeProcessor_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_NumberValueRangeProcessor_Sf_SwigStatic = {
    "NumberValueRangeProcessor",
    swig_NumberValueRangeProcessor_Sf_SwigStatic_methods,
    swig_NumberValueRangeProcessor_Sf_SwigStatic_attributes,
    swig_NumberValueRangeProcessor_Sf_SwigStatic_constants,
    swig_NumberValueRangeProcessor_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_NumberValueRangeProcessor_bases[] = {0,0};
static const char *swig_NumberValueRangeProcessor_base_names[] = {"Xapian::StringValueRangeProcessor *",0};
static swig_lua_class _wrap_class_NumberValueRangeProcessor = { "NumberValueRangeProcessor", "NumberValueRangeProcessor", &SWIGTYPE_p_Xapian__NumberValueRangeProcessor,_proxy__wrap_new_NumberValueRangeProcessor, swig_delete_NumberValueRangeProcessor, swig_NumberValueRangeProcessor_methods, swig_NumberValueRangeProcessor_attributes, &swig_NumberValueRangeProcessor_Sf_SwigStatic, swig_NumberValueRangeProcessor_meta, swig_NumberValueRangeProcessor_bases, swig_NumberValueRangeProcessor_base_names };

static int _wrap_FieldProcessor___call(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::FieldProcessor *arg1 = (Xapian::FieldProcessor *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  Xapian::Query result;
  
  SWIG_check_num_args("Xapian::FieldProcessor::operator ()",2,2)
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::FieldProcessor::operator ()",2,"std::string const &");
  {
    if (lua_isfunction(L, 1)) {
      arg1 = new luaFieldProcessor(L);
    } else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 1, (void**)&arg1, SWIGTYPE_p_Xapian__FieldProcessor, 0))) {
        SWIG_fail;
      }
    }
  }
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      result = (arg1)->operator ()((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_FieldProcessor_release(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::FieldProcessor *arg1 = (Xapian::FieldProcessor *) 0 ;
  Xapian::FieldProcessor *result = 0 ;
  
  SWIG_check_num_args("Xapian::FieldProcessor::release",1,1)
  {
    if (lua_isfunction(L, 1)) {
      arg1 = new luaFieldProcessor(L);
    } else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 1, (void**)&arg1, SWIGTYPE_p_Xapian__FieldProcessor, 0))) {
        SWIG_fail;
      }
    }
  }
  {
    try {
      result = (Xapian::FieldProcessor *)((Xapian::FieldProcessor const *)arg1)->release();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__FieldProcessor,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_FieldProcessor(void *obj) {
Xapian::FieldProcessor *arg1 = (Xapian::FieldProcessor *) obj;
delete arg1;
}
static swig_lua_attribute swig_FieldProcessor_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_FieldProcessor_methods[]= {
    { "__call", _wrap_FieldProcessor___call},
    { "release", _wrap_FieldProcessor_release},
    {0,0}
};
static swig_lua_method swig_FieldProcessor_meta[] = {
    { "__call", _wrap_FieldProcessor___call},
    {0,0}
};

static swig_lua_attribute swig_FieldProcessor_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_FieldProcessor_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_FieldProcessor_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_FieldProcessor_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_FieldProcessor_Sf_SwigStatic = {
    "FieldProcessor",
    swig_FieldProcessor_Sf_SwigStatic_methods,
    swig_FieldProcessor_Sf_SwigStatic_attributes,
    swig_FieldProcessor_Sf_SwigStatic_constants,
    swig_FieldProcessor_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_FieldProcessor_bases[] = {0};
static const char *swig_FieldProcessor_base_names[] = {0};
static swig_lua_class _wrap_class_FieldProcessor = { "FieldProcessor", "FieldProcessor", &SWIGTYPE_p_Xapian__FieldProcessor,0, swig_delete_FieldProcessor, swig_FieldProcessor_methods, swig_FieldProcessor_attributes, &swig_FieldProcessor_Sf_SwigStatic, swig_FieldProcessor_meta, swig_FieldProcessor_bases, swig_FieldProcessor_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);
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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_expansion__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::termcount arg2 ;
  int arg3 ;
  unsigned int arg4 ;
  
  SWIG_check_num_args("Xapian::QueryParser::set_max_expansion",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::QueryParser::set_max_expansion",1,"Xapian::QueryParser *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::QueryParser::set_max_expansion",2,"Xapian::termcount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::QueryParser::set_max_expansion",3,"int");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::QueryParser::set_max_expansion",4,"unsigned int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__QueryParser,0))){
    SWIG_fail_ptr("QueryParser_set_max_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);
  arg3 = (int)lua_tonumber(L, 3);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (unsigned int)lua_tonumber(L, 4);
  {
    try {
      (arg1)->set_max_expansion(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_QueryParser_set_max_expansion__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::termcount arg2 ;
  int arg3 ;
  
  SWIG_check_num_args("Xapian::QueryParser::set_max_expansion",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::QueryParser::set_max_expansion",1,"Xapian::QueryParser *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::QueryParser::set_max_expansion",2,"Xapian::termcount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::QueryParser::set_max_expansion",3,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__QueryParser,0))){
    SWIG_fail_ptr("QueryParser_set_max_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);
  arg3 = (int)lua_tonumber(L, 3);
  {
    try {
      (arg1)->set_max_expansion(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_QueryParser_set_max_expansion__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::termcount arg2 ;
  
  SWIG_check_num_args("Xapian::QueryParser::set_max_expansion",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::QueryParser::set_max_expansion",1,"Xapian::QueryParser *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::QueryParser::set_max_expansion",2,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__QueryParser,0))){
    SWIG_fail_ptr("QueryParser_set_max_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_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_set_max_expansion(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_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_QueryParser_set_max_expansion__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_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_QueryParser_set_max_expansion__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_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          {
            _v = lua_isnumber(L,argv[3]);
          }
          if (_v) {
            return _wrap_QueryParser_set_max_expansion__SWIG_0(L);
          }
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'QueryParser_set_max_expansion'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::QueryParser::set_max_expansion(Xapian::termcount,int,unsigned int)\n"
    "    Xapian::QueryParser::set_max_expansion(Xapian::termcount,int)\n"
    "    Xapian::QueryParser::set_max_expansion(Xapian::termcount)\n");
  lua_error(L);return 0;
}


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);
          }
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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__SWIG_0(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_prefix__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::FieldProcessor *arg3 = (Xapian::FieldProcessor *) 0 ;
  std::string temp2 ;
  
  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 (!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;
  {
    if (lua_isfunction(L, 3)) {
      arg3 = new luaFieldProcessor(L);
    } else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 3, (void**)&arg3, SWIGTYPE_p_Xapian__FieldProcessor, 0))) {
        SWIG_fail;
      }
    }
  }
  {
    try {
      (arg1)->add_prefix((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_QueryParser_add_prefix(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__QueryParser, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          void *ptr;
          if (lua_isfunction(L, argv[2]) || (SWIG_isptrtype(L, argv[2]) && !SWIG_ConvertPtr(L, argv[2], (void **) &ptr, SWIGTYPE_p_Xapian__FieldProcessor, 0))) {
            _v = 1;
          } else {
            _v = 0;
          }
        }
        if (_v) {
          return _wrap_QueryParser_add_prefix__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__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_prefix__SWIG_0(L);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'QueryParser_add_prefix'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::QueryParser::add_prefix(std::string const &,std::string const &)\n"
    "    Xapian::QueryParser::add_prefix(std::string const &,Xapian::FieldProcessor *)\n");
  lua_error(L);return 0;
}


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 ;
  std::string *arg4 = (std::string *) 0 ;
  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(!SWIG_isptrtype(L,4)) SWIG_fail_arg("Xapian::QueryParser::add_boolean_prefix",4,"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;
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_std__string,0))){
    SWIG_fail_ptr("QueryParser_add_boolean_prefix",4,SWIGTYPE_p_std__string);
  }
  
  {
    try {
      (arg1)->add_boolean_prefix((std::string const &)*arg2,(std::string const &)*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_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__SWIG_2(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_3(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::FieldProcessor *arg3 = (Xapian::FieldProcessor *) 0 ;
  std::string *arg4 = (std::string *) 0 ;
  std::string temp2 ;
  
  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(!SWIG_isptrtype(L,4)) SWIG_fail_arg("Xapian::QueryParser::add_boolean_prefix",4,"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;
  {
    if (lua_isfunction(L, 3)) {
      arg3 = new luaFieldProcessor(L);
    } else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 3, (void**)&arg3, SWIGTYPE_p_Xapian__FieldProcessor, 0))) {
        SWIG_fail;
      }
    }
  }
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_std__string,0))){
    SWIG_fail_ptr("QueryParser_add_boolean_prefix",4,SWIGTYPE_p_std__string);
  }
  
  {
    try {
      (arg1)->add_boolean_prefix((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_QueryParser_add_boolean_prefix__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::FieldProcessor *arg3 = (Xapian::FieldProcessor *) 0 ;
  std::string temp2 ;
  
  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 (!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;
  {
    if (lua_isfunction(L, 3)) {
      arg3 = new luaFieldProcessor(L);
    } else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 3, (void**)&arg3, SWIGTYPE_p_Xapian__FieldProcessor, 0))) {
        SWIG_fail;
      }
    }
  }
  {
    try {
      (arg1)->add_boolean_prefix((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_QueryParser_add_boolean_prefix__SWIG_5(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::FieldProcessor *arg3 = (Xapian::FieldProcessor *) 0 ;
  bool arg4 ;
  std::string temp2 ;
  
  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_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;
  {
    if (lua_isfunction(L, 3)) {
      arg3 = new luaFieldProcessor(L);
    } else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 3, (void**)&arg3, SWIGTYPE_p_Xapian__FieldProcessor, 0))) {
        SWIG_fail;
      }
    }
  }
  arg4 = (lua_toboolean(L, 4)!=0);
  {
    try {
      (arg1)->add_boolean_prefix((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_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) {
        {
          void *ptr;
          if (lua_isfunction(L, argv[2]) || (SWIG_isptrtype(L, argv[2]) && !SWIG_ConvertPtr(L, argv[2], (void **) &ptr, SWIGTYPE_p_Xapian__FieldProcessor, 0))) {
            _v = 1;
          } else {
            _v = 0;
          }
        }
        if (_v) {
          return _wrap_QueryParser_add_boolean_prefix__SWIG_4(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) {
        {
          void *ptr;
          if (lua_isfunction(L, argv[2]) || (SWIG_isptrtype(L, argv[2]) && !SWIG_ConvertPtr(L, argv[2], (void **) &ptr, SWIGTYPE_p_Xapian__FieldProcessor, 0))) {
            _v = 1;
          } else {
            _v = 0;
          }
        }
        if (_v) {
          {
            void *ptr;
            if (SWIG_isptrtype(L,argv[3])==0 || SWIG_ConvertPtr(L,argv[3], (void **) &ptr, SWIGTYPE_p_std__string, 0)) {
              _v = 0;
            } else {
              _v = 1;
            }
          }
          if (_v) {
            return _wrap_QueryParser_add_boolean_prefix__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__QueryParser, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isstring(L,argv[1]);
      }
      if (_v) {
        {
          void *ptr;
          if (lua_isfunction(L, argv[2]) || (SWIG_isptrtype(L, argv[2]) && !SWIG_ConvertPtr(L, argv[2], (void **) &ptr, SWIGTYPE_p_Xapian__FieldProcessor, 0))) {
            _v = 1;
          } else {
            _v = 0;
          }
        }
        if (_v) {
          {
            _v = lua_isboolean(L,argv[3]);
          }
          if (_v) {
            return _wrap_QueryParser_add_boolean_prefix__SWIG_5(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) {
          {
            void *ptr;
            if (SWIG_isptrtype(L,argv[3])==0 || SWIG_ConvertPtr(L,argv[3], (void **) &ptr, SWIGTYPE_p_std__string, 0)) {
              _v = 0;
            } else {
              _v = 1;
            }
          }
          if (_v) {
            return _wrap_QueryParser_add_boolean_prefix__SWIG_0(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_2(L);
          }
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 &,std::string const *)\n"
    "    Xapian::QueryParser::add_boolean_prefix(std::string const &,std::string const &)\n"
    "    Xapian::QueryParser::add_boolean_prefix(std::string const &,std::string const &,bool)\n"
    "    Xapian::QueryParser::add_boolean_prefix(std::string const &,Xapian::FieldProcessor *,std::string const *)\n"
    "    Xapian::QueryParser::add_boolean_prefix(std::string const &,Xapian::FieldProcessor *)\n"
    "    Xapian::QueryParser::add_boolean_prefix(std::string const &,Xapian::FieldProcessor *,bool)\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);
  }
  
  result = ((Xapian::QueryParser const *)arg1)->stoplist_end();
  {
    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;
  result = ((Xapian::QueryParser const *)arg1)->unstem_end((std::string const &)*arg2);
  {
    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_rangeprocessor__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::RangeProcessor *arg2 = (Xapian::RangeProcessor *) 0 ;
  std::string *arg3 = (std::string *) 0 ;
  
  SWIG_check_num_args("Xapian::QueryParser::add_rangeprocessor",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::QueryParser::add_rangeprocessor",1,"Xapian::QueryParser *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("Xapian::QueryParser::add_rangeprocessor",3,"std::string const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__QueryParser,0))){
    SWIG_fail_ptr("QueryParser_add_rangeprocessor",1,SWIGTYPE_p_Xapian__QueryParser);
  }
  
  {
    if (lua_isfunction(L, 2)) {
      arg2 = new luaRangeProcessor(L);
    } else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 2, (void**)&arg2, SWIGTYPE_p_Xapian__RangeProcessor, 0))) {
        SWIG_fail;
      }
    }
  }
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_std__string,0))){
    SWIG_fail_ptr("QueryParser_add_rangeprocessor",3,SWIGTYPE_p_std__string);
  }
  
  {
    try {
      (arg1)->add_rangeprocessor(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_rangeprocessor__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::RangeProcessor *arg2 = (Xapian::RangeProcessor *) 0 ;
  
  SWIG_check_num_args("Xapian::QueryParser::add_rangeprocessor",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::QueryParser::add_rangeprocessor",1,"Xapian::QueryParser *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__QueryParser,0))){
    SWIG_fail_ptr("QueryParser_add_rangeprocessor",1,SWIGTYPE_p_Xapian__QueryParser);
  }
  
  {
    if (lua_isfunction(L, 2)) {
      arg2 = new luaRangeProcessor(L);
    } else {
      if (!SWIG_IsOK(SWIG_ConvertPtr(L, 2, (void**)&arg2, SWIGTYPE_p_Xapian__RangeProcessor, 0))) {
        SWIG_fail;
      }
    }
  }
  {
    try {
      (arg1)->add_rangeprocessor(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_add_rangeprocessor(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__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__RangeProcessor, 0))) {
          _v = 1;
        } else {
          _v = 0;
        }
      }
      if (_v) {
        return _wrap_QueryParser_add_rangeprocessor__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__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__RangeProcessor, 0))) {
          _v = 1;
        } else {
          _v = 0;
        }
      }
      if (_v) {
        {
          void *ptr;
          if (SWIG_isptrtype(L,argv[2])==0 || SWIG_ConvertPtr(L,argv[2], (void **) &ptr, SWIGTYPE_p_std__string, 0)) {
            _v = 0;
          } else {
            _v = 1;
          }
        }
        if (_v) {
          return _wrap_QueryParser_add_rangeprocessor__SWIG_0(L);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'QueryParser_add_rangeprocessor'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::QueryParser::add_rangeprocessor(Xapian::RangeProcessor *,std::string const *)\n"
    "    Xapian::QueryParser::add_rangeprocessor(Xapian::RangeProcessor *)\n");
  lua_error(L);return 0;
}


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 ;
  SwigValueWrapper< 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 int _proxy__wrap_new_QueryParser(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_QueryParser);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_QueryParser_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_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_expansion", _wrap_QueryParser_set_max_expansion},
    { "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_rangeprocessor", _wrap_QueryParser_add_rangeprocessor},
    { "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_method swig_QueryParser_meta[] = {
    { "__tostring", _wrap_QueryParser___tostring},
    {0,0}
};

static swig_lua_attribute swig_QueryParser_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_QueryParser_Sf_SwigStatic_constants[]= {
    {SWIG_LUA_CONSTTAB_INT("FLAG_BOOLEAN", Xapian::QueryParser::FLAG_BOOLEAN)},
    {SWIG_LUA_CONSTTAB_INT("FLAG_PHRASE", Xapian::QueryParser::FLAG_PHRASE)},
    {SWIG_LUA_CONSTTAB_INT("FLAG_LOVEHATE", Xapian::QueryParser::FLAG_LOVEHATE)},
    {SWIG_LUA_CONSTTAB_INT("FLAG_BOOLEAN_ANY_CASE", Xapian::QueryParser::FLAG_BOOLEAN_ANY_CASE)},
    {SWIG_LUA_CONSTTAB_INT("FLAG_WILDCARD", Xapian::QueryParser::FLAG_WILDCARD)},
    {SWIG_LUA_CONSTTAB_INT("FLAG_PURE_NOT", Xapian::QueryParser::FLAG_PURE_NOT)},
    {SWIG_LUA_CONSTTAB_INT("FLAG_PARTIAL", Xapian::QueryParser::FLAG_PARTIAL)},
    {SWIG_LUA_CONSTTAB_INT("FLAG_SPELLING_CORRECTION", Xapian::QueryParser::FLAG_SPELLING_CORRECTION)},
    {SWIG_LUA_CONSTTAB_INT("FLAG_SYNONYM", Xapian::QueryParser::FLAG_SYNONYM)},
    {SWIG_LUA_CONSTTAB_INT("FLAG_AUTO_SYNONYMS", Xapian::QueryParser::FLAG_AUTO_SYNONYMS)},
    {SWIG_LUA_CONSTTAB_INT("FLAG_AUTO_MULTIWORD_SYNONYMS", Xapian::QueryParser::FLAG_AUTO_MULTIWORD_SYNONYMS)},
    {SWIG_LUA_CONSTTAB_INT("FLAG_CJK_NGRAM", Xapian::QueryParser::FLAG_CJK_NGRAM)},
    {SWIG_LUA_CONSTTAB_INT("FLAG_DEFAULT", Xapian::QueryParser::FLAG_DEFAULT)},
    {SWIG_LUA_CONSTTAB_INT("STEM_NONE", Xapian::QueryParser::STEM_NONE)},
    {SWIG_LUA_CONSTTAB_INT("STEM_SOME", Xapian::QueryParser::STEM_SOME)},
    {SWIG_LUA_CONSTTAB_INT("STEM_ALL", Xapian::QueryParser::STEM_ALL)},
    {SWIG_LUA_CONSTTAB_INT("STEM_ALL_Z", Xapian::QueryParser::STEM_ALL_Z)},
    {SWIG_LUA_CONSTTAB_INT("STEM_SOME_FULL_POS", Xapian::QueryParser::STEM_SOME_FULL_POS)},
    {0,0,0,0,0,0}
};
static swig_lua_method swig_QueryParser_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_QueryParser_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_QueryParser_Sf_SwigStatic = {
    "QueryParser",
    swig_QueryParser_Sf_SwigStatic_methods,
    swig_QueryParser_Sf_SwigStatic_attributes,
    swig_QueryParser_Sf_SwigStatic_constants,
    swig_QueryParser_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_QueryParser_bases[] = {0};
static const char *swig_QueryParser_base_names[] = {0};
static swig_lua_class _wrap_class_QueryParser = { "QueryParser", "QueryParser", &SWIGTYPE_p_Xapian__QueryParser,_proxy__wrap_new_QueryParser, swig_delete_QueryParser, swig_QueryParser_methods, swig_QueryParser_attributes, &swig_QueryParser_Sf_SwigStatic, swig_QueryParser_meta, swig_QueryParser_bases, swig_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_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 int _proxy__wrap_new_ValueSetMatchDecider(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_ValueSetMatchDecider);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_ValueSetMatchDecider_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_ValueSetMatchDecider_methods[]= {
    { "add_value", _wrap_ValueSetMatchDecider_add_value},
    { "remove_value", _wrap_ValueSetMatchDecider_remove_value},
    { "__call", _wrap_ValueSetMatchDecider___call},
    {0,0}
};
static swig_lua_method swig_ValueSetMatchDecider_meta[] = {
    { "__call", _wrap_ValueSetMatchDecider___call},
    {0,0}
};

static swig_lua_attribute swig_ValueSetMatchDecider_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_ValueSetMatchDecider_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_ValueSetMatchDecider_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_ValueSetMatchDecider_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_ValueSetMatchDecider_Sf_SwigStatic = {
    "ValueSetMatchDecider",
    swig_ValueSetMatchDecider_Sf_SwigStatic_methods,
    swig_ValueSetMatchDecider_Sf_SwigStatic_attributes,
    swig_ValueSetMatchDecider_Sf_SwigStatic_constants,
    swig_ValueSetMatchDecider_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_ValueSetMatchDecider_bases[] = {0,0};
static const char *swig_ValueSetMatchDecider_base_names[] = {"Xapian::MatchDecider *",0};
static swig_lua_class _wrap_class_ValueSetMatchDecider = { "ValueSetMatchDecider", "ValueSetMatchDecider", &SWIGTYPE_p_Xapian__ValueSetMatchDecider,_proxy__wrap_new_ValueSetMatchDecider, swig_delete_ValueSetMatchDecider, swig_ValueSetMatchDecider_methods, swig_ValueSetMatchDecider_attributes, &swig_ValueSetMatchDecider_Sf_SwigStatic, swig_ValueSetMatchDecider_meta, swig_ValueSetMatchDecider_bases, swig_ValueSetMatchDecider_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::termcount arg4 ;
  double result;
  
  SWIG_check_num_args("Xapian::Weight::get_sumpart",4,4)
  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(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::Weight::get_sumpart",4,"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);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (Xapian::termcount)lua_tonumber(L, 4);
  {
    try {
      result = (double)((Xapian::Weight const *)arg1)->get_sumpart(arg2,arg3,arg4);
    } 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 ;
  double 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 = (double)((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::termcount arg3 ;
  double result;
  
  SWIG_check_num_args("Xapian::Weight::get_sumextra",3,3)
  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(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Weight::get_sumextra",3,"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);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::termcount)lua_tonumber(L, 3);
  {
    try {
      result = (double)((Xapian::Weight const *)arg1)->get_sumextra(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_maxextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  double 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 = (double)((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_attribute swig_Weight_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_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_method swig_Weight_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_Weight_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_Weight_Sf_SwigStatic_constants[]= {
    {SWIG_LUA_CONSTTAB_INT("TWO_STAGE_SMOOTHING", Xapian::Weight::TWO_STAGE_SMOOTHING)},
    {SWIG_LUA_CONSTTAB_INT("DIRICHLET_SMOOTHING", Xapian::Weight::DIRICHLET_SMOOTHING)},
    {SWIG_LUA_CONSTTAB_INT("ABSOLUTE_DISCOUNT_SMOOTHING", Xapian::Weight::ABSOLUTE_DISCOUNT_SMOOTHING)},
    {SWIG_LUA_CONSTTAB_INT("JELINEK_MERCER_SMOOTHING", Xapian::Weight::JELINEK_MERCER_SMOOTHING)},
    {SWIG_LUA_CONSTTAB_INT("DIRICHLET_PLUS_SMOOTHING", Xapian::Weight::DIRICHLET_PLUS_SMOOTHING)},
    {0,0,0,0,0,0}
};
static swig_lua_method swig_Weight_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_Weight_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_Weight_Sf_SwigStatic = {
    "Weight",
    swig_Weight_Sf_SwigStatic_methods,
    swig_Weight_Sf_SwigStatic_attributes,
    swig_Weight_Sf_SwigStatic_constants,
    swig_Weight_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_Weight_bases[] = {0};
static const char *swig_Weight_base_names[] = {0};
static swig_lua_class _wrap_class_Weight = { "Weight", "Weight", &SWIGTYPE_p_Xapian__Weight,0, swig_delete_Weight, swig_Weight_methods, swig_Weight_attributes, &swig_Weight_Sf_SwigStatic, swig_Weight_meta, swig_Weight_bases, swig_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::termcount arg4 ;
  double result;
  
  SWIG_check_num_args("Xapian::BoolWeight::get_sumpart",4,4)
  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(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::BoolWeight::get_sumpart",4,"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);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (Xapian::termcount)lua_tonumber(L, 4);
  {
    try {
      result = (double)((Xapian::BoolWeight const *)arg1)->get_sumpart(arg2,arg3,arg4);
    } 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 ;
  double 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 = (double)((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::termcount arg3 ;
  double result;
  
  SWIG_check_num_args("Xapian::BoolWeight::get_sumextra",3,3)
  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(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::BoolWeight::get_sumextra",3,"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);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::termcount)lua_tonumber(L, 3);
  {
    try {
      result = (double)((Xapian::BoolWeight const *)arg1)->get_sumextra(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_maxextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  double 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 = (double)((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 int _proxy__wrap_new_BoolWeight(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_BoolWeight);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_BoolWeight_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_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_method swig_BoolWeight_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_BoolWeight_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_BoolWeight_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_BoolWeight_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_BoolWeight_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_BoolWeight_Sf_SwigStatic = {
    "BoolWeight",
    swig_BoolWeight_Sf_SwigStatic_methods,
    swig_BoolWeight_Sf_SwigStatic_attributes,
    swig_BoolWeight_Sf_SwigStatic_constants,
    swig_BoolWeight_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_BoolWeight_bases[] = {0,0};
static const char *swig_BoolWeight_base_names[] = {"Xapian::Weight *",0};
static swig_lua_class _wrap_class_BoolWeight = { "BoolWeight", "BoolWeight", &SWIGTYPE_p_Xapian__BoolWeight,_proxy__wrap_new_BoolWeight, swig_delete_BoolWeight, swig_BoolWeight_methods, swig_BoolWeight_attributes, &swig_BoolWeight_Sf_SwigStatic, swig_BoolWeight_meta, swig_BoolWeight_bases, swig_BoolWeight_base_names };

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


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


static int _wrap_new_TfIdfWeight(lua_State* L) {
  int argc;
  int argv[2]={
    1,2
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_TfIdfWeight__SWIG_1(L);
  }
  if (argc == 1) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_TfIdfWeight__SWIG_0(L);
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_TfIdfWeight'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::TfIdfWeight::TfIdfWeight(std::string const &)\n"
    "    Xapian::TfIdfWeight::TfIdfWeight()\n");
  lua_error(L);return 0;
}


static int _wrap_TfIdfWeight_name(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TfIdfWeight *arg1 = (Xapian::TfIdfWeight *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::TfIdfWeight::name",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TfIdfWeight::name",1,"Xapian::TfIdfWeight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TfIdfWeight,0))){
    SWIG_fail_ptr("TfIdfWeight_name",1,SWIGTYPE_p_Xapian__TfIdfWeight);
  }
  
  {
    try {
      result = ((Xapian::TfIdfWeight 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_TfIdfWeight_get_sumpart(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TfIdfWeight *arg1 = (Xapian::TfIdfWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  Xapian::termcount arg4 ;
  double result;
  
  SWIG_check_num_args("Xapian::TfIdfWeight::get_sumpart",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TfIdfWeight::get_sumpart",1,"Xapian::TfIdfWeight const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::TfIdfWeight::get_sumpart",2,"Xapian::termcount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::TfIdfWeight::get_sumpart",3,"Xapian::termcount");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::TfIdfWeight::get_sumpart",4,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TfIdfWeight,0))){
    SWIG_fail_ptr("TfIdfWeight_get_sumpart",1,SWIGTYPE_p_Xapian__TfIdfWeight);
  }
  
  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);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (Xapian::termcount)lua_tonumber(L, 4);
  {
    try {
      result = (double)((Xapian::TfIdfWeight const *)arg1)->get_sumpart(arg2,arg3,arg4);
    } 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_TfIdfWeight_get_maxpart(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TfIdfWeight *arg1 = (Xapian::TfIdfWeight *) 0 ;
  double result;
  
  SWIG_check_num_args("Xapian::TfIdfWeight::get_maxpart",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TfIdfWeight::get_maxpart",1,"Xapian::TfIdfWeight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TfIdfWeight,0))){
    SWIG_fail_ptr("TfIdfWeight_get_maxpart",1,SWIGTYPE_p_Xapian__TfIdfWeight);
  }
  
  {
    try {
      result = (double)((Xapian::TfIdfWeight 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_TfIdfWeight_get_sumextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TfIdfWeight *arg1 = (Xapian::TfIdfWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  double result;
  
  SWIG_check_num_args("Xapian::TfIdfWeight::get_sumextra",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TfIdfWeight::get_sumextra",1,"Xapian::TfIdfWeight const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::TfIdfWeight::get_sumextra",2,"Xapian::termcount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::TfIdfWeight::get_sumextra",3,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TfIdfWeight,0))){
    SWIG_fail_ptr("TfIdfWeight_get_sumextra",1,SWIGTYPE_p_Xapian__TfIdfWeight);
  }
  
  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 = (double)((Xapian::TfIdfWeight const *)arg1)->get_sumextra(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_TfIdfWeight_get_maxextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TfIdfWeight *arg1 = (Xapian::TfIdfWeight *) 0 ;
  double result;
  
  SWIG_check_num_args("Xapian::TfIdfWeight::get_maxextra",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::TfIdfWeight::get_maxextra",1,"Xapian::TfIdfWeight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__TfIdfWeight,0))){
    SWIG_fail_ptr("TfIdfWeight_get_maxextra",1,SWIGTYPE_p_Xapian__TfIdfWeight);
  }
  
  {
    try {
      result = (double)((Xapian::TfIdfWeight 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_TfIdfWeight(void *obj) {
Xapian::TfIdfWeight *arg1 = (Xapian::TfIdfWeight *) obj;
delete arg1;
}
static int _proxy__wrap_new_TfIdfWeight(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_TfIdfWeight);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_TfIdfWeight_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_TfIdfWeight_methods[]= {
    { "name", _wrap_TfIdfWeight_name},
    { "get_sumpart", _wrap_TfIdfWeight_get_sumpart},
    { "get_maxpart", _wrap_TfIdfWeight_get_maxpart},
    { "get_sumextra", _wrap_TfIdfWeight_get_sumextra},
    { "get_maxextra", _wrap_TfIdfWeight_get_maxextra},
    {0,0}
};
static swig_lua_method swig_TfIdfWeight_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_TfIdfWeight_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_TfIdfWeight_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_TfIdfWeight_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_TfIdfWeight_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_TfIdfWeight_Sf_SwigStatic = {
    "TfIdfWeight",
    swig_TfIdfWeight_Sf_SwigStatic_methods,
    swig_TfIdfWeight_Sf_SwigStatic_attributes,
    swig_TfIdfWeight_Sf_SwigStatic_constants,
    swig_TfIdfWeight_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_TfIdfWeight_bases[] = {0,0};
static const char *swig_TfIdfWeight_base_names[] = {"Xapian::Weight *",0};
static swig_lua_class _wrap_class_TfIdfWeight = { "TfIdfWeight", "TfIdfWeight", &SWIGTYPE_p_Xapian__TfIdfWeight,_proxy__wrap_new_TfIdfWeight, swig_delete_TfIdfWeight, swig_TfIdfWeight_methods, swig_TfIdfWeight_attributes, &swig_TfIdfWeight_Sf_SwigStatic, swig_TfIdfWeight_meta, swig_TfIdfWeight_bases, swig_TfIdfWeight_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);
            }
          }
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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::termcount arg4 ;
  double result;
  
  SWIG_check_num_args("Xapian::BM25Weight::get_sumpart",4,4)
  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(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::BM25Weight::get_sumpart",4,"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);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (Xapian::termcount)lua_tonumber(L, 4);
  {
    try {
      result = (double)((Xapian::BM25Weight const *)arg1)->get_sumpart(arg2,arg3,arg4);
    } 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 ;
  double 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 = (double)((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::termcount arg3 ;
  double result;
  
  SWIG_check_num_args("Xapian::BM25Weight::get_sumextra",3,3)
  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(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::BM25Weight::get_sumextra",3,"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);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::termcount)lua_tonumber(L, 3);
  {
    try {
      result = (double)((Xapian::BM25Weight const *)arg1)->get_sumextra(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_maxextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  double 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 = (double)((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 int _proxy__wrap_new_BM25Weight(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_BM25Weight);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_BM25Weight_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_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_method swig_BM25Weight_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_BM25Weight_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_BM25Weight_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_BM25Weight_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_BM25Weight_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_BM25Weight_Sf_SwigStatic = {
    "BM25Weight",
    swig_BM25Weight_Sf_SwigStatic_methods,
    swig_BM25Weight_Sf_SwigStatic_attributes,
    swig_BM25Weight_Sf_SwigStatic_constants,
    swig_BM25Weight_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_BM25Weight_bases[] = {0,0};
static const char *swig_BM25Weight_base_names[] = {"Xapian::Weight *",0};
static swig_lua_class _wrap_class_BM25Weight = { "BM25Weight", "BM25Weight", &SWIGTYPE_p_Xapian__BM25Weight,_proxy__wrap_new_BM25Weight, swig_delete_BM25Weight, swig_BM25Weight_methods, swig_BM25Weight_attributes, &swig_BM25Weight_Sf_SwigStatic, swig_BM25Weight_meta, swig_BM25Weight_bases, swig_BM25Weight_base_names };

static int _wrap_new_BM25PlusWeight__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  double arg1 ;
  double arg2 ;
  double arg3 ;
  double arg4 ;
  double arg5 ;
  double arg6 ;
  Xapian::BM25PlusWeight *result = 0 ;
  
  SWIG_check_num_args("Xapian::BM25PlusWeight::BM25PlusWeight",6,6)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::BM25PlusWeight::BM25PlusWeight",1,"double");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::BM25PlusWeight::BM25PlusWeight",2,"double");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::BM25PlusWeight::BM25PlusWeight",3,"double");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::BM25PlusWeight::BM25PlusWeight",4,"double");
  if(!lua_isnumber(L,5)) SWIG_fail_arg("Xapian::BM25PlusWeight::BM25PlusWeight",5,"double");
  if(!lua_isnumber(L,6)) SWIG_fail_arg("Xapian::BM25PlusWeight::BM25PlusWeight",6,"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);
  arg6 = (double)lua_tonumber(L, 6);
  {
    try {
      result = (Xapian::BM25PlusWeight *)new Xapian::BM25PlusWeight(arg1,arg2,arg3,arg4,arg5,arg6);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__BM25PlusWeight,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


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


static int _wrap_new_BM25PlusWeight(lua_State* L) {
  int argc;
  int argv[7]={
    1,2,3,4,5,6,7
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_BM25PlusWeight__SWIG_1(L);
  }
  if (argc == 6) {
    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) {
              {
                _v = lua_isnumber(L,argv[5]);
              }
              if (_v) {
                return _wrap_new_BM25PlusWeight__SWIG_0(L);
              }
            }
          }
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_BM25PlusWeight'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::BM25PlusWeight::BM25PlusWeight(double,double,double,double,double,double)\n"
    "    Xapian::BM25PlusWeight::BM25PlusWeight()\n");
  lua_error(L);return 0;
}


static int _wrap_BM25PlusWeight_name(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::BM25PlusWeight *arg1 = (Xapian::BM25PlusWeight *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::BM25PlusWeight::name",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::BM25PlusWeight::name",1,"Xapian::BM25PlusWeight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__BM25PlusWeight,0))){
    SWIG_fail_ptr("BM25PlusWeight_name",1,SWIGTYPE_p_Xapian__BM25PlusWeight);
  }
  
  {
    try {
      result = ((Xapian::BM25PlusWeight 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_BM25PlusWeight_get_sumpart(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::BM25PlusWeight *arg1 = (Xapian::BM25PlusWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  Xapian::termcount arg4 ;
  double result;
  
  SWIG_check_num_args("Xapian::BM25PlusWeight::get_sumpart",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::BM25PlusWeight::get_sumpart",1,"Xapian::BM25PlusWeight const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::BM25PlusWeight::get_sumpart",2,"Xapian::termcount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::BM25PlusWeight::get_sumpart",3,"Xapian::termcount");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::BM25PlusWeight::get_sumpart",4,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__BM25PlusWeight,0))){
    SWIG_fail_ptr("BM25PlusWeight_get_sumpart",1,SWIGTYPE_p_Xapian__BM25PlusWeight);
  }
  
  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);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (Xapian::termcount)lua_tonumber(L, 4);
  {
    try {
      result = (double)((Xapian::BM25PlusWeight const *)arg1)->get_sumpart(arg2,arg3,arg4);
    } 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_BM25PlusWeight_get_maxpart(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::BM25PlusWeight *arg1 = (Xapian::BM25PlusWeight *) 0 ;
  double result;
  
  SWIG_check_num_args("Xapian::BM25PlusWeight::get_maxpart",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::BM25PlusWeight::get_maxpart",1,"Xapian::BM25PlusWeight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__BM25PlusWeight,0))){
    SWIG_fail_ptr("BM25PlusWeight_get_maxpart",1,SWIGTYPE_p_Xapian__BM25PlusWeight);
  }
  
  {
    try {
      result = (double)((Xapian::BM25PlusWeight 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_BM25PlusWeight_get_sumextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::BM25PlusWeight *arg1 = (Xapian::BM25PlusWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  double result;
  
  SWIG_check_num_args("Xapian::BM25PlusWeight::get_sumextra",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::BM25PlusWeight::get_sumextra",1,"Xapian::BM25PlusWeight const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::BM25PlusWeight::get_sumextra",2,"Xapian::termcount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::BM25PlusWeight::get_sumextra",3,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__BM25PlusWeight,0))){
    SWIG_fail_ptr("BM25PlusWeight_get_sumextra",1,SWIGTYPE_p_Xapian__BM25PlusWeight);
  }
  
  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 = (double)((Xapian::BM25PlusWeight const *)arg1)->get_sumextra(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_BM25PlusWeight_get_maxextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::BM25PlusWeight *arg1 = (Xapian::BM25PlusWeight *) 0 ;
  double result;
  
  SWIG_check_num_args("Xapian::BM25PlusWeight::get_maxextra",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::BM25PlusWeight::get_maxextra",1,"Xapian::BM25PlusWeight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__BM25PlusWeight,0))){
    SWIG_fail_ptr("BM25PlusWeight_get_maxextra",1,SWIGTYPE_p_Xapian__BM25PlusWeight);
  }
  
  {
    try {
      result = (double)((Xapian::BM25PlusWeight 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_BM25PlusWeight(void *obj) {
Xapian::BM25PlusWeight *arg1 = (Xapian::BM25PlusWeight *) obj;
delete arg1;
}
static int _proxy__wrap_new_BM25PlusWeight(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_BM25PlusWeight);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_BM25PlusWeight_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_BM25PlusWeight_methods[]= {
    { "name", _wrap_BM25PlusWeight_name},
    { "get_sumpart", _wrap_BM25PlusWeight_get_sumpart},
    { "get_maxpart", _wrap_BM25PlusWeight_get_maxpart},
    { "get_sumextra", _wrap_BM25PlusWeight_get_sumextra},
    { "get_maxextra", _wrap_BM25PlusWeight_get_maxextra},
    {0,0}
};
static swig_lua_method swig_BM25PlusWeight_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_BM25PlusWeight_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_BM25PlusWeight_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_BM25PlusWeight_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_BM25PlusWeight_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_BM25PlusWeight_Sf_SwigStatic = {
    "BM25PlusWeight",
    swig_BM25PlusWeight_Sf_SwigStatic_methods,
    swig_BM25PlusWeight_Sf_SwigStatic_attributes,
    swig_BM25PlusWeight_Sf_SwigStatic_constants,
    swig_BM25PlusWeight_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_BM25PlusWeight_bases[] = {0,0};
static const char *swig_BM25PlusWeight_base_names[] = {"Xapian::Weight *",0};
static swig_lua_class _wrap_class_BM25PlusWeight = { "BM25PlusWeight", "BM25PlusWeight", &SWIGTYPE_p_Xapian__BM25PlusWeight,_proxy__wrap_new_BM25PlusWeight, swig_delete_BM25PlusWeight, swig_BM25PlusWeight_methods, swig_BM25PlusWeight_attributes, &swig_BM25PlusWeight_Sf_SwigStatic, swig_BM25PlusWeight_meta, swig_BM25PlusWeight_bases, swig_BM25PlusWeight_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);
    }
  }
  
  SWIG_Lua_pusherrstring(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::termcount arg4 ;
  double result;
  
  SWIG_check_num_args("Xapian::TradWeight::get_sumpart",4,4)
  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(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::TradWeight::get_sumpart",4,"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);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (Xapian::termcount)lua_tonumber(L, 4);
  {
    try {
      result = (double)((Xapian::TradWeight const *)arg1)->get_sumpart(arg2,arg3,arg4);
    } 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 ;
  double 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 = (double)((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::termcount arg3 ;
  double result;
  
  SWIG_check_num_args("Xapian::TradWeight::get_sumextra",3,3)
  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(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::TradWeight::get_sumextra",3,"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);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (Xapian::termcount)lua_tonumber(L, 3);
  {
    try {
      result = (double)((Xapian::TradWeight const *)arg1)->get_sumextra(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_maxextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  double 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 = (double)((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 int _proxy__wrap_new_TradWeight(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_TradWeight);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_TradWeight_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_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_method swig_TradWeight_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_TradWeight_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_TradWeight_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_TradWeight_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_TradWeight_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_TradWeight_Sf_SwigStatic = {
    "TradWeight",
    swig_TradWeight_Sf_SwigStatic_methods,
    swig_TradWeight_Sf_SwigStatic_attributes,
    swig_TradWeight_Sf_SwigStatic_constants,
    swig_TradWeight_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_TradWeight_bases[] = {0,0};
static const char *swig_TradWeight_base_names[] = {"Xapian::Weight *",0};
static swig_lua_class _wrap_class_TradWeight = { "TradWeight", "TradWeight", &SWIGTYPE_p_Xapian__TradWeight,_proxy__wrap_new_TradWeight, swig_delete_TradWeight, swig_TradWeight_methods, swig_TradWeight_attributes, &swig_TradWeight_Sf_SwigStatic, swig_TradWeight_meta, swig_TradWeight_bases, swig_TradWeight_base_names };

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


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


static int _wrap_new_InL2Weight(lua_State* L) {
  int argc;
  int argv[2]={
    1,2
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_InL2Weight__SWIG_1(L);
  }
  if (argc == 1) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_InL2Weight__SWIG_0(L);
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_InL2Weight'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::InL2Weight::InL2Weight(double)\n"
    "    Xapian::InL2Weight::InL2Weight()\n");
  lua_error(L);return 0;
}


static int _wrap_InL2Weight_name(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::InL2Weight *arg1 = (Xapian::InL2Weight *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::InL2Weight::name",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::InL2Weight::name",1,"Xapian::InL2Weight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__InL2Weight,0))){
    SWIG_fail_ptr("InL2Weight_name",1,SWIGTYPE_p_Xapian__InL2Weight);
  }
  
  {
    try {
      result = ((Xapian::InL2Weight 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_InL2Weight_get_sumpart(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::InL2Weight *arg1 = (Xapian::InL2Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  Xapian::termcount arg4 ;
  double result;
  
  SWIG_check_num_args("Xapian::InL2Weight::get_sumpart",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::InL2Weight::get_sumpart",1,"Xapian::InL2Weight const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::InL2Weight::get_sumpart",2,"Xapian::termcount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::InL2Weight::get_sumpart",3,"Xapian::termcount");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::InL2Weight::get_sumpart",4,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__InL2Weight,0))){
    SWIG_fail_ptr("InL2Weight_get_sumpart",1,SWIGTYPE_p_Xapian__InL2Weight);
  }
  
  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);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (Xapian::termcount)lua_tonumber(L, 4);
  {
    try {
      result = (double)((Xapian::InL2Weight const *)arg1)->get_sumpart(arg2,arg3,arg4);
    } 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_InL2Weight_get_maxpart(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::InL2Weight *arg1 = (Xapian::InL2Weight *) 0 ;
  double result;
  
  SWIG_check_num_args("Xapian::InL2Weight::get_maxpart",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::InL2Weight::get_maxpart",1,"Xapian::InL2Weight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__InL2Weight,0))){
    SWIG_fail_ptr("InL2Weight_get_maxpart",1,SWIGTYPE_p_Xapian__InL2Weight);
  }
  
  {
    try {
      result = (double)((Xapian::InL2Weight 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_InL2Weight_get_sumextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::InL2Weight *arg1 = (Xapian::InL2Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  double result;
  
  SWIG_check_num_args("Xapian::InL2Weight::get_sumextra",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::InL2Weight::get_sumextra",1,"Xapian::InL2Weight const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::InL2Weight::get_sumextra",2,"Xapian::termcount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::InL2Weight::get_sumextra",3,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__InL2Weight,0))){
    SWIG_fail_ptr("InL2Weight_get_sumextra",1,SWIGTYPE_p_Xapian__InL2Weight);
  }
  
  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 = (double)((Xapian::InL2Weight const *)arg1)->get_sumextra(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_InL2Weight_get_maxextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::InL2Weight *arg1 = (Xapian::InL2Weight *) 0 ;
  double result;
  
  SWIG_check_num_args("Xapian::InL2Weight::get_maxextra",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::InL2Weight::get_maxextra",1,"Xapian::InL2Weight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__InL2Weight,0))){
    SWIG_fail_ptr("InL2Weight_get_maxextra",1,SWIGTYPE_p_Xapian__InL2Weight);
  }
  
  {
    try {
      result = (double)((Xapian::InL2Weight 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_InL2Weight(void *obj) {
Xapian::InL2Weight *arg1 = (Xapian::InL2Weight *) obj;
delete arg1;
}
static int _proxy__wrap_new_InL2Weight(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_InL2Weight);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_InL2Weight_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_InL2Weight_methods[]= {
    { "name", _wrap_InL2Weight_name},
    { "get_sumpart", _wrap_InL2Weight_get_sumpart},
    { "get_maxpart", _wrap_InL2Weight_get_maxpart},
    { "get_sumextra", _wrap_InL2Weight_get_sumextra},
    { "get_maxextra", _wrap_InL2Weight_get_maxextra},
    {0,0}
};
static swig_lua_method swig_InL2Weight_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_InL2Weight_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_InL2Weight_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_InL2Weight_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_InL2Weight_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_InL2Weight_Sf_SwigStatic = {
    "InL2Weight",
    swig_InL2Weight_Sf_SwigStatic_methods,
    swig_InL2Weight_Sf_SwigStatic_attributes,
    swig_InL2Weight_Sf_SwigStatic_constants,
    swig_InL2Weight_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_InL2Weight_bases[] = {0,0};
static const char *swig_InL2Weight_base_names[] = {"Xapian::Weight *",0};
static swig_lua_class _wrap_class_InL2Weight = { "InL2Weight", "InL2Weight", &SWIGTYPE_p_Xapian__InL2Weight,_proxy__wrap_new_InL2Weight, swig_delete_InL2Weight, swig_InL2Weight_methods, swig_InL2Weight_attributes, &swig_InL2Weight_Sf_SwigStatic, swig_InL2Weight_meta, swig_InL2Weight_bases, swig_InL2Weight_base_names };

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


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


static int _wrap_new_IfB2Weight(lua_State* L) {
  int argc;
  int argv[2]={
    1,2
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_IfB2Weight__SWIG_1(L);
  }
  if (argc == 1) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_IfB2Weight__SWIG_0(L);
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_IfB2Weight'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::IfB2Weight::IfB2Weight(double)\n"
    "    Xapian::IfB2Weight::IfB2Weight()\n");
  lua_error(L);return 0;
}


static int _wrap_IfB2Weight_name(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::IfB2Weight *arg1 = (Xapian::IfB2Weight *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::IfB2Weight::name",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::IfB2Weight::name",1,"Xapian::IfB2Weight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__IfB2Weight,0))){
    SWIG_fail_ptr("IfB2Weight_name",1,SWIGTYPE_p_Xapian__IfB2Weight);
  }
  
  {
    try {
      result = ((Xapian::IfB2Weight 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_IfB2Weight_get_sumpart(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::IfB2Weight *arg1 = (Xapian::IfB2Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  Xapian::termcount arg4 ;
  double result;
  
  SWIG_check_num_args("Xapian::IfB2Weight::get_sumpart",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::IfB2Weight::get_sumpart",1,"Xapian::IfB2Weight const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::IfB2Weight::get_sumpart",2,"Xapian::termcount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::IfB2Weight::get_sumpart",3,"Xapian::termcount");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::IfB2Weight::get_sumpart",4,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__IfB2Weight,0))){
    SWIG_fail_ptr("IfB2Weight_get_sumpart",1,SWIGTYPE_p_Xapian__IfB2Weight);
  }
  
  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);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (Xapian::termcount)lua_tonumber(L, 4);
  {
    try {
      result = (double)((Xapian::IfB2Weight const *)arg1)->get_sumpart(arg2,arg3,arg4);
    } 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_IfB2Weight_get_maxpart(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::IfB2Weight *arg1 = (Xapian::IfB2Weight *) 0 ;
  double result;
  
  SWIG_check_num_args("Xapian::IfB2Weight::get_maxpart",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::IfB2Weight::get_maxpart",1,"Xapian::IfB2Weight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__IfB2Weight,0))){
    SWIG_fail_ptr("IfB2Weight_get_maxpart",1,SWIGTYPE_p_Xapian__IfB2Weight);
  }
  
  {
    try {
      result = (double)((Xapian::IfB2Weight 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_IfB2Weight_get_sumextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::IfB2Weight *arg1 = (Xapian::IfB2Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  double result;
  
  SWIG_check_num_args("Xapian::IfB2Weight::get_sumextra",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::IfB2Weight::get_sumextra",1,"Xapian::IfB2Weight const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::IfB2Weight::get_sumextra",2,"Xapian::termcount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::IfB2Weight::get_sumextra",3,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__IfB2Weight,0))){
    SWIG_fail_ptr("IfB2Weight_get_sumextra",1,SWIGTYPE_p_Xapian__IfB2Weight);
  }
  
  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 = (double)((Xapian::IfB2Weight const *)arg1)->get_sumextra(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_IfB2Weight_get_maxextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::IfB2Weight *arg1 = (Xapian::IfB2Weight *) 0 ;
  double result;
  
  SWIG_check_num_args("Xapian::IfB2Weight::get_maxextra",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::IfB2Weight::get_maxextra",1,"Xapian::IfB2Weight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__IfB2Weight,0))){
    SWIG_fail_ptr("IfB2Weight_get_maxextra",1,SWIGTYPE_p_Xapian__IfB2Weight);
  }
  
  {
    try {
      result = (double)((Xapian::IfB2Weight 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_IfB2Weight(void *obj) {
Xapian::IfB2Weight *arg1 = (Xapian::IfB2Weight *) obj;
delete arg1;
}
static int _proxy__wrap_new_IfB2Weight(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_IfB2Weight);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_IfB2Weight_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_IfB2Weight_methods[]= {
    { "name", _wrap_IfB2Weight_name},
    { "get_sumpart", _wrap_IfB2Weight_get_sumpart},
    { "get_maxpart", _wrap_IfB2Weight_get_maxpart},
    { "get_sumextra", _wrap_IfB2Weight_get_sumextra},
    { "get_maxextra", _wrap_IfB2Weight_get_maxextra},
    {0,0}
};
static swig_lua_method swig_IfB2Weight_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_IfB2Weight_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_IfB2Weight_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_IfB2Weight_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_IfB2Weight_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_IfB2Weight_Sf_SwigStatic = {
    "IfB2Weight",
    swig_IfB2Weight_Sf_SwigStatic_methods,
    swig_IfB2Weight_Sf_SwigStatic_attributes,
    swig_IfB2Weight_Sf_SwigStatic_constants,
    swig_IfB2Weight_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_IfB2Weight_bases[] = {0,0};
static const char *swig_IfB2Weight_base_names[] = {"Xapian::Weight *",0};
static swig_lua_class _wrap_class_IfB2Weight = { "IfB2Weight", "IfB2Weight", &SWIGTYPE_p_Xapian__IfB2Weight,_proxy__wrap_new_IfB2Weight, swig_delete_IfB2Weight, swig_IfB2Weight_methods, swig_IfB2Weight_attributes, &swig_IfB2Weight_Sf_SwigStatic, swig_IfB2Weight_meta, swig_IfB2Weight_bases, swig_IfB2Weight_base_names };

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


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


static int _wrap_new_IneB2Weight(lua_State* L) {
  int argc;
  int argv[2]={
    1,2
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_IneB2Weight__SWIG_1(L);
  }
  if (argc == 1) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_IneB2Weight__SWIG_0(L);
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_IneB2Weight'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::IneB2Weight::IneB2Weight(double)\n"
    "    Xapian::IneB2Weight::IneB2Weight()\n");
  lua_error(L);return 0;
}


static int _wrap_IneB2Weight_name(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::IneB2Weight *arg1 = (Xapian::IneB2Weight *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::IneB2Weight::name",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::IneB2Weight::name",1,"Xapian::IneB2Weight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__IneB2Weight,0))){
    SWIG_fail_ptr("IneB2Weight_name",1,SWIGTYPE_p_Xapian__IneB2Weight);
  }
  
  {
    try {
      result = ((Xapian::IneB2Weight 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_IneB2Weight_get_sumpart(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::IneB2Weight *arg1 = (Xapian::IneB2Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  Xapian::termcount arg4 ;
  double result;
  
  SWIG_check_num_args("Xapian::IneB2Weight::get_sumpart",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::IneB2Weight::get_sumpart",1,"Xapian::IneB2Weight const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::IneB2Weight::get_sumpart",2,"Xapian::termcount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::IneB2Weight::get_sumpart",3,"Xapian::termcount");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::IneB2Weight::get_sumpart",4,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__IneB2Weight,0))){
    SWIG_fail_ptr("IneB2Weight_get_sumpart",1,SWIGTYPE_p_Xapian__IneB2Weight);
  }
  
  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);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (Xapian::termcount)lua_tonumber(L, 4);
  {
    try {
      result = (double)((Xapian::IneB2Weight const *)arg1)->get_sumpart(arg2,arg3,arg4);
    } 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_IneB2Weight_get_maxpart(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::IneB2Weight *arg1 = (Xapian::IneB2Weight *) 0 ;
  double result;
  
  SWIG_check_num_args("Xapian::IneB2Weight::get_maxpart",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::IneB2Weight::get_maxpart",1,"Xapian::IneB2Weight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__IneB2Weight,0))){
    SWIG_fail_ptr("IneB2Weight_get_maxpart",1,SWIGTYPE_p_Xapian__IneB2Weight);
  }
  
  {
    try {
      result = (double)((Xapian::IneB2Weight 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_IneB2Weight_get_sumextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::IneB2Weight *arg1 = (Xapian::IneB2Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  double result;
  
  SWIG_check_num_args("Xapian::IneB2Weight::get_sumextra",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::IneB2Weight::get_sumextra",1,"Xapian::IneB2Weight const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::IneB2Weight::get_sumextra",2,"Xapian::termcount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::IneB2Weight::get_sumextra",3,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__IneB2Weight,0))){
    SWIG_fail_ptr("IneB2Weight_get_sumextra",1,SWIGTYPE_p_Xapian__IneB2Weight);
  }
  
  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 = (double)((Xapian::IneB2Weight const *)arg1)->get_sumextra(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_IneB2Weight_get_maxextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::IneB2Weight *arg1 = (Xapian::IneB2Weight *) 0 ;
  double result;
  
  SWIG_check_num_args("Xapian::IneB2Weight::get_maxextra",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::IneB2Weight::get_maxextra",1,"Xapian::IneB2Weight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__IneB2Weight,0))){
    SWIG_fail_ptr("IneB2Weight_get_maxextra",1,SWIGTYPE_p_Xapian__IneB2Weight);
  }
  
  {
    try {
      result = (double)((Xapian::IneB2Weight 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_IneB2Weight(void *obj) {
Xapian::IneB2Weight *arg1 = (Xapian::IneB2Weight *) obj;
delete arg1;
}
static int _proxy__wrap_new_IneB2Weight(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_IneB2Weight);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_IneB2Weight_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_IneB2Weight_methods[]= {
    { "name", _wrap_IneB2Weight_name},
    { "get_sumpart", _wrap_IneB2Weight_get_sumpart},
    { "get_maxpart", _wrap_IneB2Weight_get_maxpart},
    { "get_sumextra", _wrap_IneB2Weight_get_sumextra},
    { "get_maxextra", _wrap_IneB2Weight_get_maxextra},
    {0,0}
};
static swig_lua_method swig_IneB2Weight_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_IneB2Weight_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_IneB2Weight_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_IneB2Weight_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_IneB2Weight_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_IneB2Weight_Sf_SwigStatic = {
    "IneB2Weight",
    swig_IneB2Weight_Sf_SwigStatic_methods,
    swig_IneB2Weight_Sf_SwigStatic_attributes,
    swig_IneB2Weight_Sf_SwigStatic_constants,
    swig_IneB2Weight_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_IneB2Weight_bases[] = {0,0};
static const char *swig_IneB2Weight_base_names[] = {"Xapian::Weight *",0};
static swig_lua_class _wrap_class_IneB2Weight = { "IneB2Weight", "IneB2Weight", &SWIGTYPE_p_Xapian__IneB2Weight,_proxy__wrap_new_IneB2Weight, swig_delete_IneB2Weight, swig_IneB2Weight_methods, swig_IneB2Weight_attributes, &swig_IneB2Weight_Sf_SwigStatic, swig_IneB2Weight_meta, swig_IneB2Weight_bases, swig_IneB2Weight_base_names };

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


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


static int _wrap_new_BB2Weight(lua_State* L) {
  int argc;
  int argv[2]={
    1,2
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_BB2Weight__SWIG_1(L);
  }
  if (argc == 1) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_BB2Weight__SWIG_0(L);
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_BB2Weight'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::BB2Weight::BB2Weight(double)\n"
    "    Xapian::BB2Weight::BB2Weight()\n");
  lua_error(L);return 0;
}


static int _wrap_BB2Weight_name(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::BB2Weight *arg1 = (Xapian::BB2Weight *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::BB2Weight::name",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::BB2Weight::name",1,"Xapian::BB2Weight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__BB2Weight,0))){
    SWIG_fail_ptr("BB2Weight_name",1,SWIGTYPE_p_Xapian__BB2Weight);
  }
  
  {
    try {
      result = ((Xapian::BB2Weight 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_BB2Weight_get_sumpart(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::BB2Weight *arg1 = (Xapian::BB2Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  Xapian::termcount arg4 ;
  double result;
  
  SWIG_check_num_args("Xapian::BB2Weight::get_sumpart",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::BB2Weight::get_sumpart",1,"Xapian::BB2Weight const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::BB2Weight::get_sumpart",2,"Xapian::termcount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::BB2Weight::get_sumpart",3,"Xapian::termcount");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::BB2Weight::get_sumpart",4,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__BB2Weight,0))){
    SWIG_fail_ptr("BB2Weight_get_sumpart",1,SWIGTYPE_p_Xapian__BB2Weight);
  }
  
  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);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (Xapian::termcount)lua_tonumber(L, 4);
  {
    try {
      result = (double)((Xapian::BB2Weight const *)arg1)->get_sumpart(arg2,arg3,arg4);
    } 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_BB2Weight_get_maxpart(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::BB2Weight *arg1 = (Xapian::BB2Weight *) 0 ;
  double result;
  
  SWIG_check_num_args("Xapian::BB2Weight::get_maxpart",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::BB2Weight::get_maxpart",1,"Xapian::BB2Weight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__BB2Weight,0))){
    SWIG_fail_ptr("BB2Weight_get_maxpart",1,SWIGTYPE_p_Xapian__BB2Weight);
  }
  
  {
    try {
      result = (double)((Xapian::BB2Weight 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_BB2Weight_get_sumextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::BB2Weight *arg1 = (Xapian::BB2Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  double result;
  
  SWIG_check_num_args("Xapian::BB2Weight::get_sumextra",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::BB2Weight::get_sumextra",1,"Xapian::BB2Weight const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::BB2Weight::get_sumextra",2,"Xapian::termcount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::BB2Weight::get_sumextra",3,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__BB2Weight,0))){
    SWIG_fail_ptr("BB2Weight_get_sumextra",1,SWIGTYPE_p_Xapian__BB2Weight);
  }
  
  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 = (double)((Xapian::BB2Weight const *)arg1)->get_sumextra(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_BB2Weight_get_maxextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::BB2Weight *arg1 = (Xapian::BB2Weight *) 0 ;
  double result;
  
  SWIG_check_num_args("Xapian::BB2Weight::get_maxextra",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::BB2Weight::get_maxextra",1,"Xapian::BB2Weight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__BB2Weight,0))){
    SWIG_fail_ptr("BB2Weight_get_maxextra",1,SWIGTYPE_p_Xapian__BB2Weight);
  }
  
  {
    try {
      result = (double)((Xapian::BB2Weight 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_BB2Weight(void *obj) {
Xapian::BB2Weight *arg1 = (Xapian::BB2Weight *) obj;
delete arg1;
}
static int _proxy__wrap_new_BB2Weight(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_BB2Weight);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_BB2Weight_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_BB2Weight_methods[]= {
    { "name", _wrap_BB2Weight_name},
    { "get_sumpart", _wrap_BB2Weight_get_sumpart},
    { "get_maxpart", _wrap_BB2Weight_get_maxpart},
    { "get_sumextra", _wrap_BB2Weight_get_sumextra},
    { "get_maxextra", _wrap_BB2Weight_get_maxextra},
    {0,0}
};
static swig_lua_method swig_BB2Weight_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_BB2Weight_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_BB2Weight_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_BB2Weight_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_BB2Weight_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_BB2Weight_Sf_SwigStatic = {
    "BB2Weight",
    swig_BB2Weight_Sf_SwigStatic_methods,
    swig_BB2Weight_Sf_SwigStatic_attributes,
    swig_BB2Weight_Sf_SwigStatic_constants,
    swig_BB2Weight_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_BB2Weight_bases[] = {0,0};
static const char *swig_BB2Weight_base_names[] = {"Xapian::Weight *",0};
static swig_lua_class _wrap_class_BB2Weight = { "BB2Weight", "BB2Weight", &SWIGTYPE_p_Xapian__BB2Weight,_proxy__wrap_new_BB2Weight, swig_delete_BB2Weight, swig_BB2Weight_methods, swig_BB2Weight_attributes, &swig_BB2Weight_Sf_SwigStatic, swig_BB2Weight_meta, swig_BB2Weight_bases, swig_BB2Weight_base_names };

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


static int _wrap_DLHWeight_name(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::DLHWeight *arg1 = (Xapian::DLHWeight *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::DLHWeight::name",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::DLHWeight::name",1,"Xapian::DLHWeight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__DLHWeight,0))){
    SWIG_fail_ptr("DLHWeight_name",1,SWIGTYPE_p_Xapian__DLHWeight);
  }
  
  {
    try {
      result = ((Xapian::DLHWeight 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_DLHWeight_get_sumpart(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::DLHWeight *arg1 = (Xapian::DLHWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  Xapian::termcount arg4 ;
  double result;
  
  SWIG_check_num_args("Xapian::DLHWeight::get_sumpart",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::DLHWeight::get_sumpart",1,"Xapian::DLHWeight const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::DLHWeight::get_sumpart",2,"Xapian::termcount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::DLHWeight::get_sumpart",3,"Xapian::termcount");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::DLHWeight::get_sumpart",4,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__DLHWeight,0))){
    SWIG_fail_ptr("DLHWeight_get_sumpart",1,SWIGTYPE_p_Xapian__DLHWeight);
  }
  
  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);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (Xapian::termcount)lua_tonumber(L, 4);
  {
    try {
      result = (double)((Xapian::DLHWeight const *)arg1)->get_sumpart(arg2,arg3,arg4);
    } 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_DLHWeight_get_maxpart(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::DLHWeight *arg1 = (Xapian::DLHWeight *) 0 ;
  double result;
  
  SWIG_check_num_args("Xapian::DLHWeight::get_maxpart",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::DLHWeight::get_maxpart",1,"Xapian::DLHWeight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__DLHWeight,0))){
    SWIG_fail_ptr("DLHWeight_get_maxpart",1,SWIGTYPE_p_Xapian__DLHWeight);
  }
  
  {
    try {
      result = (double)((Xapian::DLHWeight 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_DLHWeight_get_sumextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::DLHWeight *arg1 = (Xapian::DLHWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  double result;
  
  SWIG_check_num_args("Xapian::DLHWeight::get_sumextra",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::DLHWeight::get_sumextra",1,"Xapian::DLHWeight const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::DLHWeight::get_sumextra",2,"Xapian::termcount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::DLHWeight::get_sumextra",3,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__DLHWeight,0))){
    SWIG_fail_ptr("DLHWeight_get_sumextra",1,SWIGTYPE_p_Xapian__DLHWeight);
  }
  
  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 = (double)((Xapian::DLHWeight const *)arg1)->get_sumextra(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_DLHWeight_get_maxextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::DLHWeight *arg1 = (Xapian::DLHWeight *) 0 ;
  double result;
  
  SWIG_check_num_args("Xapian::DLHWeight::get_maxextra",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::DLHWeight::get_maxextra",1,"Xapian::DLHWeight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__DLHWeight,0))){
    SWIG_fail_ptr("DLHWeight_get_maxextra",1,SWIGTYPE_p_Xapian__DLHWeight);
  }
  
  {
    try {
      result = (double)((Xapian::DLHWeight 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_DLHWeight(void *obj) {
Xapian::DLHWeight *arg1 = (Xapian::DLHWeight *) obj;
delete arg1;
}
static int _proxy__wrap_new_DLHWeight(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_DLHWeight);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_DLHWeight_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_DLHWeight_methods[]= {
    { "name", _wrap_DLHWeight_name},
    { "get_sumpart", _wrap_DLHWeight_get_sumpart},
    { "get_maxpart", _wrap_DLHWeight_get_maxpart},
    { "get_sumextra", _wrap_DLHWeight_get_sumextra},
    { "get_maxextra", _wrap_DLHWeight_get_maxextra},
    {0,0}
};
static swig_lua_method swig_DLHWeight_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_DLHWeight_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_DLHWeight_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_DLHWeight_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_DLHWeight_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_DLHWeight_Sf_SwigStatic = {
    "DLHWeight",
    swig_DLHWeight_Sf_SwigStatic_methods,
    swig_DLHWeight_Sf_SwigStatic_attributes,
    swig_DLHWeight_Sf_SwigStatic_constants,
    swig_DLHWeight_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_DLHWeight_bases[] = {0,0};
static const char *swig_DLHWeight_base_names[] = {"Xapian::Weight *",0};
static swig_lua_class _wrap_class_DLHWeight = { "DLHWeight", "DLHWeight", &SWIGTYPE_p_Xapian__DLHWeight,_proxy__wrap_new_DLHWeight, swig_delete_DLHWeight, swig_DLHWeight_methods, swig_DLHWeight_attributes, &swig_DLHWeight_Sf_SwigStatic, swig_DLHWeight_meta, swig_DLHWeight_bases, swig_DLHWeight_base_names };

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


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


static int _wrap_new_PL2Weight(lua_State* L) {
  int argc;
  int argv[2]={
    1,2
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_PL2Weight__SWIG_1(L);
  }
  if (argc == 1) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_PL2Weight__SWIG_0(L);
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_PL2Weight'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::PL2Weight::PL2Weight(double)\n"
    "    Xapian::PL2Weight::PL2Weight()\n");
  lua_error(L);return 0;
}


static int _wrap_PL2Weight_name(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PL2Weight *arg1 = (Xapian::PL2Weight *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::PL2Weight::name",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PL2Weight::name",1,"Xapian::PL2Weight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PL2Weight,0))){
    SWIG_fail_ptr("PL2Weight_name",1,SWIGTYPE_p_Xapian__PL2Weight);
  }
  
  {
    try {
      result = ((Xapian::PL2Weight 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_PL2Weight_get_sumpart(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PL2Weight *arg1 = (Xapian::PL2Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  Xapian::termcount arg4 ;
  double result;
  
  SWIG_check_num_args("Xapian::PL2Weight::get_sumpart",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PL2Weight::get_sumpart",1,"Xapian::PL2Weight const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::PL2Weight::get_sumpart",2,"Xapian::termcount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::PL2Weight::get_sumpart",3,"Xapian::termcount");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::PL2Weight::get_sumpart",4,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PL2Weight,0))){
    SWIG_fail_ptr("PL2Weight_get_sumpart",1,SWIGTYPE_p_Xapian__PL2Weight);
  }
  
  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);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (Xapian::termcount)lua_tonumber(L, 4);
  {
    try {
      result = (double)((Xapian::PL2Weight const *)arg1)->get_sumpart(arg2,arg3,arg4);
    } 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_PL2Weight_get_maxpart(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PL2Weight *arg1 = (Xapian::PL2Weight *) 0 ;
  double result;
  
  SWIG_check_num_args("Xapian::PL2Weight::get_maxpart",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PL2Weight::get_maxpart",1,"Xapian::PL2Weight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PL2Weight,0))){
    SWIG_fail_ptr("PL2Weight_get_maxpart",1,SWIGTYPE_p_Xapian__PL2Weight);
  }
  
  {
    try {
      result = (double)((Xapian::PL2Weight 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_PL2Weight_get_sumextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PL2Weight *arg1 = (Xapian::PL2Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  double result;
  
  SWIG_check_num_args("Xapian::PL2Weight::get_sumextra",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PL2Weight::get_sumextra",1,"Xapian::PL2Weight const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::PL2Weight::get_sumextra",2,"Xapian::termcount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::PL2Weight::get_sumextra",3,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PL2Weight,0))){
    SWIG_fail_ptr("PL2Weight_get_sumextra",1,SWIGTYPE_p_Xapian__PL2Weight);
  }
  
  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 = (double)((Xapian::PL2Weight const *)arg1)->get_sumextra(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_PL2Weight_get_maxextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PL2Weight *arg1 = (Xapian::PL2Weight *) 0 ;
  double result;
  
  SWIG_check_num_args("Xapian::PL2Weight::get_maxextra",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PL2Weight::get_maxextra",1,"Xapian::PL2Weight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PL2Weight,0))){
    SWIG_fail_ptr("PL2Weight_get_maxextra",1,SWIGTYPE_p_Xapian__PL2Weight);
  }
  
  {
    try {
      result = (double)((Xapian::PL2Weight 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_PL2Weight(void *obj) {
Xapian::PL2Weight *arg1 = (Xapian::PL2Weight *) obj;
delete arg1;
}
static int _proxy__wrap_new_PL2Weight(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_PL2Weight);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_PL2Weight_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_PL2Weight_methods[]= {
    { "name", _wrap_PL2Weight_name},
    { "get_sumpart", _wrap_PL2Weight_get_sumpart},
    { "get_maxpart", _wrap_PL2Weight_get_maxpart},
    { "get_sumextra", _wrap_PL2Weight_get_sumextra},
    { "get_maxextra", _wrap_PL2Weight_get_maxextra},
    {0,0}
};
static swig_lua_method swig_PL2Weight_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_PL2Weight_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_PL2Weight_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_PL2Weight_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_PL2Weight_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_PL2Weight_Sf_SwigStatic = {
    "PL2Weight",
    swig_PL2Weight_Sf_SwigStatic_methods,
    swig_PL2Weight_Sf_SwigStatic_attributes,
    swig_PL2Weight_Sf_SwigStatic_constants,
    swig_PL2Weight_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_PL2Weight_bases[] = {0,0};
static const char *swig_PL2Weight_base_names[] = {"Xapian::Weight *",0};
static swig_lua_class _wrap_class_PL2Weight = { "PL2Weight", "PL2Weight", &SWIGTYPE_p_Xapian__PL2Weight,_proxy__wrap_new_PL2Weight, swig_delete_PL2Weight, swig_PL2Weight_methods, swig_PL2Weight_attributes, &swig_PL2Weight_Sf_SwigStatic, swig_PL2Weight_meta, swig_PL2Weight_bases, swig_PL2Weight_base_names };

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


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


static int _wrap_new_PL2PlusWeight(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_PL2PlusWeight__SWIG_1(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_PL2PlusWeight__SWIG_0(L);
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_PL2PlusWeight'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::PL2PlusWeight::PL2PlusWeight(double,double)\n"
    "    Xapian::PL2PlusWeight::PL2PlusWeight()\n");
  lua_error(L);return 0;
}


static int _wrap_PL2PlusWeight_name(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PL2PlusWeight *arg1 = (Xapian::PL2PlusWeight *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::PL2PlusWeight::name",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PL2PlusWeight::name",1,"Xapian::PL2PlusWeight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PL2PlusWeight,0))){
    SWIG_fail_ptr("PL2PlusWeight_name",1,SWIGTYPE_p_Xapian__PL2PlusWeight);
  }
  
  {
    try {
      result = ((Xapian::PL2PlusWeight 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_PL2PlusWeight_get_sumpart(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PL2PlusWeight *arg1 = (Xapian::PL2PlusWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  Xapian::termcount arg4 ;
  double result;
  
  SWIG_check_num_args("Xapian::PL2PlusWeight::get_sumpart",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PL2PlusWeight::get_sumpart",1,"Xapian::PL2PlusWeight const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::PL2PlusWeight::get_sumpart",2,"Xapian::termcount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::PL2PlusWeight::get_sumpart",3,"Xapian::termcount");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::PL2PlusWeight::get_sumpart",4,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PL2PlusWeight,0))){
    SWIG_fail_ptr("PL2PlusWeight_get_sumpart",1,SWIGTYPE_p_Xapian__PL2PlusWeight);
  }
  
  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);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (Xapian::termcount)lua_tonumber(L, 4);
  {
    try {
      result = (double)((Xapian::PL2PlusWeight const *)arg1)->get_sumpart(arg2,arg3,arg4);
    } 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_PL2PlusWeight_get_maxpart(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PL2PlusWeight *arg1 = (Xapian::PL2PlusWeight *) 0 ;
  double result;
  
  SWIG_check_num_args("Xapian::PL2PlusWeight::get_maxpart",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PL2PlusWeight::get_maxpart",1,"Xapian::PL2PlusWeight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PL2PlusWeight,0))){
    SWIG_fail_ptr("PL2PlusWeight_get_maxpart",1,SWIGTYPE_p_Xapian__PL2PlusWeight);
  }
  
  {
    try {
      result = (double)((Xapian::PL2PlusWeight 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_PL2PlusWeight_get_sumextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PL2PlusWeight *arg1 = (Xapian::PL2PlusWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  double result;
  
  SWIG_check_num_args("Xapian::PL2PlusWeight::get_sumextra",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PL2PlusWeight::get_sumextra",1,"Xapian::PL2PlusWeight const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::PL2PlusWeight::get_sumextra",2,"Xapian::termcount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::PL2PlusWeight::get_sumextra",3,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PL2PlusWeight,0))){
    SWIG_fail_ptr("PL2PlusWeight_get_sumextra",1,SWIGTYPE_p_Xapian__PL2PlusWeight);
  }
  
  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 = (double)((Xapian::PL2PlusWeight const *)arg1)->get_sumextra(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_PL2PlusWeight_get_maxextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PL2PlusWeight *arg1 = (Xapian::PL2PlusWeight *) 0 ;
  double result;
  
  SWIG_check_num_args("Xapian::PL2PlusWeight::get_maxextra",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PL2PlusWeight::get_maxextra",1,"Xapian::PL2PlusWeight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PL2PlusWeight,0))){
    SWIG_fail_ptr("PL2PlusWeight_get_maxextra",1,SWIGTYPE_p_Xapian__PL2PlusWeight);
  }
  
  {
    try {
      result = (double)((Xapian::PL2PlusWeight 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_PL2PlusWeight(void *obj) {
Xapian::PL2PlusWeight *arg1 = (Xapian::PL2PlusWeight *) obj;
delete arg1;
}
static int _proxy__wrap_new_PL2PlusWeight(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_PL2PlusWeight);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_PL2PlusWeight_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_PL2PlusWeight_methods[]= {
    { "name", _wrap_PL2PlusWeight_name},
    { "get_sumpart", _wrap_PL2PlusWeight_get_sumpart},
    { "get_maxpart", _wrap_PL2PlusWeight_get_maxpart},
    { "get_sumextra", _wrap_PL2PlusWeight_get_sumextra},
    { "get_maxextra", _wrap_PL2PlusWeight_get_maxextra},
    {0,0}
};
static swig_lua_method swig_PL2PlusWeight_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_PL2PlusWeight_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_PL2PlusWeight_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_PL2PlusWeight_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_PL2PlusWeight_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_PL2PlusWeight_Sf_SwigStatic = {
    "PL2PlusWeight",
    swig_PL2PlusWeight_Sf_SwigStatic_methods,
    swig_PL2PlusWeight_Sf_SwigStatic_attributes,
    swig_PL2PlusWeight_Sf_SwigStatic_constants,
    swig_PL2PlusWeight_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_PL2PlusWeight_bases[] = {0,0};
static const char *swig_PL2PlusWeight_base_names[] = {"Xapian::Weight *",0};
static swig_lua_class _wrap_class_PL2PlusWeight = { "PL2PlusWeight", "PL2PlusWeight", &SWIGTYPE_p_Xapian__PL2PlusWeight,_proxy__wrap_new_PL2PlusWeight, swig_delete_PL2PlusWeight, swig_PL2PlusWeight_methods, swig_PL2PlusWeight_attributes, &swig_PL2PlusWeight_Sf_SwigStatic, swig_PL2PlusWeight_meta, swig_PL2PlusWeight_bases, swig_PL2PlusWeight_base_names };

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


static int _wrap_DPHWeight_name(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::DPHWeight *arg1 = (Xapian::DPHWeight *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::DPHWeight::name",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::DPHWeight::name",1,"Xapian::DPHWeight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__DPHWeight,0))){
    SWIG_fail_ptr("DPHWeight_name",1,SWIGTYPE_p_Xapian__DPHWeight);
  }
  
  {
    try {
      result = ((Xapian::DPHWeight 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_DPHWeight_get_sumpart(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::DPHWeight *arg1 = (Xapian::DPHWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  Xapian::termcount arg4 ;
  double result;
  
  SWIG_check_num_args("Xapian::DPHWeight::get_sumpart",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::DPHWeight::get_sumpart",1,"Xapian::DPHWeight const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::DPHWeight::get_sumpart",2,"Xapian::termcount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::DPHWeight::get_sumpart",3,"Xapian::termcount");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::DPHWeight::get_sumpart",4,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__DPHWeight,0))){
    SWIG_fail_ptr("DPHWeight_get_sumpart",1,SWIGTYPE_p_Xapian__DPHWeight);
  }
  
  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);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (Xapian::termcount)lua_tonumber(L, 4);
  {
    try {
      result = (double)((Xapian::DPHWeight const *)arg1)->get_sumpart(arg2,arg3,arg4);
    } 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_DPHWeight_get_maxpart(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::DPHWeight *arg1 = (Xapian::DPHWeight *) 0 ;
  double result;
  
  SWIG_check_num_args("Xapian::DPHWeight::get_maxpart",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::DPHWeight::get_maxpart",1,"Xapian::DPHWeight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__DPHWeight,0))){
    SWIG_fail_ptr("DPHWeight_get_maxpart",1,SWIGTYPE_p_Xapian__DPHWeight);
  }
  
  {
    try {
      result = (double)((Xapian::DPHWeight 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_DPHWeight_get_sumextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::DPHWeight *arg1 = (Xapian::DPHWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  double result;
  
  SWIG_check_num_args("Xapian::DPHWeight::get_sumextra",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::DPHWeight::get_sumextra",1,"Xapian::DPHWeight const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::DPHWeight::get_sumextra",2,"Xapian::termcount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::DPHWeight::get_sumextra",3,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__DPHWeight,0))){
    SWIG_fail_ptr("DPHWeight_get_sumextra",1,SWIGTYPE_p_Xapian__DPHWeight);
  }
  
  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 = (double)((Xapian::DPHWeight const *)arg1)->get_sumextra(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_DPHWeight_get_maxextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::DPHWeight *arg1 = (Xapian::DPHWeight *) 0 ;
  double result;
  
  SWIG_check_num_args("Xapian::DPHWeight::get_maxextra",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::DPHWeight::get_maxextra",1,"Xapian::DPHWeight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__DPHWeight,0))){
    SWIG_fail_ptr("DPHWeight_get_maxextra",1,SWIGTYPE_p_Xapian__DPHWeight);
  }
  
  {
    try {
      result = (double)((Xapian::DPHWeight 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_DPHWeight(void *obj) {
Xapian::DPHWeight *arg1 = (Xapian::DPHWeight *) obj;
delete arg1;
}
static int _proxy__wrap_new_DPHWeight(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_DPHWeight);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_DPHWeight_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_DPHWeight_methods[]= {
    { "name", _wrap_DPHWeight_name},
    { "get_sumpart", _wrap_DPHWeight_get_sumpart},
    { "get_maxpart", _wrap_DPHWeight_get_maxpart},
    { "get_sumextra", _wrap_DPHWeight_get_sumextra},
    { "get_maxextra", _wrap_DPHWeight_get_maxextra},
    {0,0}
};
static swig_lua_method swig_DPHWeight_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_DPHWeight_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_DPHWeight_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_DPHWeight_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_DPHWeight_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_DPHWeight_Sf_SwigStatic = {
    "DPHWeight",
    swig_DPHWeight_Sf_SwigStatic_methods,
    swig_DPHWeight_Sf_SwigStatic_attributes,
    swig_DPHWeight_Sf_SwigStatic_constants,
    swig_DPHWeight_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_DPHWeight_bases[] = {0,0};
static const char *swig_DPHWeight_base_names[] = {"Xapian::Weight *",0};
static swig_lua_class _wrap_class_DPHWeight = { "DPHWeight", "DPHWeight", &SWIGTYPE_p_Xapian__DPHWeight,_proxy__wrap_new_DPHWeight, swig_delete_DPHWeight, swig_DPHWeight_methods, swig_DPHWeight_attributes, &swig_DPHWeight_Sf_SwigStatic, swig_DPHWeight_meta, swig_DPHWeight_bases, swig_DPHWeight_base_names };

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


static int _wrap_new_LMWeight__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  double arg1 ;
  Xapian::Weight::type_smoothing arg2 ;
  double arg3 ;
  Xapian::LMWeight *result = 0 ;
  
  SWIG_check_num_args("Xapian::LMWeight::LMWeight",3,3)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::LMWeight::LMWeight",1,"double");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::LMWeight::LMWeight",2,"Xapian::Weight::type_smoothing");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::LMWeight::LMWeight",3,"double");
  arg1 = (double)lua_tonumber(L, 1);
  arg2 = (Xapian::Weight::type_smoothing)(int)lua_tonumber(L, 2);
  arg3 = (double)lua_tonumber(L, 3);
  {
    try {
      result = (Xapian::LMWeight *)new Xapian::LMWeight(arg1,arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__LMWeight,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_LMWeight__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  double arg1 ;
  Xapian::Weight::type_smoothing arg2 ;
  Xapian::LMWeight *result = 0 ;
  
  SWIG_check_num_args("Xapian::LMWeight::LMWeight",2,2)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::LMWeight::LMWeight",1,"double");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::LMWeight::LMWeight",2,"Xapian::Weight::type_smoothing");
  arg1 = (double)lua_tonumber(L, 1);
  arg2 = (Xapian::Weight::type_smoothing)(int)lua_tonumber(L, 2);
  {
    try {
      result = (Xapian::LMWeight *)new Xapian::LMWeight(arg1,arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__LMWeight,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


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


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


static int _wrap_new_LMWeight(lua_State* L) {
  int argc;
  int argv[5]={
    1,2,3,4,5
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_LMWeight__SWIG_4(L);
  }
  if (argc == 1) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_LMWeight__SWIG_3(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_LMWeight__SWIG_2(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_LMWeight__SWIG_1(L);
        }
      }
    }
  }
  if (argc == 4) {
    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) {
            return _wrap_new_LMWeight__SWIG_0(L);
          }
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_LMWeight'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::LMWeight::LMWeight(double,Xapian::Weight::type_smoothing,double,double)\n"
    "    Xapian::LMWeight::LMWeight(double,Xapian::Weight::type_smoothing,double)\n"
    "    Xapian::LMWeight::LMWeight(double,Xapian::Weight::type_smoothing)\n"
    "    Xapian::LMWeight::LMWeight(double)\n"
    "    Xapian::LMWeight::LMWeight()\n");
  lua_error(L);return 0;
}


static int _wrap_LMWeight_name(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LMWeight *arg1 = (Xapian::LMWeight *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::LMWeight::name",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LMWeight::name",1,"Xapian::LMWeight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LMWeight,0))){
    SWIG_fail_ptr("LMWeight_name",1,SWIGTYPE_p_Xapian__LMWeight);
  }
  
  {
    try {
      result = ((Xapian::LMWeight 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_LMWeight_get_sumpart(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LMWeight *arg1 = (Xapian::LMWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  Xapian::termcount arg4 ;
  double result;
  
  SWIG_check_num_args("Xapian::LMWeight::get_sumpart",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LMWeight::get_sumpart",1,"Xapian::LMWeight const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::LMWeight::get_sumpart",2,"Xapian::termcount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::LMWeight::get_sumpart",3,"Xapian::termcount");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::LMWeight::get_sumpart",4,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LMWeight,0))){
    SWIG_fail_ptr("LMWeight_get_sumpart",1,SWIGTYPE_p_Xapian__LMWeight);
  }
  
  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);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (Xapian::termcount)lua_tonumber(L, 4);
  {
    try {
      result = (double)((Xapian::LMWeight const *)arg1)->get_sumpart(arg2,arg3,arg4);
    } 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_LMWeight_get_maxpart(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LMWeight *arg1 = (Xapian::LMWeight *) 0 ;
  double result;
  
  SWIG_check_num_args("Xapian::LMWeight::get_maxpart",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LMWeight::get_maxpart",1,"Xapian::LMWeight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LMWeight,0))){
    SWIG_fail_ptr("LMWeight_get_maxpart",1,SWIGTYPE_p_Xapian__LMWeight);
  }
  
  {
    try {
      result = (double)((Xapian::LMWeight 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_LMWeight_get_sumextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LMWeight *arg1 = (Xapian::LMWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  double result;
  
  SWIG_check_num_args("Xapian::LMWeight::get_sumextra",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LMWeight::get_sumextra",1,"Xapian::LMWeight const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::LMWeight::get_sumextra",2,"Xapian::termcount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::LMWeight::get_sumextra",3,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LMWeight,0))){
    SWIG_fail_ptr("LMWeight_get_sumextra",1,SWIGTYPE_p_Xapian__LMWeight);
  }
  
  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 = (double)((Xapian::LMWeight const *)arg1)->get_sumextra(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_LMWeight_get_maxextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LMWeight *arg1 = (Xapian::LMWeight *) 0 ;
  double result;
  
  SWIG_check_num_args("Xapian::LMWeight::get_maxextra",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LMWeight::get_maxextra",1,"Xapian::LMWeight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LMWeight,0))){
    SWIG_fail_ptr("LMWeight_get_maxextra",1,SWIGTYPE_p_Xapian__LMWeight);
  }
  
  {
    try {
      result = (double)((Xapian::LMWeight 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_LMWeight(void *obj) {
Xapian::LMWeight *arg1 = (Xapian::LMWeight *) obj;
delete arg1;
}
static int _proxy__wrap_new_LMWeight(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_LMWeight);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_LMWeight_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_LMWeight_methods[]= {
    { "name", _wrap_LMWeight_name},
    { "get_sumpart", _wrap_LMWeight_get_sumpart},
    { "get_maxpart", _wrap_LMWeight_get_maxpart},
    { "get_sumextra", _wrap_LMWeight_get_sumextra},
    { "get_maxextra", _wrap_LMWeight_get_maxextra},
    {0,0}
};
static swig_lua_method swig_LMWeight_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_LMWeight_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_LMWeight_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_LMWeight_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_LMWeight_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_LMWeight_Sf_SwigStatic = {
    "LMWeight",
    swig_LMWeight_Sf_SwigStatic_methods,
    swig_LMWeight_Sf_SwigStatic_attributes,
    swig_LMWeight_Sf_SwigStatic_constants,
    swig_LMWeight_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_LMWeight_bases[] = {0,0};
static const char *swig_LMWeight_base_names[] = {"Xapian::Weight *",0};
static swig_lua_class _wrap_class_LMWeight = { "LMWeight", "LMWeight", &SWIGTYPE_p_Xapian__LMWeight,_proxy__wrap_new_LMWeight, swig_delete_LMWeight, swig_LMWeight_methods, swig_LMWeight_attributes, &swig_LMWeight_Sf_SwigStatic, swig_LMWeight_meta, swig_LMWeight_bases, swig_LMWeight_base_names };

static int _wrap_CoordWeight_init(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::CoordWeight *arg1 = (Xapian::CoordWeight *) 0 ;
  double arg2 ;
  
  SWIG_check_num_args("Xapian::CoordWeight::init",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::CoordWeight::init",1,"Xapian::CoordWeight *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::CoordWeight::init",2,"double");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__CoordWeight,0))){
    SWIG_fail_ptr("CoordWeight_init",1,SWIGTYPE_p_Xapian__CoordWeight);
  }
  
  arg2 = (double)lua_tonumber(L, 2);
  {
    try {
      (arg1)->init(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_CoordWeight(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::CoordWeight *result = 0 ;
  
  SWIG_check_num_args("Xapian::CoordWeight::CoordWeight",0,0)
  {
    try {
      result = (Xapian::CoordWeight *)new Xapian::CoordWeight();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__CoordWeight,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_CoordWeight_name(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::CoordWeight *arg1 = (Xapian::CoordWeight *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::CoordWeight::name",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::CoordWeight::name",1,"Xapian::CoordWeight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__CoordWeight,0))){
    SWIG_fail_ptr("CoordWeight_name",1,SWIGTYPE_p_Xapian__CoordWeight);
  }
  
  {
    try {
      result = ((Xapian::CoordWeight 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_CoordWeight_get_sumpart(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::CoordWeight *arg1 = (Xapian::CoordWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  Xapian::termcount arg4 ;
  double result;
  
  SWIG_check_num_args("Xapian::CoordWeight::get_sumpart",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::CoordWeight::get_sumpart",1,"Xapian::CoordWeight const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::CoordWeight::get_sumpart",2,"Xapian::termcount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::CoordWeight::get_sumpart",3,"Xapian::termcount");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::CoordWeight::get_sumpart",4,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__CoordWeight,0))){
    SWIG_fail_ptr("CoordWeight_get_sumpart",1,SWIGTYPE_p_Xapian__CoordWeight);
  }
  
  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);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (Xapian::termcount)lua_tonumber(L, 4);
  {
    try {
      result = (double)((Xapian::CoordWeight const *)arg1)->get_sumpart(arg2,arg3,arg4);
    } 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_CoordWeight_get_maxpart(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::CoordWeight *arg1 = (Xapian::CoordWeight *) 0 ;
  double result;
  
  SWIG_check_num_args("Xapian::CoordWeight::get_maxpart",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::CoordWeight::get_maxpart",1,"Xapian::CoordWeight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__CoordWeight,0))){
    SWIG_fail_ptr("CoordWeight_get_maxpart",1,SWIGTYPE_p_Xapian__CoordWeight);
  }
  
  {
    try {
      result = (double)((Xapian::CoordWeight 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_CoordWeight_get_sumextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::CoordWeight *arg1 = (Xapian::CoordWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  double result;
  
  SWIG_check_num_args("Xapian::CoordWeight::get_sumextra",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::CoordWeight::get_sumextra",1,"Xapian::CoordWeight const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::CoordWeight::get_sumextra",2,"Xapian::termcount");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::CoordWeight::get_sumextra",3,"Xapian::termcount");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__CoordWeight,0))){
    SWIG_fail_ptr("CoordWeight_get_sumextra",1,SWIGTYPE_p_Xapian__CoordWeight);
  }
  
  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 = (double)((Xapian::CoordWeight const *)arg1)->get_sumextra(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_CoordWeight_get_maxextra(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::CoordWeight *arg1 = (Xapian::CoordWeight *) 0 ;
  double result;
  
  SWIG_check_num_args("Xapian::CoordWeight::get_maxextra",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::CoordWeight::get_maxextra",1,"Xapian::CoordWeight const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__CoordWeight,0))){
    SWIG_fail_ptr("CoordWeight_get_maxextra",1,SWIGTYPE_p_Xapian__CoordWeight);
  }
  
  {
    try {
      result = (double)((Xapian::CoordWeight 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_CoordWeight(void *obj) {
Xapian::CoordWeight *arg1 = (Xapian::CoordWeight *) obj;
delete arg1;
}
static int _proxy__wrap_new_CoordWeight(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_CoordWeight);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_CoordWeight_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_CoordWeight_methods[]= {
    { "init", _wrap_CoordWeight_init},
    { "name", _wrap_CoordWeight_name},
    { "get_sumpart", _wrap_CoordWeight_get_sumpart},
    { "get_maxpart", _wrap_CoordWeight_get_maxpart},
    { "get_sumextra", _wrap_CoordWeight_get_sumextra},
    { "get_maxextra", _wrap_CoordWeight_get_maxextra},
    {0,0}
};
static swig_lua_method swig_CoordWeight_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_CoordWeight_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_CoordWeight_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_CoordWeight_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_CoordWeight_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_CoordWeight_Sf_SwigStatic = {
    "CoordWeight",
    swig_CoordWeight_Sf_SwigStatic_methods,
    swig_CoordWeight_Sf_SwigStatic_attributes,
    swig_CoordWeight_Sf_SwigStatic_constants,
    swig_CoordWeight_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_CoordWeight_bases[] = {0,0};
static const char *swig_CoordWeight_base_names[] = {"Xapian::Weight *",0};
static swig_lua_class _wrap_class_CoordWeight = { "CoordWeight", "CoordWeight", &SWIGTYPE_p_Xapian__CoordWeight,_proxy__wrap_new_CoordWeight, swig_delete_CoordWeight, swig_CoordWeight_methods, swig_CoordWeight_attributes, &swig_CoordWeight_Sf_SwigStatic, swig_CoordWeight_meta, swig_CoordWeight_bases, swig_CoordWeight_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 int _proxy__wrap_new_Compactor(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_Compactor);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_Compactor_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_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_method swig_Compactor_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_Compactor_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_Compactor_Sf_SwigStatic_constants[]= {
    {SWIG_LUA_CONSTTAB_INT("STANDARD", Xapian::Compactor::STANDARD)},
    {SWIG_LUA_CONSTTAB_INT("FULL", Xapian::Compactor::FULL)},
    {SWIG_LUA_CONSTTAB_INT("FULLER", Xapian::Compactor::FULLER)},
    {0,0,0,0,0,0}
};
static swig_lua_method swig_Compactor_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_Compactor_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_Compactor_Sf_SwigStatic = {
    "Compactor",
    swig_Compactor_Sf_SwigStatic_methods,
    swig_Compactor_Sf_SwigStatic_attributes,
    swig_Compactor_Sf_SwigStatic_constants,
    swig_Compactor_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_Compactor_bases[] = {0};
static const char *swig_Compactor_base_names[] = {0};
static swig_lua_class _wrap_class_Compactor = { "Compactor", "Compactor", &SWIGTYPE_p_Xapian__Compactor,_proxy__wrap_new_Compactor, swig_delete_Compactor, swig_Compactor_methods, swig_Compactor_attributes, &swig_Compactor_Sf_SwigStatic, swig_Compactor_meta, swig_Compactor_bases, swig_Compactor_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_set_maxweight(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  double arg2 ;
  
  SWIG_check_num_args("Xapian::PostingSource::set_maxweight",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PostingSource::set_maxweight",1,"Xapian::PostingSource *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::PostingSource::set_maxweight",2,"double");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PostingSource,0))){
    SWIG_fail_ptr("PostingSource_set_maxweight",1,SWIGTYPE_p_Xapian__PostingSource);
  }
  
  arg2 = (double)lua_tonumber(L, 2);
  {
    try {
      (arg1)->set_maxweight(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_get_maxweight(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  double 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);
  }
  
  result = (double)((Xapian::PostingSource const *)arg1)->get_maxweight();
  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 ;
  double 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 = (double)((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 ;
  double 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,"double");
  
  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 = (double)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 ;
  double 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,"double");
  
  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 = (double)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 ;
  double 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,"double");
  
  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 = (double)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 int _wrap_PostingSource_release(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  Xapian::PostingSource *result = 0 ;
  
  SWIG_check_num_args("Xapian::PostingSource::release",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::PostingSource::release",1,"Xapian::PostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__PostingSource,0))){
    SWIG_fail_ptr("PostingSource_release",1,SWIGTYPE_p_Xapian__PostingSource);
  }
  
  {
    try {
      result = (Xapian::PostingSource *)((Xapian::PostingSource const *)arg1)->release();
    } 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 void swig_delete_PostingSource(void *obj) {
Xapian::PostingSource *arg1 = (Xapian::PostingSource *) obj;
delete arg1;
}
static swig_lua_attribute swig_PostingSource_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_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},
    { "set_maxweight", _wrap_PostingSource_set_maxweight},
    { "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},
    { "release", _wrap_PostingSource_release},
    {0,0}
};
static swig_lua_method swig_PostingSource_meta[] = {
    { "__tostring", _wrap_PostingSource___tostring},
    {0,0}
};

static swig_lua_attribute swig_PostingSource_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_PostingSource_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_PostingSource_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_PostingSource_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_PostingSource_Sf_SwigStatic = {
    "PostingSource",
    swig_PostingSource_Sf_SwigStatic_methods,
    swig_PostingSource_Sf_SwigStatic_attributes,
    swig_PostingSource_Sf_SwigStatic_constants,
    swig_PostingSource_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_PostingSource_bases[] = {0};
static const char *swig_PostingSource_base_names[] = {0};
static swig_lua_class _wrap_class_PostingSource = { "PostingSource", "PostingSource", &SWIGTYPE_p_Xapian__PostingSource,0, swig_delete_PostingSource, swig_PostingSource_methods, swig_PostingSource_attributes, &swig_PostingSource_Sf_SwigStatic, swig_PostingSource_meta, swig_PostingSource_bases, swig_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 ;
  double 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,"double");
  
  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 = (double)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 ;
  double 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,"double");
  
  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 = (double)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 ;
  double 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,"double");
  
  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 = (double)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 int _proxy__wrap_new_ValuePostingSource(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_ValuePostingSource);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_ValuePostingSource_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_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_method swig_ValuePostingSource_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_ValuePostingSource_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_ValuePostingSource_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_ValuePostingSource_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_ValuePostingSource_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_ValuePostingSource_Sf_SwigStatic = {
    "ValuePostingSource",
    swig_ValuePostingSource_Sf_SwigStatic_methods,
    swig_ValuePostingSource_Sf_SwigStatic_attributes,
    swig_ValuePostingSource_Sf_SwigStatic_constants,
    swig_ValuePostingSource_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_ValuePostingSource_bases[] = {0,0};
static const char *swig_ValuePostingSource_base_names[] = {"Xapian::PostingSource *",0};
static swig_lua_class _wrap_class_ValuePostingSource = { "ValuePostingSource", "ValuePostingSource", &SWIGTYPE_p_Xapian__ValuePostingSource,_proxy__wrap_new_ValuePostingSource, swig_delete_ValuePostingSource, swig_ValuePostingSource_methods, swig_ValuePostingSource_attributes, &swig_ValuePostingSource_Sf_SwigStatic, swig_ValuePostingSource_meta, swig_ValuePostingSource_bases, swig_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 ;
  double 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 = (double)((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 int _proxy__wrap_new_ValueWeightPostingSource(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_ValueWeightPostingSource);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_ValueWeightPostingSource_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_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_method swig_ValueWeightPostingSource_meta[] = {
    { "__tostring", _wrap_ValueWeightPostingSource___tostring},
    {0,0}
};

static swig_lua_attribute swig_ValueWeightPostingSource_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_ValueWeightPostingSource_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_ValueWeightPostingSource_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_ValueWeightPostingSource_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_ValueWeightPostingSource_Sf_SwigStatic = {
    "ValueWeightPostingSource",
    swig_ValueWeightPostingSource_Sf_SwigStatic_methods,
    swig_ValueWeightPostingSource_Sf_SwigStatic_attributes,
    swig_ValueWeightPostingSource_Sf_SwigStatic_constants,
    swig_ValueWeightPostingSource_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_ValueWeightPostingSource_bases[] = {0,0};
static const char *swig_ValueWeightPostingSource_base_names[] = {"Xapian::ValuePostingSource *",0};
static swig_lua_class _wrap_class_ValueWeightPostingSource = { "ValueWeightPostingSource", "ValueWeightPostingSource", &SWIGTYPE_p_Xapian__ValueWeightPostingSource,_proxy__wrap_new_ValueWeightPostingSource, swig_delete_ValueWeightPostingSource, swig_ValueWeightPostingSource_methods, swig_ValueWeightPostingSource_attributes, &swig_ValueWeightPostingSource_Sf_SwigStatic, swig_ValueWeightPostingSource_meta, swig_ValueWeightPostingSource_bases, swig_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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 ;
  double 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 = (double)((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 ;
  double 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,"double");
  
  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 = (double)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 ;
  double 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,"double");
  
  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 = (double)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 ;
  double 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,"double");
  
  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 = (double)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 int _proxy__wrap_new_DecreasingValueWeightPostingSource(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_DecreasingValueWeightPostingSource);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_DecreasingValueWeightPostingSource_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_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_method swig_DecreasingValueWeightPostingSource_meta[] = {
    { "__tostring", _wrap_DecreasingValueWeightPostingSource___tostring},
    {0,0}
};

static swig_lua_attribute swig_DecreasingValueWeightPostingSource_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_DecreasingValueWeightPostingSource_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_DecreasingValueWeightPostingSource_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_DecreasingValueWeightPostingSource_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_DecreasingValueWeightPostingSource_Sf_SwigStatic = {
    "DecreasingValueWeightPostingSource",
    swig_DecreasingValueWeightPostingSource_Sf_SwigStatic_methods,
    swig_DecreasingValueWeightPostingSource_Sf_SwigStatic_attributes,
    swig_DecreasingValueWeightPostingSource_Sf_SwigStatic_constants,
    swig_DecreasingValueWeightPostingSource_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_DecreasingValueWeightPostingSource_bases[] = {0,0};
static const char *swig_DecreasingValueWeightPostingSource_base_names[] = {"Xapian::ValueWeightPostingSource *",0};
static swig_lua_class _wrap_class_DecreasingValueWeightPostingSource = { "DecreasingValueWeightPostingSource", "DecreasingValueWeightPostingSource", &SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource,_proxy__wrap_new_DecreasingValueWeightPostingSource, swig_delete_DecreasingValueWeightPostingSource, swig_DecreasingValueWeightPostingSource_methods, swig_DecreasingValueWeightPostingSource_attributes, &swig_DecreasingValueWeightPostingSource_Sf_SwigStatic, swig_DecreasingValueWeightPostingSource_meta, swig_DecreasingValueWeightPostingSource_bases, swig_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 ;
  double 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 = (double)((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 int _proxy__wrap_new_ValueMapPostingSource(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_ValueMapPostingSource);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_ValueMapPostingSource_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_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_method swig_ValueMapPostingSource_meta[] = {
    { "__tostring", _wrap_ValueMapPostingSource___tostring},
    {0,0}
};

static swig_lua_attribute swig_ValueMapPostingSource_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_ValueMapPostingSource_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_ValueMapPostingSource_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_ValueMapPostingSource_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_ValueMapPostingSource_Sf_SwigStatic = {
    "ValueMapPostingSource",
    swig_ValueMapPostingSource_Sf_SwigStatic_methods,
    swig_ValueMapPostingSource_Sf_SwigStatic_attributes,
    swig_ValueMapPostingSource_Sf_SwigStatic_constants,
    swig_ValueMapPostingSource_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_ValueMapPostingSource_bases[] = {0,0};
static const char *swig_ValueMapPostingSource_base_names[] = {"Xapian::ValuePostingSource *",0};
static swig_lua_class _wrap_class_ValueMapPostingSource = { "ValueMapPostingSource", "ValueMapPostingSource", &SWIGTYPE_p_Xapian__ValueMapPostingSource,_proxy__wrap_new_ValueMapPostingSource, swig_delete_ValueMapPostingSource, swig_ValueMapPostingSource_methods, swig_ValueMapPostingSource_attributes, &swig_ValueMapPostingSource_Sf_SwigStatic, swig_ValueMapPostingSource_meta, swig_ValueMapPostingSource_bases, swig_ValueMapPostingSource_base_names };

static int _wrap_new_FixedWeightPostingSource(lua_State* L) {
  int SWIG_arg = 0;
  double 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,"double");
  arg1 = (double)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 ;
  double 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 = (double)((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 ;
  double 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,"double");
  
  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 = (double)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 ;
  double 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,"double");
  
  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 = (double)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 ;
  double 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,"double");
  
  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 = (double)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 int _proxy__wrap_new_FixedWeightPostingSource(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_FixedWeightPostingSource);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_FixedWeightPostingSource_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_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_method swig_FixedWeightPostingSource_meta[] = {
    { "__tostring", _wrap_FixedWeightPostingSource___tostring},
    {0,0}
};

static swig_lua_attribute swig_FixedWeightPostingSource_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_FixedWeightPostingSource_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_FixedWeightPostingSource_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_FixedWeightPostingSource_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_FixedWeightPostingSource_Sf_SwigStatic = {
    "FixedWeightPostingSource",
    swig_FixedWeightPostingSource_Sf_SwigStatic_methods,
    swig_FixedWeightPostingSource_Sf_SwigStatic_attributes,
    swig_FixedWeightPostingSource_Sf_SwigStatic_constants,
    swig_FixedWeightPostingSource_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_FixedWeightPostingSource_bases[] = {0,0};
static const char *swig_FixedWeightPostingSource_base_names[] = {"Xapian::PostingSource *",0};
static swig_lua_class _wrap_class_FixedWeightPostingSource = { "FixedWeightPostingSource", "FixedWeightPostingSource", &SWIGTYPE_p_Xapian__FixedWeightPostingSource,_proxy__wrap_new_FixedWeightPostingSource, swig_delete_FixedWeightPostingSource, swig_FixedWeightPostingSource_methods, swig_FixedWeightPostingSource_attributes, &swig_FixedWeightPostingSource_Sf_SwigStatic, swig_FixedWeightPostingSource_meta, swig_FixedWeightPostingSource_bases, swig_FixedWeightPostingSource_base_names };

static int _wrap_MatchSpy___call(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MatchSpy *arg1 = (Xapian::MatchSpy *) 0 ;
  Xapian::Document *arg2 = 0 ;
  double 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,"double");
  
  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 = (double)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 int _wrap_MatchSpy_release(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::MatchSpy *arg1 = (Xapian::MatchSpy *) 0 ;
  Xapian::MatchSpy *result = 0 ;
  
  SWIG_check_num_args("Xapian::MatchSpy::release",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::MatchSpy::release",1,"Xapian::MatchSpy const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__MatchSpy,0))){
    SWIG_fail_ptr("MatchSpy_release",1,SWIGTYPE_p_Xapian__MatchSpy);
  }
  
  {
    try {
      result = (Xapian::MatchSpy *)((Xapian::MatchSpy const *)arg1)->release();
    } 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_MatchSpy(void *obj) {
Xapian::MatchSpy *arg1 = (Xapian::MatchSpy *) obj;
delete arg1;
}
static swig_lua_attribute swig_MatchSpy_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_MatchSpy_methods[]= {
    { "__call", _wrap_MatchSpy___call},
    { "name", _wrap_MatchSpy_name},
    { "merge_results", _wrap_MatchSpy_merge_results},
    { "__tostring", _wrap_MatchSpy___tostring},
    { "release", _wrap_MatchSpy_release},
    {0,0}
};
static swig_lua_method swig_MatchSpy_meta[] = {
    { "__call", _wrap_MatchSpy___call},
    { "__tostring", _wrap_MatchSpy___tostring},
    {0,0}
};

static swig_lua_attribute swig_MatchSpy_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_MatchSpy_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_MatchSpy_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_MatchSpy_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_MatchSpy_Sf_SwigStatic = {
    "MatchSpy",
    swig_MatchSpy_Sf_SwigStatic_methods,
    swig_MatchSpy_Sf_SwigStatic_attributes,
    swig_MatchSpy_Sf_SwigStatic_constants,
    swig_MatchSpy_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_MatchSpy_bases[] = {0};
static const char *swig_MatchSpy_base_names[] = {0};
static swig_lua_class _wrap_class_MatchSpy = { "MatchSpy", "MatchSpy", &SWIGTYPE_p_Xapian__MatchSpy,0, swig_delete_MatchSpy, swig_MatchSpy_methods, swig_MatchSpy_attributes, &swig_MatchSpy_Sf_SwigStatic, swig_MatchSpy_meta, swig_MatchSpy_bases, swig_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);
    }
  }
  
  SWIG_Lua_pusherrstring(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);
  }
  
  result = ((Xapian::ValueCountMatchSpy const *)arg1)->get_total();
  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);
  }
  
  result = ((Xapian::ValueCountMatchSpy const *)arg1)->values_end();
  {
    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);
  result = ((Xapian::ValueCountMatchSpy const *)arg1)->top_values_end(arg2);
  {
    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 ;
  double 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,"double");
  
  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 = (double)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 ;
  SwigValueWrapper< 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 ;
  SwigValueWrapper< 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 int _proxy__wrap_new_ValueCountMatchSpy(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_ValueCountMatchSpy);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_ValueCountMatchSpy_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_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_method swig_ValueCountMatchSpy_meta[] = {
    { "__call", _wrap_ValueCountMatchSpy___call},
    { "__tostring", _wrap_ValueCountMatchSpy___tostring},
    {0,0}
};

static swig_lua_attribute swig_ValueCountMatchSpy_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_ValueCountMatchSpy_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_ValueCountMatchSpy_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_ValueCountMatchSpy_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_ValueCountMatchSpy_Sf_SwigStatic = {
    "ValueCountMatchSpy",
    swig_ValueCountMatchSpy_Sf_SwigStatic_methods,
    swig_ValueCountMatchSpy_Sf_SwigStatic_attributes,
    swig_ValueCountMatchSpy_Sf_SwigStatic_constants,
    swig_ValueCountMatchSpy_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_ValueCountMatchSpy_bases[] = {0,0};
static const char *swig_ValueCountMatchSpy_base_names[] = {"Xapian::MatchSpy *",0};
static swig_lua_class _wrap_class_ValueCountMatchSpy = { "ValueCountMatchSpy", "ValueCountMatchSpy", &SWIGTYPE_p_Xapian__ValueCountMatchSpy,_proxy__wrap_new_ValueCountMatchSpy, swig_delete_ValueCountMatchSpy, swig_ValueCountMatchSpy_methods, swig_ValueCountMatchSpy_attributes, &swig_ValueCountMatchSpy_Sf_SwigStatic, swig_ValueCountMatchSpy_meta, swig_ValueCountMatchSpy_bases, swig_ValueCountMatchSpy_base_names };

static int _wrap_miles_to_metres(lua_State* L) {
  int SWIG_arg = 0;
  double arg1 ;
  double result;
  
  SWIG_check_num_args("Xapian::miles_to_metres",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::miles_to_metres",1,"double");
  arg1 = (double)lua_tonumber(L, 1);
  {
    try {
      result = (double)Xapian::miles_to_metres(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_metres_to_miles(lua_State* L) {
  int SWIG_arg = 0;
  double arg1 ;
  double result;
  
  SWIG_check_num_args("Xapian::metres_to_miles",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::metres_to_miles",1,"double");
  arg1 = (double)lua_tonumber(L, 1);
  {
    try {
      result = (double)Xapian::metres_to_miles(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_LatLongCoord_latitude_set(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongCoord *arg1 = (Xapian::LatLongCoord *) 0 ;
  double arg2 ;
  
  SWIG_check_num_args("Xapian::LatLongCoord::latitude",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LatLongCoord::latitude",1,"Xapian::LatLongCoord *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::LatLongCoord::latitude",2,"double");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LatLongCoord,0))){
    SWIG_fail_ptr("LatLongCoord_latitude_set",1,SWIGTYPE_p_Xapian__LatLongCoord);
  }
  
  arg2 = (double)lua_tonumber(L, 2);
  if (arg1) (arg1)->latitude = arg2;
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_LatLongCoord_latitude_get(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongCoord *arg1 = (Xapian::LatLongCoord *) 0 ;
  double result;
  
  SWIG_check_num_args("Xapian::LatLongCoord::latitude",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LatLongCoord::latitude",1,"Xapian::LatLongCoord *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LatLongCoord,0))){
    SWIG_fail_ptr("LatLongCoord_latitude_get",1,SWIGTYPE_p_Xapian__LatLongCoord);
  }
  
  result = (double) ((arg1)->latitude);
  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_LatLongCoord_longitude_set(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongCoord *arg1 = (Xapian::LatLongCoord *) 0 ;
  double arg2 ;
  
  SWIG_check_num_args("Xapian::LatLongCoord::longitude",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LatLongCoord::longitude",1,"Xapian::LatLongCoord *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::LatLongCoord::longitude",2,"double");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LatLongCoord,0))){
    SWIG_fail_ptr("LatLongCoord_longitude_set",1,SWIGTYPE_p_Xapian__LatLongCoord);
  }
  
  arg2 = (double)lua_tonumber(L, 2);
  if (arg1) (arg1)->longitude = arg2;
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_LatLongCoord_longitude_get(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongCoord *arg1 = (Xapian::LatLongCoord *) 0 ;
  double result;
  
  SWIG_check_num_args("Xapian::LatLongCoord::longitude",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LatLongCoord::longitude",1,"Xapian::LatLongCoord *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LatLongCoord,0))){
    SWIG_fail_ptr("LatLongCoord_longitude_get",1,SWIGTYPE_p_Xapian__LatLongCoord);
  }
  
  result = (double) ((arg1)->longitude);
  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_LatLongCoord__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongCoord *result = 0 ;
  
  SWIG_check_num_args("Xapian::LatLongCoord::LatLongCoord",0,0)
  {
    try {
      result = (Xapian::LatLongCoord *)new Xapian::LatLongCoord();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__LatLongCoord,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


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


static int _wrap_new_LatLongCoord(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_LatLongCoord__SWIG_0(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_LatLongCoord__SWIG_1(L);
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_LatLongCoord'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::LatLongCoord::LatLongCoord()\n"
    "    Xapian::LatLongCoord::LatLongCoord(double,double)\n");
  lua_error(L);return 0;
}


static int _wrap_LatLongCoord_unserialise(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongCoord *arg1 = (Xapian::LatLongCoord *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::LatLongCoord::unserialise",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LatLongCoord::unserialise",1,"Xapian::LatLongCoord *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::LatLongCoord::unserialise",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LatLongCoord,0))){
    SWIG_fail_ptr("LatLongCoord_unserialise",1,SWIGTYPE_p_Xapian__LatLongCoord);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      (arg1)->unserialise((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_LatLongCoord_serialise(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongCoord *arg1 = (Xapian::LatLongCoord *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::LatLongCoord::serialise",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LatLongCoord::serialise",1,"Xapian::LatLongCoord const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LatLongCoord,0))){
    SWIG_fail_ptr("LatLongCoord_serialise",1,SWIGTYPE_p_Xapian__LatLongCoord);
  }
  
  {
    try {
      result = ((Xapian::LatLongCoord 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_LatLongCoord___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongCoord *arg1 = (Xapian::LatLongCoord *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::LatLongCoord::get_description",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LatLongCoord::get_description",1,"Xapian::LatLongCoord const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LatLongCoord,0))){
    SWIG_fail_ptr("LatLongCoord___tostring",1,SWIGTYPE_p_Xapian__LatLongCoord);
  }
  
  {
    try {
      result = ((Xapian::LatLongCoord 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_LatLongCoord(void *obj) {
Xapian::LatLongCoord *arg1 = (Xapian::LatLongCoord *) obj;
delete arg1;
}
static int _proxy__wrap_new_LatLongCoord(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_LatLongCoord);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_LatLongCoord_attributes[] = {
    { "latitude", _wrap_LatLongCoord_latitude_get, _wrap_LatLongCoord_latitude_set },
    { "longitude", _wrap_LatLongCoord_longitude_get, _wrap_LatLongCoord_longitude_set },
    {0,0,0}
};
static swig_lua_method swig_LatLongCoord_methods[]= {
    { "unserialise", _wrap_LatLongCoord_unserialise},
    { "serialise", _wrap_LatLongCoord_serialise},
    { "__tostring", _wrap_LatLongCoord___tostring},
    {0,0}
};
static swig_lua_method swig_LatLongCoord_meta[] = {
    { "__tostring", _wrap_LatLongCoord___tostring},
    {0,0}
};

static swig_lua_attribute swig_LatLongCoord_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_LatLongCoord_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_LatLongCoord_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_LatLongCoord_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_LatLongCoord_Sf_SwigStatic = {
    "LatLongCoord",
    swig_LatLongCoord_Sf_SwigStatic_methods,
    swig_LatLongCoord_Sf_SwigStatic_attributes,
    swig_LatLongCoord_Sf_SwigStatic_constants,
    swig_LatLongCoord_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_LatLongCoord_bases[] = {0};
static const char *swig_LatLongCoord_base_names[] = {0};
static swig_lua_class _wrap_class_LatLongCoord = { "LatLongCoord", "LatLongCoord", &SWIGTYPE_p_Xapian__LatLongCoord,_proxy__wrap_new_LatLongCoord, swig_delete_LatLongCoord, swig_LatLongCoord_methods, swig_LatLongCoord_attributes, &swig_LatLongCoord_Sf_SwigStatic, swig_LatLongCoord_meta, swig_LatLongCoord_bases, swig_LatLongCoord_base_names };

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


static int _wrap_LatLongCoordsIterator___eq(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongCoordsIterator *arg1 = (Xapian::LatLongCoordsIterator *) 0 ;
  Xapian::LatLongCoordsIterator *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("Xapian::LatLongCoordsIterator::operator ==",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LatLongCoordsIterator::operator ==",1,"Xapian::LatLongCoordsIterator const *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::LatLongCoordsIterator::operator ==",2,"Xapian::LatLongCoordsIterator const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LatLongCoordsIterator,0))){
    SWIG_fail_ptr("LatLongCoordsIterator___eq",1,SWIGTYPE_p_Xapian__LatLongCoordsIterator);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__LatLongCoordsIterator,0))){
    SWIG_fail_ptr("LatLongCoordsIterator___eq",2,SWIGTYPE_p_Xapian__LatLongCoordsIterator);
  }
  
  {
    try {
      result = (bool)((Xapian::LatLongCoordsIterator const *)arg1)->operator ==((Xapian::LatLongCoordsIterator 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_LatLongCoordsIterator_equals(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongCoordsIterator *arg1 = (Xapian::LatLongCoordsIterator *) 0 ;
  Xapian::LatLongCoordsIterator *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("Xapian::LatLongCoordsIterator::equals",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LatLongCoordsIterator::equals",1,"Xapian::LatLongCoordsIterator const *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::LatLongCoordsIterator::equals",2,"Xapian::LatLongCoordsIterator const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LatLongCoordsIterator,0))){
    SWIG_fail_ptr("LatLongCoordsIterator_equals",1,SWIGTYPE_p_Xapian__LatLongCoordsIterator);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__LatLongCoordsIterator,0))){
    SWIG_fail_ptr("LatLongCoordsIterator_equals",2,SWIGTYPE_p_Xapian__LatLongCoordsIterator);
  }
  
  {
    try {
      result = (bool)Xapian_LatLongCoordsIterator_equals((Xapian::LatLongCoordsIterator const *)arg1,(Xapian::LatLongCoordsIterator 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_LatLongCoordsIterator_get_coord(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongCoordsIterator *arg1 = (Xapian::LatLongCoordsIterator *) 0 ;
  Xapian::LatLongCoord result;
  
  SWIG_check_num_args("Xapian::LatLongCoordsIterator::get_coord",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LatLongCoordsIterator::get_coord",1,"Xapian::LatLongCoordsIterator const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LatLongCoordsIterator,0))){
    SWIG_fail_ptr("LatLongCoordsIterator_get_coord",1,SWIGTYPE_p_Xapian__LatLongCoordsIterator);
  }
  
  {
    try {
      result = Xapian_LatLongCoordsIterator_get_coord((Xapian::LatLongCoordsIterator const *)arg1);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::LatLongCoord * resultptr = new Xapian::LatLongCoord((const Xapian::LatLongCoord &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__LatLongCoord,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_LatLongCoordsIterator_next(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongCoordsIterator *arg1 = (Xapian::LatLongCoordsIterator *) 0 ;
  
  SWIG_check_num_args("Xapian::LatLongCoordsIterator::next",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LatLongCoordsIterator::next",1,"Xapian::LatLongCoordsIterator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LatLongCoordsIterator,0))){
    SWIG_fail_ptr("LatLongCoordsIterator_next",1,SWIGTYPE_p_Xapian__LatLongCoordsIterator);
  }
  
  {
    try {
      Xapian_LatLongCoordsIterator_next(arg1);
    } 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_LatLongCoordsIterator(void *obj) {
Xapian::LatLongCoordsIterator *arg1 = (Xapian::LatLongCoordsIterator *) obj;
delete arg1;
}
static int _proxy__wrap_new_LatLongCoordsIterator(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_LatLongCoordsIterator);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_LatLongCoordsIterator_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_LatLongCoordsIterator_methods[]= {
    { "__eq", _wrap_LatLongCoordsIterator___eq},
    { "equals", _wrap_LatLongCoordsIterator_equals},
    { "get_coord", _wrap_LatLongCoordsIterator_get_coord},
    { "next", _wrap_LatLongCoordsIterator_next},
    {0,0}
};
static swig_lua_method swig_LatLongCoordsIterator_meta[] = {
    { "__eq", _wrap_LatLongCoordsIterator___eq},
    {0,0}
};

static swig_lua_attribute swig_LatLongCoordsIterator_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_LatLongCoordsIterator_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_LatLongCoordsIterator_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_LatLongCoordsIterator_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_LatLongCoordsIterator_Sf_SwigStatic = {
    "LatLongCoordsIterator",
    swig_LatLongCoordsIterator_Sf_SwigStatic_methods,
    swig_LatLongCoordsIterator_Sf_SwigStatic_attributes,
    swig_LatLongCoordsIterator_Sf_SwigStatic_constants,
    swig_LatLongCoordsIterator_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_LatLongCoordsIterator_bases[] = {0};
static const char *swig_LatLongCoordsIterator_base_names[] = {0};
static swig_lua_class _wrap_class_LatLongCoordsIterator = { "LatLongCoordsIterator", "LatLongCoordsIterator", &SWIGTYPE_p_Xapian__LatLongCoordsIterator,_proxy__wrap_new_LatLongCoordsIterator, swig_delete_LatLongCoordsIterator, swig_LatLongCoordsIterator_methods, swig_LatLongCoordsIterator_attributes, &swig_LatLongCoordsIterator_Sf_SwigStatic, swig_LatLongCoordsIterator_meta, swig_LatLongCoordsIterator_bases, swig_LatLongCoordsIterator_base_names };

static int _wrap_LatLongCoords_begin(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongCoords *arg1 = (Xapian::LatLongCoords *) 0 ;
  Xapian::LatLongCoordsIterator result;
  
  SWIG_check_num_args("Xapian::LatLongCoords::begin",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LatLongCoords::begin",1,"Xapian::LatLongCoords const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LatLongCoords,0))){
    SWIG_fail_ptr("LatLongCoords_begin",1,SWIGTYPE_p_Xapian__LatLongCoords);
  }
  
  {
    try {
      result = ((Xapian::LatLongCoords const *)arg1)->begin();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::LatLongCoordsIterator * resultptr = new Xapian::LatLongCoordsIterator((const Xapian::LatLongCoordsIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__LatLongCoordsIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_LatLongCoords__end(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongCoords *arg1 = (Xapian::LatLongCoords *) 0 ;
  Xapian::LatLongCoordsIterator result;
  
  SWIG_check_num_args("Xapian::LatLongCoords::end",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LatLongCoords::end",1,"Xapian::LatLongCoords const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LatLongCoords,0))){
    SWIG_fail_ptr("LatLongCoords__end",1,SWIGTYPE_p_Xapian__LatLongCoords);
  }
  
  {
    try {
      result = ((Xapian::LatLongCoords const *)arg1)->end();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  {
    Xapian::LatLongCoordsIterator * resultptr = new Xapian::LatLongCoordsIterator((const Xapian::LatLongCoordsIterator &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Xapian__LatLongCoordsIterator,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_LatLongCoords_size(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongCoords *arg1 = (Xapian::LatLongCoords *) 0 ;
  size_t result;
  
  SWIG_check_num_args("Xapian::LatLongCoords::size",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LatLongCoords::size",1,"Xapian::LatLongCoords const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LatLongCoords,0))){
    SWIG_fail_ptr("LatLongCoords_size",1,SWIGTYPE_p_Xapian__LatLongCoords);
  }
  
  {
    try {
      result = ((Xapian::LatLongCoords 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_LatLongCoords_empty(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongCoords *arg1 = (Xapian::LatLongCoords *) 0 ;
  bool result;
  
  SWIG_check_num_args("Xapian::LatLongCoords::empty",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LatLongCoords::empty",1,"Xapian::LatLongCoords const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LatLongCoords,0))){
    SWIG_fail_ptr("LatLongCoords_empty",1,SWIGTYPE_p_Xapian__LatLongCoords);
  }
  
  {
    try {
      result = (bool)((Xapian::LatLongCoords 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_LatLongCoords_append(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongCoords *arg1 = (Xapian::LatLongCoords *) 0 ;
  Xapian::LatLongCoord *arg2 = 0 ;
  
  SWIG_check_num_args("Xapian::LatLongCoords::append",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LatLongCoords::append",1,"Xapian::LatLongCoords *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::LatLongCoords::append",2,"Xapian::LatLongCoord const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LatLongCoords,0))){
    SWIG_fail_ptr("LatLongCoords_append",1,SWIGTYPE_p_Xapian__LatLongCoords);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__LatLongCoord,0))){
    SWIG_fail_ptr("LatLongCoords_append",2,SWIGTYPE_p_Xapian__LatLongCoord);
  }
  
  {
    try {
      (arg1)->append((Xapian::LatLongCoord 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_LatLongCoords__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongCoords *result = 0 ;
  
  SWIG_check_num_args("Xapian::LatLongCoords::LatLongCoords",0,0)
  {
    try {
      result = (Xapian::LatLongCoords *)new Xapian::LatLongCoords();
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__LatLongCoords,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


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


static int _wrap_new_LatLongCoords(lua_State* L) {
  int argc;
  int argv[2]={
    1,2
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_LatLongCoords__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__LatLongCoord, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_new_LatLongCoords__SWIG_1(L);
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_LatLongCoords'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::LatLongCoords::LatLongCoords()\n"
    "    Xapian::LatLongCoords::LatLongCoords(Xapian::LatLongCoord const &)\n");
  lua_error(L);return 0;
}


static int _wrap_LatLongCoords_unserialise(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongCoords *arg1 = (Xapian::LatLongCoords *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::LatLongCoords::unserialise",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LatLongCoords::unserialise",1,"Xapian::LatLongCoords *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::LatLongCoords::unserialise",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LatLongCoords,0))){
    SWIG_fail_ptr("LatLongCoords_unserialise",1,SWIGTYPE_p_Xapian__LatLongCoords);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      (arg1)->unserialise((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_LatLongCoords_serialise(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongCoords *arg1 = (Xapian::LatLongCoords *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::LatLongCoords::serialise",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LatLongCoords::serialise",1,"Xapian::LatLongCoords const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LatLongCoords,0))){
    SWIG_fail_ptr("LatLongCoords_serialise",1,SWIGTYPE_p_Xapian__LatLongCoords);
  }
  
  {
    try {
      result = ((Xapian::LatLongCoords 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_LatLongCoords___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongCoords *arg1 = (Xapian::LatLongCoords *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::LatLongCoords::get_description",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LatLongCoords::get_description",1,"Xapian::LatLongCoords const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LatLongCoords,0))){
    SWIG_fail_ptr("LatLongCoords___tostring",1,SWIGTYPE_p_Xapian__LatLongCoords);
  }
  
  {
    try {
      result = ((Xapian::LatLongCoords 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_LatLongCoords(void *obj) {
Xapian::LatLongCoords *arg1 = (Xapian::LatLongCoords *) obj;
delete arg1;
}
static int _proxy__wrap_new_LatLongCoords(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_LatLongCoords);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_LatLongCoords_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_LatLongCoords_methods[]= {
    { "begin", _wrap_LatLongCoords_begin},
    { "_end", _wrap_LatLongCoords__end},
    { "size", _wrap_LatLongCoords_size},
    { "empty", _wrap_LatLongCoords_empty},
    { "append", _wrap_LatLongCoords_append},
    { "unserialise", _wrap_LatLongCoords_unserialise},
    { "serialise", _wrap_LatLongCoords_serialise},
    { "__tostring", _wrap_LatLongCoords___tostring},
    {0,0}
};
static swig_lua_method swig_LatLongCoords_meta[] = {
    { "__tostring", _wrap_LatLongCoords___tostring},
    {0,0}
};

static swig_lua_attribute swig_LatLongCoords_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_LatLongCoords_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_LatLongCoords_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_LatLongCoords_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_LatLongCoords_Sf_SwigStatic = {
    "LatLongCoords",
    swig_LatLongCoords_Sf_SwigStatic_methods,
    swig_LatLongCoords_Sf_SwigStatic_attributes,
    swig_LatLongCoords_Sf_SwigStatic_constants,
    swig_LatLongCoords_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_LatLongCoords_bases[] = {0};
static const char *swig_LatLongCoords_base_names[] = {0};
static swig_lua_class _wrap_class_LatLongCoords = { "LatLongCoords", "LatLongCoords", &SWIGTYPE_p_Xapian__LatLongCoords,_proxy__wrap_new_LatLongCoords, swig_delete_LatLongCoords, swig_LatLongCoords_methods, swig_LatLongCoords_attributes, &swig_LatLongCoords_Sf_SwigStatic, swig_LatLongCoords_meta, swig_LatLongCoords_bases, swig_LatLongCoords_base_names };

static int _wrap_LatLongMetric_pointwise_distance(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongMetric *arg1 = (Xapian::LatLongMetric *) 0 ;
  Xapian::LatLongCoord *arg2 = 0 ;
  Xapian::LatLongCoord *arg3 = 0 ;
  double result;
  
  SWIG_check_num_args("Xapian::LatLongMetric::pointwise_distance",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LatLongMetric::pointwise_distance",1,"Xapian::LatLongMetric const *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::LatLongMetric::pointwise_distance",2,"Xapian::LatLongCoord const &");
  if(!lua_isuserdata(L,3)) SWIG_fail_arg("Xapian::LatLongMetric::pointwise_distance",3,"Xapian::LatLongCoord const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LatLongMetric,0))){
    SWIG_fail_ptr("LatLongMetric_pointwise_distance",1,SWIGTYPE_p_Xapian__LatLongMetric);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__LatLongCoord,0))){
    SWIG_fail_ptr("LatLongMetric_pointwise_distance",2,SWIGTYPE_p_Xapian__LatLongCoord);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_Xapian__LatLongCoord,0))){
    SWIG_fail_ptr("LatLongMetric_pointwise_distance",3,SWIGTYPE_p_Xapian__LatLongCoord);
  }
  
  {
    try {
      result = (double)((Xapian::LatLongMetric const *)arg1)->pointwise_distance((Xapian::LatLongCoord const &)*arg2,(Xapian::LatLongCoord 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_LatLongMetric___call__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongMetric *arg1 = (Xapian::LatLongMetric *) 0 ;
  Xapian::LatLongCoords *arg2 = 0 ;
  Xapian::LatLongCoords *arg3 = 0 ;
  double result;
  
  SWIG_check_num_args("Xapian::LatLongMetric::operator ()",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LatLongMetric::operator ()",1,"Xapian::LatLongMetric const *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::LatLongMetric::operator ()",2,"Xapian::LatLongCoords const &");
  if(!lua_isuserdata(L,3)) SWIG_fail_arg("Xapian::LatLongMetric::operator ()",3,"Xapian::LatLongCoords const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LatLongMetric,0))){
    SWIG_fail_ptr("LatLongMetric___call",1,SWIGTYPE_p_Xapian__LatLongMetric);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__LatLongCoords,0))){
    SWIG_fail_ptr("LatLongMetric___call",2,SWIGTYPE_p_Xapian__LatLongCoords);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_Xapian__LatLongCoords,0))){
    SWIG_fail_ptr("LatLongMetric___call",3,SWIGTYPE_p_Xapian__LatLongCoords);
  }
  
  {
    try {
      result = (double)((Xapian::LatLongMetric const *)arg1)->operator ()((Xapian::LatLongCoords const &)*arg2,(Xapian::LatLongCoords 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_LatLongMetric___call__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongMetric *arg1 = (Xapian::LatLongMetric *) 0 ;
  Xapian::LatLongCoords *arg2 = 0 ;
  std::string *arg3 = 0 ;
  std::string temp3 ;
  double result;
  
  SWIG_check_num_args("Xapian::LatLongMetric::operator ()",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LatLongMetric::operator ()",1,"Xapian::LatLongMetric const *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::LatLongMetric::operator ()",2,"Xapian::LatLongCoords const &");
  if(!lua_isstring(L,3)) SWIG_fail_arg("Xapian::LatLongMetric::operator ()",3,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LatLongMetric,0))){
    SWIG_fail_ptr("LatLongMetric___call",1,SWIGTYPE_p_Xapian__LatLongMetric);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__LatLongCoords,0))){
    SWIG_fail_ptr("LatLongMetric___call",2,SWIGTYPE_p_Xapian__LatLongCoords);
  }
  
  temp3.assign(lua_tostring(L,3),lua_rawlen(L,3)); arg3=&temp3;
  {
    try {
      result = (double)((Xapian::LatLongMetric const *)arg1)->operator ()((Xapian::LatLongCoords const &)*arg2,(std::string 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_LatLongMetric___call__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongMetric *arg1 = (Xapian::LatLongMetric *) 0 ;
  Xapian::LatLongCoords *arg2 = 0 ;
  char *arg3 = (char *) 0 ;
  size_t arg4 ;
  double result;
  
  SWIG_check_num_args("Xapian::LatLongMetric::operator ()",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LatLongMetric::operator ()",1,"Xapian::LatLongMetric const *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::LatLongMetric::operator ()",2,"Xapian::LatLongCoords const &");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("Xapian::LatLongMetric::operator ()",3,"char const *");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::LatLongMetric::operator ()",4,"size_t");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LatLongMetric,0))){
    SWIG_fail_ptr("LatLongMetric___call",1,SWIGTYPE_p_Xapian__LatLongMetric);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__LatLongCoords,0))){
    SWIG_fail_ptr("LatLongMetric___call",2,SWIGTYPE_p_Xapian__LatLongCoords);
  }
  
  arg3 = (char *)lua_tostring(L, 3);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (size_t)lua_tonumber(L, 4);
  {
    try {
      result = (double)((Xapian::LatLongMetric const *)arg1)->operator ()((Xapian::LatLongCoords const &)*arg2,(char const *)arg3,arg4);
    } 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_LatLongMetric___call(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__LatLongMetric, 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__LatLongCoords, 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__LatLongCoords, 0)) {
            _v = 0;
          } else {
            _v = 1;
          }
        }
        if (_v) {
          return _wrap_LatLongMetric___call__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__LatLongMetric, 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__LatLongCoords, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        {
          _v = lua_isstring(L,argv[2]);
        }
        if (_v) {
          return _wrap_LatLongMetric___call__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__LatLongMetric, 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__LatLongCoords, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        {
          _v = SWIG_lua_isnilstring(L,argv[2]);
        }
        if (_v) {
          {
            _v = lua_isnumber(L,argv[3]);
          }
          if (_v) {
            return _wrap_LatLongMetric___call__SWIG_2(L);
          }
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'LatLongMetric___call'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::LatLongMetric::operator ()(Xapian::LatLongCoords const &,Xapian::LatLongCoords const &) const\n"
    "    Xapian::LatLongMetric::operator ()(Xapian::LatLongCoords const &,std::string const &) const\n"
    "    Xapian::LatLongMetric::operator ()(Xapian::LatLongCoords const &,char const *,size_t) const\n");
  lua_error(L);return 0;
}


static int _wrap_LatLongMetric_name(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongMetric *arg1 = (Xapian::LatLongMetric *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::LatLongMetric::name",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LatLongMetric::name",1,"Xapian::LatLongMetric const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LatLongMetric,0))){
    SWIG_fail_ptr("LatLongMetric_name",1,SWIGTYPE_p_Xapian__LatLongMetric);
  }
  
  {
    try {
      result = ((Xapian::LatLongMetric 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 void swig_delete_LatLongMetric(void *obj) {
Xapian::LatLongMetric *arg1 = (Xapian::LatLongMetric *) obj;
delete arg1;
}
static swig_lua_attribute swig_LatLongMetric_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_LatLongMetric_methods[]= {
    { "pointwise_distance", _wrap_LatLongMetric_pointwise_distance},
    { "__call", _wrap_LatLongMetric___call},
    { "name", _wrap_LatLongMetric_name},
    {0,0}
};
static swig_lua_method swig_LatLongMetric_meta[] = {
    { "__call", _wrap_LatLongMetric___call},
    {0,0}
};

static swig_lua_attribute swig_LatLongMetric_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_LatLongMetric_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_LatLongMetric_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_LatLongMetric_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_LatLongMetric_Sf_SwigStatic = {
    "LatLongMetric",
    swig_LatLongMetric_Sf_SwigStatic_methods,
    swig_LatLongMetric_Sf_SwigStatic_attributes,
    swig_LatLongMetric_Sf_SwigStatic_constants,
    swig_LatLongMetric_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_LatLongMetric_bases[] = {0};
static const char *swig_LatLongMetric_base_names[] = {0};
static swig_lua_class _wrap_class_LatLongMetric = { "LatLongMetric", "LatLongMetric", &SWIGTYPE_p_Xapian__LatLongMetric,0, swig_delete_LatLongMetric, swig_LatLongMetric_methods, swig_LatLongMetric_attributes, &swig_LatLongMetric_Sf_SwigStatic, swig_LatLongMetric_meta, swig_LatLongMetric_bases, swig_LatLongMetric_base_names };

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


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


static int _wrap_new_GreatCircleMetric(lua_State* L) {
  int argc;
  int argv[2]={
    1,2
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_GreatCircleMetric__SWIG_0(L);
  }
  if (argc == 1) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_GreatCircleMetric__SWIG_1(L);
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_GreatCircleMetric'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::GreatCircleMetric::GreatCircleMetric()\n"
    "    Xapian::GreatCircleMetric::GreatCircleMetric(double)\n");
  lua_error(L);return 0;
}


static int _wrap_GreatCircleMetric_pointwise_distance(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::GreatCircleMetric *arg1 = (Xapian::GreatCircleMetric *) 0 ;
  Xapian::LatLongCoord *arg2 = 0 ;
  Xapian::LatLongCoord *arg3 = 0 ;
  double result;
  
  SWIG_check_num_args("Xapian::GreatCircleMetric::pointwise_distance",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::GreatCircleMetric::pointwise_distance",1,"Xapian::GreatCircleMetric const *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::GreatCircleMetric::pointwise_distance",2,"Xapian::LatLongCoord const &");
  if(!lua_isuserdata(L,3)) SWIG_fail_arg("Xapian::GreatCircleMetric::pointwise_distance",3,"Xapian::LatLongCoord const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__GreatCircleMetric,0))){
    SWIG_fail_ptr("GreatCircleMetric_pointwise_distance",1,SWIGTYPE_p_Xapian__GreatCircleMetric);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__LatLongCoord,0))){
    SWIG_fail_ptr("GreatCircleMetric_pointwise_distance",2,SWIGTYPE_p_Xapian__LatLongCoord);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_Xapian__LatLongCoord,0))){
    SWIG_fail_ptr("GreatCircleMetric_pointwise_distance",3,SWIGTYPE_p_Xapian__LatLongCoord);
  }
  
  {
    try {
      result = (double)((Xapian::GreatCircleMetric const *)arg1)->pointwise_distance((Xapian::LatLongCoord const &)*arg2,(Xapian::LatLongCoord 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_GreatCircleMetric_name(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::GreatCircleMetric *arg1 = (Xapian::GreatCircleMetric *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::GreatCircleMetric::name",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::GreatCircleMetric::name",1,"Xapian::GreatCircleMetric const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__GreatCircleMetric,0))){
    SWIG_fail_ptr("GreatCircleMetric_name",1,SWIGTYPE_p_Xapian__GreatCircleMetric);
  }
  
  {
    try {
      result = ((Xapian::GreatCircleMetric 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 void swig_delete_GreatCircleMetric(void *obj) {
Xapian::GreatCircleMetric *arg1 = (Xapian::GreatCircleMetric *) obj;
delete arg1;
}
static int _proxy__wrap_new_GreatCircleMetric(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_GreatCircleMetric);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_GreatCircleMetric_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_GreatCircleMetric_methods[]= {
    { "pointwise_distance", _wrap_GreatCircleMetric_pointwise_distance},
    { "name", _wrap_GreatCircleMetric_name},
    {0,0}
};
static swig_lua_method swig_GreatCircleMetric_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_GreatCircleMetric_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_GreatCircleMetric_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_GreatCircleMetric_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_GreatCircleMetric_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_GreatCircleMetric_Sf_SwigStatic = {
    "GreatCircleMetric",
    swig_GreatCircleMetric_Sf_SwigStatic_methods,
    swig_GreatCircleMetric_Sf_SwigStatic_attributes,
    swig_GreatCircleMetric_Sf_SwigStatic_constants,
    swig_GreatCircleMetric_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_GreatCircleMetric_bases[] = {0,0};
static const char *swig_GreatCircleMetric_base_names[] = {"Xapian::LatLongMetric *",0};
static swig_lua_class _wrap_class_GreatCircleMetric = { "GreatCircleMetric", "GreatCircleMetric", &SWIGTYPE_p_Xapian__GreatCircleMetric,_proxy__wrap_new_GreatCircleMetric, swig_delete_GreatCircleMetric, swig_GreatCircleMetric_methods, swig_GreatCircleMetric_attributes, &swig_GreatCircleMetric_Sf_SwigStatic, swig_GreatCircleMetric_meta, swig_GreatCircleMetric_bases, swig_GreatCircleMetric_base_names };

static int _wrap_new_LatLongDistancePostingSource__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  Xapian::LatLongCoords *arg2 = 0 ;
  Xapian::LatLongMetric *arg3 = 0 ;
  double arg4 ;
  double arg5 ;
  double arg6 ;
  Xapian::LatLongDistancePostingSource *result = 0 ;
  
  SWIG_check_num_args("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",6,6)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",1,"Xapian::valueno");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",2,"Xapian::LatLongCoords const &");
  if(!lua_isuserdata(L,3)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",3,"Xapian::LatLongMetric const &");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",4,"double");
  if(!lua_isnumber(L,5)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",5,"double");
  if(!lua_isnumber(L,6)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",6,"double");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__LatLongCoords,0))){
    SWIG_fail_ptr("new_LatLongDistancePostingSource",2,SWIGTYPE_p_Xapian__LatLongCoords);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_Xapian__LatLongMetric,0))){
    SWIG_fail_ptr("new_LatLongDistancePostingSource",3,SWIGTYPE_p_Xapian__LatLongMetric);
  }
  
  arg4 = (double)lua_tonumber(L, 4);
  arg5 = (double)lua_tonumber(L, 5);
  arg6 = (double)lua_tonumber(L, 6);
  {
    try {
      result = (Xapian::LatLongDistancePostingSource *)new Xapian::LatLongDistancePostingSource(arg1,(Xapian::LatLongCoords const &)*arg2,(Xapian::LatLongMetric const &)*arg3,arg4,arg5,arg6);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__LatLongDistancePostingSource,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_LatLongDistancePostingSource__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  Xapian::LatLongCoords *arg2 = 0 ;
  Xapian::LatLongMetric *arg3 = 0 ;
  double arg4 ;
  double arg5 ;
  Xapian::LatLongDistancePostingSource *result = 0 ;
  
  SWIG_check_num_args("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",5,5)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",1,"Xapian::valueno");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",2,"Xapian::LatLongCoords const &");
  if(!lua_isuserdata(L,3)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",3,"Xapian::LatLongMetric const &");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",4,"double");
  if(!lua_isnumber(L,5)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",5,"double");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__LatLongCoords,0))){
    SWIG_fail_ptr("new_LatLongDistancePostingSource",2,SWIGTYPE_p_Xapian__LatLongCoords);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_Xapian__LatLongMetric,0))){
    SWIG_fail_ptr("new_LatLongDistancePostingSource",3,SWIGTYPE_p_Xapian__LatLongMetric);
  }
  
  arg4 = (double)lua_tonumber(L, 4);
  arg5 = (double)lua_tonumber(L, 5);
  {
    try {
      result = (Xapian::LatLongDistancePostingSource *)new Xapian::LatLongDistancePostingSource(arg1,(Xapian::LatLongCoords const &)*arg2,(Xapian::LatLongMetric const &)*arg3,arg4,arg5);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__LatLongDistancePostingSource,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_LatLongDistancePostingSource__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  Xapian::LatLongCoords *arg2 = 0 ;
  Xapian::LatLongMetric *arg3 = 0 ;
  double arg4 ;
  Xapian::LatLongDistancePostingSource *result = 0 ;
  
  SWIG_check_num_args("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",4,4)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",1,"Xapian::valueno");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",2,"Xapian::LatLongCoords const &");
  if(!lua_isuserdata(L,3)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",3,"Xapian::LatLongMetric const &");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",4,"double");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__LatLongCoords,0))){
    SWIG_fail_ptr("new_LatLongDistancePostingSource",2,SWIGTYPE_p_Xapian__LatLongCoords);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_Xapian__LatLongMetric,0))){
    SWIG_fail_ptr("new_LatLongDistancePostingSource",3,SWIGTYPE_p_Xapian__LatLongMetric);
  }
  
  arg4 = (double)lua_tonumber(L, 4);
  {
    try {
      result = (Xapian::LatLongDistancePostingSource *)new Xapian::LatLongDistancePostingSource(arg1,(Xapian::LatLongCoords const &)*arg2,(Xapian::LatLongMetric const &)*arg3,arg4);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__LatLongDistancePostingSource,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_LatLongDistancePostingSource__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  Xapian::LatLongCoords *arg2 = 0 ;
  Xapian::LatLongMetric *arg3 = 0 ;
  Xapian::LatLongDistancePostingSource *result = 0 ;
  
  SWIG_check_num_args("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",3,3)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",1,"Xapian::valueno");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",2,"Xapian::LatLongCoords const &");
  if(!lua_isuserdata(L,3)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",3,"Xapian::LatLongMetric const &");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__LatLongCoords,0))){
    SWIG_fail_ptr("new_LatLongDistancePostingSource",2,SWIGTYPE_p_Xapian__LatLongCoords);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_Xapian__LatLongMetric,0))){
    SWIG_fail_ptr("new_LatLongDistancePostingSource",3,SWIGTYPE_p_Xapian__LatLongMetric);
  }
  
  {
    try {
      result = (Xapian::LatLongDistancePostingSource *)new Xapian::LatLongDistancePostingSource(arg1,(Xapian::LatLongCoords const &)*arg2,(Xapian::LatLongMetric const &)*arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__LatLongDistancePostingSource,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_LatLongDistancePostingSource__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  Xapian::LatLongCoords *arg2 = 0 ;
  double arg3 ;
  double arg4 ;
  double arg5 ;
  Xapian::LatLongDistancePostingSource *result = 0 ;
  
  SWIG_check_num_args("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",5,5)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",1,"Xapian::valueno");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",2,"Xapian::LatLongCoords const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",3,"double");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",4,"double");
  if(!lua_isnumber(L,5)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",5,"double");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__LatLongCoords,0))){
    SWIG_fail_ptr("new_LatLongDistancePostingSource",2,SWIGTYPE_p_Xapian__LatLongCoords);
  }
  
  arg3 = (double)lua_tonumber(L, 3);
  arg4 = (double)lua_tonumber(L, 4);
  arg5 = (double)lua_tonumber(L, 5);
  {
    try {
      result = (Xapian::LatLongDistancePostingSource *)new Xapian::LatLongDistancePostingSource(arg1,(Xapian::LatLongCoords const &)*arg2,arg3,arg4,arg5);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__LatLongDistancePostingSource,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_LatLongDistancePostingSource__SWIG_5(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  Xapian::LatLongCoords *arg2 = 0 ;
  double arg3 ;
  double arg4 ;
  Xapian::LatLongDistancePostingSource *result = 0 ;
  
  SWIG_check_num_args("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",4,4)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",1,"Xapian::valueno");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",2,"Xapian::LatLongCoords const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",3,"double");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",4,"double");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__LatLongCoords,0))){
    SWIG_fail_ptr("new_LatLongDistancePostingSource",2,SWIGTYPE_p_Xapian__LatLongCoords);
  }
  
  arg3 = (double)lua_tonumber(L, 3);
  arg4 = (double)lua_tonumber(L, 4);
  {
    try {
      result = (Xapian::LatLongDistancePostingSource *)new Xapian::LatLongDistancePostingSource(arg1,(Xapian::LatLongCoords const &)*arg2,arg3,arg4);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__LatLongDistancePostingSource,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_LatLongDistancePostingSource__SWIG_6(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  Xapian::LatLongCoords *arg2 = 0 ;
  double arg3 ;
  Xapian::LatLongDistancePostingSource *result = 0 ;
  
  SWIG_check_num_args("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",3,3)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",1,"Xapian::valueno");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",2,"Xapian::LatLongCoords const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",3,"double");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__LatLongCoords,0))){
    SWIG_fail_ptr("new_LatLongDistancePostingSource",2,SWIGTYPE_p_Xapian__LatLongCoords);
  }
  
  arg3 = (double)lua_tonumber(L, 3);
  {
    try {
      result = (Xapian::LatLongDistancePostingSource *)new Xapian::LatLongDistancePostingSource(arg1,(Xapian::LatLongCoords const &)*arg2,arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__LatLongDistancePostingSource,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_LatLongDistancePostingSource__SWIG_7(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  Xapian::LatLongCoords *arg2 = 0 ;
  Xapian::LatLongDistancePostingSource *result = 0 ;
  
  SWIG_check_num_args("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",2,2)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",1,"Xapian::valueno");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource",2,"Xapian::LatLongCoords const &");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__LatLongCoords,0))){
    SWIG_fail_ptr("new_LatLongDistancePostingSource",2,SWIGTYPE_p_Xapian__LatLongCoords);
  }
  
  {
    try {
      result = (Xapian::LatLongDistancePostingSource *)new Xapian::LatLongDistancePostingSource(arg1,(Xapian::LatLongCoords const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__LatLongDistancePostingSource,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_LatLongDistancePostingSource(lua_State* L) {
  int argc;
  int argv[7]={
    1,2,3,4,5,6,7
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    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__LatLongCoords, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        return _wrap_new_LatLongDistancePostingSource__SWIG_7(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__LatLongCoords, 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__LatLongMetric, 0)) {
            _v = 0;
          } else {
            _v = 1;
          }
        }
        if (_v) {
          return _wrap_new_LatLongDistancePostingSource__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__LatLongCoords, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_new_LatLongDistancePostingSource__SWIG_6(L);
        }
      }
    }
  }
  if (argc == 4) {
    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__LatLongCoords, 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__LatLongMetric, 0)) {
            _v = 0;
          } else {
            _v = 1;
          }
        }
        if (_v) {
          {
            _v = lua_isnumber(L,argv[3]);
          }
          if (_v) {
            return _wrap_new_LatLongDistancePostingSource__SWIG_2(L);
          }
        }
      }
    }
  }
  if (argc == 4) {
    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__LatLongCoords, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          {
            _v = lua_isnumber(L,argv[3]);
          }
          if (_v) {
            return _wrap_new_LatLongDistancePostingSource__SWIG_5(L);
          }
        }
      }
    }
  }
  if (argc == 5) {
    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__LatLongCoords, 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__LatLongMetric, 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_new_LatLongDistancePostingSource__SWIG_1(L);
            }
          }
        }
      }
    }
  }
  if (argc == 5) {
    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__LatLongCoords, 0)) {
          _v = 0;
        } else {
          _v = 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_LatLongDistancePostingSource__SWIG_4(L);
            }
          }
        }
      }
    }
  }
  if (argc == 6) {
    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__LatLongCoords, 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__LatLongMetric, 0)) {
            _v = 0;
          } else {
            _v = 1;
          }
        }
        if (_v) {
          {
            _v = lua_isnumber(L,argv[3]);
          }
          if (_v) {
            {
              _v = lua_isnumber(L,argv[4]);
            }
            if (_v) {
              {
                _v = lua_isnumber(L,argv[5]);
              }
              if (_v) {
                return _wrap_new_LatLongDistancePostingSource__SWIG_0(L);
              }
            }
          }
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_LatLongDistancePostingSource'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource(Xapian::valueno,Xapian::LatLongCoords const &,Xapian::LatLongMetric const &,double,double,double)\n"
    "    Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource(Xapian::valueno,Xapian::LatLongCoords const &,Xapian::LatLongMetric const &,double,double)\n"
    "    Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource(Xapian::valueno,Xapian::LatLongCoords const &,Xapian::LatLongMetric const &,double)\n"
    "    Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource(Xapian::valueno,Xapian::LatLongCoords const &,Xapian::LatLongMetric const &)\n"
    "    Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource(Xapian::valueno,Xapian::LatLongCoords const &,double,double,double)\n"
    "    Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource(Xapian::valueno,Xapian::LatLongCoords const &,double,double)\n"
    "    Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource(Xapian::valueno,Xapian::LatLongCoords const &,double)\n"
    "    Xapian::LatLongDistancePostingSource::LatLongDistancePostingSource(Xapian::valueno,Xapian::LatLongCoords const &)\n");
  lua_error(L);return 0;
}


static int _wrap_LatLongDistancePostingSource_next(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongDistancePostingSource *arg1 = (Xapian::LatLongDistancePostingSource *) 0 ;
  double arg2 ;
  
  SWIG_check_num_args("Xapian::LatLongDistancePostingSource::next",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::next",1,"Xapian::LatLongDistancePostingSource *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::next",2,"double");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LatLongDistancePostingSource,0))){
    SWIG_fail_ptr("LatLongDistancePostingSource_next",1,SWIGTYPE_p_Xapian__LatLongDistancePostingSource);
  }
  
  arg2 = (double)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_LatLongDistancePostingSource_skip_to(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongDistancePostingSource *arg1 = (Xapian::LatLongDistancePostingSource *) 0 ;
  Xapian::docid arg2 ;
  double arg3 ;
  
  SWIG_check_num_args("Xapian::LatLongDistancePostingSource::skip_to",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::skip_to",1,"Xapian::LatLongDistancePostingSource *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::skip_to",2,"Xapian::docid");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::skip_to",3,"double");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LatLongDistancePostingSource,0))){
    SWIG_fail_ptr("LatLongDistancePostingSource_skip_to",1,SWIGTYPE_p_Xapian__LatLongDistancePostingSource);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::docid)lua_tonumber(L, 2);
  arg3 = (double)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_LatLongDistancePostingSource_check(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongDistancePostingSource *arg1 = (Xapian::LatLongDistancePostingSource *) 0 ;
  Xapian::docid arg2 ;
  double arg3 ;
  bool result;
  
  SWIG_check_num_args("Xapian::LatLongDistancePostingSource::check",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::check",1,"Xapian::LatLongDistancePostingSource *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::check",2,"Xapian::docid");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::check",3,"double");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LatLongDistancePostingSource,0))){
    SWIG_fail_ptr("LatLongDistancePostingSource_check",1,SWIGTYPE_p_Xapian__LatLongDistancePostingSource);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (Xapian::docid)lua_tonumber(L, 2);
  arg3 = (double)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_LatLongDistancePostingSource_get_weight(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongDistancePostingSource *arg1 = (Xapian::LatLongDistancePostingSource *) 0 ;
  double result;
  
  SWIG_check_num_args("Xapian::LatLongDistancePostingSource::get_weight",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::get_weight",1,"Xapian::LatLongDistancePostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LatLongDistancePostingSource,0))){
    SWIG_fail_ptr("LatLongDistancePostingSource_get_weight",1,SWIGTYPE_p_Xapian__LatLongDistancePostingSource);
  }
  
  {
    try {
      result = (double)((Xapian::LatLongDistancePostingSource 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_LatLongDistancePostingSource_name(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongDistancePostingSource *arg1 = (Xapian::LatLongDistancePostingSource *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::LatLongDistancePostingSource::name",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::name",1,"Xapian::LatLongDistancePostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LatLongDistancePostingSource,0))){
    SWIG_fail_ptr("LatLongDistancePostingSource_name",1,SWIGTYPE_p_Xapian__LatLongDistancePostingSource);
  }
  
  {
    try {
      result = ((Xapian::LatLongDistancePostingSource 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_LatLongDistancePostingSource_init(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongDistancePostingSource *arg1 = (Xapian::LatLongDistancePostingSource *) 0 ;
  Xapian::Database *arg2 = 0 ;
  
  SWIG_check_num_args("Xapian::LatLongDistancePostingSource::init",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::init",1,"Xapian::LatLongDistancePostingSource *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::init",2,"Xapian::Database const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LatLongDistancePostingSource,0))){
    SWIG_fail_ptr("LatLongDistancePostingSource_init",1,SWIGTYPE_p_Xapian__LatLongDistancePostingSource);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("LatLongDistancePostingSource_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_LatLongDistancePostingSource___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongDistancePostingSource *arg1 = (Xapian::LatLongDistancePostingSource *) 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::LatLongDistancePostingSource::get_description",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LatLongDistancePostingSource::get_description",1,"Xapian::LatLongDistancePostingSource const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LatLongDistancePostingSource,0))){
    SWIG_fail_ptr("LatLongDistancePostingSource___tostring",1,SWIGTYPE_p_Xapian__LatLongDistancePostingSource);
  }
  
  {
    try {
      result = ((Xapian::LatLongDistancePostingSource 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_LatLongDistancePostingSource(void *obj) {
Xapian::LatLongDistancePostingSource *arg1 = (Xapian::LatLongDistancePostingSource *) obj;
delete arg1;
}
static int _proxy__wrap_new_LatLongDistancePostingSource(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_LatLongDistancePostingSource);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_LatLongDistancePostingSource_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_LatLongDistancePostingSource_methods[]= {
    { "next", _wrap_LatLongDistancePostingSource_next},
    { "skip_to", _wrap_LatLongDistancePostingSource_skip_to},
    { "check", _wrap_LatLongDistancePostingSource_check},
    { "get_weight", _wrap_LatLongDistancePostingSource_get_weight},
    { "name", _wrap_LatLongDistancePostingSource_name},
    { "init", _wrap_LatLongDistancePostingSource_init},
    { "__tostring", _wrap_LatLongDistancePostingSource___tostring},
    {0,0}
};
static swig_lua_method swig_LatLongDistancePostingSource_meta[] = {
    { "__tostring", _wrap_LatLongDistancePostingSource___tostring},
    {0,0}
};

static swig_lua_attribute swig_LatLongDistancePostingSource_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_LatLongDistancePostingSource_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_LatLongDistancePostingSource_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_LatLongDistancePostingSource_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_LatLongDistancePostingSource_Sf_SwigStatic = {
    "LatLongDistancePostingSource",
    swig_LatLongDistancePostingSource_Sf_SwigStatic_methods,
    swig_LatLongDistancePostingSource_Sf_SwigStatic_attributes,
    swig_LatLongDistancePostingSource_Sf_SwigStatic_constants,
    swig_LatLongDistancePostingSource_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_LatLongDistancePostingSource_bases[] = {0,0};
static const char *swig_LatLongDistancePostingSource_base_names[] = {"Xapian::ValuePostingSource *",0};
static swig_lua_class _wrap_class_LatLongDistancePostingSource = { "LatLongDistancePostingSource", "LatLongDistancePostingSource", &SWIGTYPE_p_Xapian__LatLongDistancePostingSource,_proxy__wrap_new_LatLongDistancePostingSource, swig_delete_LatLongDistancePostingSource, swig_LatLongDistancePostingSource_methods, swig_LatLongDistancePostingSource_attributes, &swig_LatLongDistancePostingSource_Sf_SwigStatic, swig_LatLongDistancePostingSource_meta, swig_LatLongDistancePostingSource_bases, swig_LatLongDistancePostingSource_base_names };

static int _wrap_new_LatLongDistanceKeyMaker__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  Xapian::LatLongCoords *arg2 = 0 ;
  Xapian::LatLongMetric *arg3 = 0 ;
  double arg4 ;
  Xapian::LatLongDistanceKeyMaker *result = 0 ;
  
  SWIG_check_num_args("Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker",4,4)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker",1,"Xapian::valueno");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker",2,"Xapian::LatLongCoords const &");
  if(!lua_isuserdata(L,3)) SWIG_fail_arg("Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker",3,"Xapian::LatLongMetric const &");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker",4,"double");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__LatLongCoords,0))){
    SWIG_fail_ptr("new_LatLongDistanceKeyMaker",2,SWIGTYPE_p_Xapian__LatLongCoords);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_Xapian__LatLongMetric,0))){
    SWIG_fail_ptr("new_LatLongDistanceKeyMaker",3,SWIGTYPE_p_Xapian__LatLongMetric);
  }
  
  arg4 = (double)lua_tonumber(L, 4);
  {
    try {
      result = (Xapian::LatLongDistanceKeyMaker *)new Xapian::LatLongDistanceKeyMaker(arg1,(Xapian::LatLongCoords const &)*arg2,(Xapian::LatLongMetric const &)*arg3,arg4);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__LatLongDistanceKeyMaker,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_LatLongDistanceKeyMaker__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  Xapian::LatLongCoords *arg2 = 0 ;
  Xapian::LatLongMetric *arg3 = 0 ;
  Xapian::LatLongDistanceKeyMaker *result = 0 ;
  
  SWIG_check_num_args("Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker",3,3)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker",1,"Xapian::valueno");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker",2,"Xapian::LatLongCoords const &");
  if(!lua_isuserdata(L,3)) SWIG_fail_arg("Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker",3,"Xapian::LatLongMetric const &");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__LatLongCoords,0))){
    SWIG_fail_ptr("new_LatLongDistanceKeyMaker",2,SWIGTYPE_p_Xapian__LatLongCoords);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_Xapian__LatLongMetric,0))){
    SWIG_fail_ptr("new_LatLongDistanceKeyMaker",3,SWIGTYPE_p_Xapian__LatLongMetric);
  }
  
  {
    try {
      result = (Xapian::LatLongDistanceKeyMaker *)new Xapian::LatLongDistanceKeyMaker(arg1,(Xapian::LatLongCoords const &)*arg2,(Xapian::LatLongMetric const &)*arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__LatLongDistanceKeyMaker,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_LatLongDistanceKeyMaker__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  Xapian::LatLongCoords *arg2 = 0 ;
  Xapian::LatLongDistanceKeyMaker *result = 0 ;
  
  SWIG_check_num_args("Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker",2,2)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker",1,"Xapian::valueno");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker",2,"Xapian::LatLongCoords const &");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__LatLongCoords,0))){
    SWIG_fail_ptr("new_LatLongDistanceKeyMaker",2,SWIGTYPE_p_Xapian__LatLongCoords);
  }
  
  {
    try {
      result = (Xapian::LatLongDistanceKeyMaker *)new Xapian::LatLongDistanceKeyMaker(arg1,(Xapian::LatLongCoords const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__LatLongDistanceKeyMaker,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_LatLongDistanceKeyMaker__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  Xapian::LatLongCoord *arg2 = 0 ;
  Xapian::LatLongMetric *arg3 = 0 ;
  double arg4 ;
  Xapian::LatLongDistanceKeyMaker *result = 0 ;
  
  SWIG_check_num_args("Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker",4,4)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker",1,"Xapian::valueno");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker",2,"Xapian::LatLongCoord const &");
  if(!lua_isuserdata(L,3)) SWIG_fail_arg("Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker",3,"Xapian::LatLongMetric const &");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker",4,"double");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__LatLongCoord,0))){
    SWIG_fail_ptr("new_LatLongDistanceKeyMaker",2,SWIGTYPE_p_Xapian__LatLongCoord);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_Xapian__LatLongMetric,0))){
    SWIG_fail_ptr("new_LatLongDistanceKeyMaker",3,SWIGTYPE_p_Xapian__LatLongMetric);
  }
  
  arg4 = (double)lua_tonumber(L, 4);
  {
    try {
      result = (Xapian::LatLongDistanceKeyMaker *)new Xapian::LatLongDistanceKeyMaker(arg1,(Xapian::LatLongCoord const &)*arg2,(Xapian::LatLongMetric const &)*arg3,arg4);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__LatLongDistanceKeyMaker,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_LatLongDistanceKeyMaker__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  Xapian::LatLongCoord *arg2 = 0 ;
  Xapian::LatLongMetric *arg3 = 0 ;
  Xapian::LatLongDistanceKeyMaker *result = 0 ;
  
  SWIG_check_num_args("Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker",3,3)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker",1,"Xapian::valueno");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker",2,"Xapian::LatLongCoord const &");
  if(!lua_isuserdata(L,3)) SWIG_fail_arg("Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker",3,"Xapian::LatLongMetric const &");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__LatLongCoord,0))){
    SWIG_fail_ptr("new_LatLongDistanceKeyMaker",2,SWIGTYPE_p_Xapian__LatLongCoord);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_Xapian__LatLongMetric,0))){
    SWIG_fail_ptr("new_LatLongDistanceKeyMaker",3,SWIGTYPE_p_Xapian__LatLongMetric);
  }
  
  {
    try {
      result = (Xapian::LatLongDistanceKeyMaker *)new Xapian::LatLongDistanceKeyMaker(arg1,(Xapian::LatLongCoord const &)*arg2,(Xapian::LatLongMetric const &)*arg3);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__LatLongDistanceKeyMaker,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_LatLongDistanceKeyMaker__SWIG_5(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::valueno arg1 ;
  Xapian::LatLongCoord *arg2 = 0 ;
  Xapian::LatLongDistanceKeyMaker *result = 0 ;
  
  SWIG_check_num_args("Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker",2,2)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker",1,"Xapian::valueno");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker",2,"Xapian::LatLongCoord const &");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (Xapian::valueno)lua_tonumber(L, 1);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__LatLongCoord,0))){
    SWIG_fail_ptr("new_LatLongDistanceKeyMaker",2,SWIGTYPE_p_Xapian__LatLongCoord);
  }
  
  {
    try {
      result = (Xapian::LatLongDistanceKeyMaker *)new Xapian::LatLongDistanceKeyMaker(arg1,(Xapian::LatLongCoord const &)*arg2);
    } catch (...) {
      Xapian::handle_exception(L);
      SWIG_fail;
    }
  }
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Xapian__LatLongDistanceKeyMaker,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_LatLongDistanceKeyMaker(lua_State* L) {
  int argc;
  int argv[5]={
    1,2,3,4,5
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    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__LatLongCoords, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        return _wrap_new_LatLongDistanceKeyMaker__SWIG_2(L);
      }
    }
  }
  if (argc == 2) {
    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__LatLongCoord, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        return _wrap_new_LatLongDistanceKeyMaker__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__LatLongCoord, 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__LatLongMetric, 0)) {
            _v = 0;
          } else {
            _v = 1;
          }
        }
        if (_v) {
          return _wrap_new_LatLongDistanceKeyMaker__SWIG_4(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__LatLongCoords, 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__LatLongMetric, 0)) {
            _v = 0;
          } else {
            _v = 1;
          }
        }
        if (_v) {
          return _wrap_new_LatLongDistanceKeyMaker__SWIG_1(L);
        }
      }
    }
  }
  if (argc == 4) {
    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__LatLongCoords, 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__LatLongMetric, 0)) {
            _v = 0;
          } else {
            _v = 1;
          }
        }
        if (_v) {
          {
            _v = lua_isnumber(L,argv[3]);
          }
          if (_v) {
            return _wrap_new_LatLongDistanceKeyMaker__SWIG_0(L);
          }
        }
      }
    }
  }
  if (argc == 4) {
    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__LatLongCoord, 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__LatLongMetric, 0)) {
            _v = 0;
          } else {
            _v = 1;
          }
        }
        if (_v) {
          {
            _v = lua_isnumber(L,argv[3]);
          }
          if (_v) {
            return _wrap_new_LatLongDistanceKeyMaker__SWIG_3(L);
          }
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_LatLongDistanceKeyMaker'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker(Xapian::valueno,Xapian::LatLongCoords const &,Xapian::LatLongMetric const &,double)\n"
    "    Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker(Xapian::valueno,Xapian::LatLongCoords const &,Xapian::LatLongMetric const &)\n"
    "    Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker(Xapian::valueno,Xapian::LatLongCoords const &)\n"
    "    Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker(Xapian::valueno,Xapian::LatLongCoord const &,Xapian::LatLongMetric const &,double)\n"
    "    Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker(Xapian::valueno,Xapian::LatLongCoord const &,Xapian::LatLongMetric const &)\n"
    "    Xapian::LatLongDistanceKeyMaker::LatLongDistanceKeyMaker(Xapian::valueno,Xapian::LatLongCoord const &)\n");
  lua_error(L);return 0;
}


static int _wrap_LatLongDistanceKeyMaker___call(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::LatLongDistanceKeyMaker *arg1 = (Xapian::LatLongDistanceKeyMaker *) 0 ;
  Xapian::Document *arg2 = 0 ;
  std::string result;
  
  SWIG_check_num_args("Xapian::LatLongDistanceKeyMaker::operator ()",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::LatLongDistanceKeyMaker::operator ()",1,"Xapian::LatLongDistanceKeyMaker const *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("Xapian::LatLongDistanceKeyMaker::operator ()",2,"Xapian::Document const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__LatLongDistanceKeyMaker,0))){
    SWIG_fail_ptr("LatLongDistanceKeyMaker___call",1,SWIGTYPE_p_Xapian__LatLongDistanceKeyMaker);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Xapian__Document,0))){
    SWIG_fail_ptr("LatLongDistanceKeyMaker___call",2,SWIGTYPE_p_Xapian__Document);
  }
  
  {
    try {
      result = ((Xapian::LatLongDistanceKeyMaker 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_LatLongDistanceKeyMaker(void *obj) {
Xapian::LatLongDistanceKeyMaker *arg1 = (Xapian::LatLongDistanceKeyMaker *) obj;
delete arg1;
}
static int _proxy__wrap_new_LatLongDistanceKeyMaker(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_LatLongDistanceKeyMaker);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_LatLongDistanceKeyMaker_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_LatLongDistanceKeyMaker_methods[]= {
    { "__call", _wrap_LatLongDistanceKeyMaker___call},
    {0,0}
};
static swig_lua_method swig_LatLongDistanceKeyMaker_meta[] = {
    { "__call", _wrap_LatLongDistanceKeyMaker___call},
    {0,0}
};

static swig_lua_attribute swig_LatLongDistanceKeyMaker_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_LatLongDistanceKeyMaker_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_LatLongDistanceKeyMaker_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_LatLongDistanceKeyMaker_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_LatLongDistanceKeyMaker_Sf_SwigStatic = {
    "LatLongDistanceKeyMaker",
    swig_LatLongDistanceKeyMaker_Sf_SwigStatic_methods,
    swig_LatLongDistanceKeyMaker_Sf_SwigStatic_attributes,
    swig_LatLongDistanceKeyMaker_Sf_SwigStatic_constants,
    swig_LatLongDistanceKeyMaker_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_LatLongDistanceKeyMaker_bases[] = {0,0};
static const char *swig_LatLongDistanceKeyMaker_base_names[] = {"Xapian::KeyMaker *",0};
static swig_lua_class _wrap_class_LatLongDistanceKeyMaker = { "LatLongDistanceKeyMaker", "LatLongDistanceKeyMaker", &SWIGTYPE_p_Xapian__LatLongDistanceKeyMaker,_proxy__wrap_new_LatLongDistanceKeyMaker, swig_delete_LatLongDistanceKeyMaker, swig_LatLongDistanceKeyMaker_methods, swig_LatLongDistanceKeyMaker_attributes, &swig_LatLongDistanceKeyMaker_Sf_SwigStatic, swig_LatLongDistanceKeyMaker_meta, swig_LatLongDistanceKeyMaker_bases, swig_LatLongDistanceKeyMaker_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 ;
  int arg2 ;
  std::string temp1 ;
  Xapian::Database *result = 0 ;
  
  SWIG_check_num_args("Xapian::Database::Database",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::Database::Database",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Database::Database",2,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  arg2 = (int)lua_tonumber(L, 2);
  {
    try {
      result = (Xapian::Database *)new Xapian::Database((std::string const &)*arg1,arg2);
    } 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;
  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_3(lua_State* L) {
  int SWIG_arg = 0;
  int arg1 ;
  int arg2 ;
  Xapian::Database *result = 0 ;
  
  SWIG_check_num_args("Xapian::Database::Database",2,2)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::Database::Database",1,"int");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Database::Database",2,"int");
  arg1 = (int)lua_tonumber(L, 1);
  arg2 = (int)lua_tonumber(L, 2);
  {
    try {
      result = (Xapian::Database *)new Xapian::Database(arg1,arg2);
    } 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_4(lua_State* L) {
  int SWIG_arg = 0;
  int arg1 ;
  Xapian::Database *result = 0 ;
  
  SWIG_check_num_args("Xapian::Database::Database",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::Database::Database",1,"int");
  arg1 = (int)lua_tonumber(L, 1);
  {
    try {
      result = (Xapian::Database *)new Xapian::Database(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[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_Database__SWIG_0(L);
  }
  if (argc == 1) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_Database__SWIG_4(L);
    }
  }
  if (argc == 1) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_Database__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_Database__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_Database__SWIG_1(L);
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 &,int)\n"
    "    Xapian::Database::Database(std::string const &)\n"
    "    Xapian::Database::Database(int,int)\n"
    "    Xapian::Database::Database(int)\n");
  lua_error(L);return 0;
}


static int _wrap_Database_reopen(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  bool result;
  
  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 {
      result = (bool)(arg1)->reopen();
    } 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_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;
  result = ((Xapian::Database const *)arg1)->postlist_end((std::string const &)*arg2);
  {
    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);
  result = ((Xapian::Database const *)arg1)->termlist_end(arg2);
  {
    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_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_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;
  result = ((Xapian::Database const *)arg1)->positionlist_end(arg2,(std::string const &)*arg3);
  {
    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 ;
  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__SWIG_1(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_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_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_allterms_begin__SWIG_0(L);
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Database_allterms_begin'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Database::allterms_begin(std::string const &) const\n"
    "    Xapian::Database::allterms_begin() const\n");
  lua_error(L);return 0;
}


static int _wrap_Database_allterms_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::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;
  result = ((Xapian::Database const *)arg1)->allterms_end((std::string const &)*arg2);
  {
    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_1(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);
  }
  
  result = ((Xapian::Database const *)arg1)->allterms_end();
  {
    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_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_allterms_end__SWIG_0(L);
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Database_allterms_end'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Database::allterms_end(std::string const &) const\n"
    "    Xapian::Database::allterms_end() 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_total_length(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::totallength result;
  
  SWIG_check_num_args("Xapian::Database::get_total_length",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::get_total_length",1,"Xapian::Database const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_get_total_length",1,SWIGTYPE_p_Xapian__Database);
  }
  
  {
    try {
      result = (Xapian::totallength)((Xapian::Database const *)arg1)->get_total_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_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);
  result = ((Xapian::Database const *)arg1)->valuestream_end(arg2);
  {
    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_get_unique_terms(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_unique_terms",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::get_unique_terms",1,"Xapian::Database const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Database::get_unique_terms",2,"Xapian::docid");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_get_unique_terms",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_unique_terms(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__SWIG_0(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 const *");
  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 = ((Xapian::Database const *)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_document__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  unsigned int arg3 ;
  Xapian::Document result;
  
  SWIG_check_num_args("Xapian::Database::get_document",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::get_document",1,"Xapian::Database const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Database::get_document",2,"Xapian::docid");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Database::get_document",3,"unsigned int");
  
  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);
  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_document(arg2,arg3);
    } 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_document(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_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_Database_get_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__Database, 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_Database_get_document__SWIG_1(L);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Database_get_document'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Database::get_document(Xapian::docid) const\n"
    "    Xapian::Database::get_document(Xapian::docid,unsigned int) const\n");
  lua_error(L);return 0;
}


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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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);
  }
  
  result = ((Xapian::Database const *)arg1)->spellings_end();
  {
    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;
  result = ((Xapian::Database const *)arg1)->synonyms_end((std::string const &)*arg2);
  {
    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);
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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;
  result = ((Xapian::Database const *)arg1)->synonym_keys_end((std::string const &)*arg2);
  {
    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);
  }
  
  result = ((Xapian::Database const *)arg1)->synonym_keys_end();
  {
    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);
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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);
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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;
  result = ((Xapian::Database const *)arg1)->metadata_keys_end((std::string const &)*arg2);
  {
    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);
  }
  
  result = ((Xapian::Database const *)arg1)->metadata_keys_end();
  {
    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);
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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_locked(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  bool result;
  
  SWIG_check_num_args("Xapian::Database::locked",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::locked",1,"Xapian::Database const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_locked",1,SWIGTYPE_p_Xapian__Database);
  }
  
  {
    try {
      result = (bool)((Xapian::Database const *)arg1)->locked();
    } 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_revision(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::rev result;
  
  SWIG_check_num_args("Xapian::Database::get_revision",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::get_revision",1,"Xapian::Database const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_get_revision",1,SWIGTYPE_p_Xapian__Database);
  }
  
  {
    try {
      result = (Xapian::rev)((Xapian::Database const *)arg1)->get_revision();
    } 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_check__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  int arg2 ;
  std::string temp1 ;
  size_t result;
  
  SWIG_check_num_args("Xapian::Database::check",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::Database::check",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Database::check",2,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  arg2 = (int)lua_tonumber(L, 2);
  {
    try {
      result = Xapian::Database::check((std::string 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_Database_check__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string temp1 ;
  size_t result;
  
  SWIG_check_num_args("Xapian::Database::check",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::Database::check",1,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  {
    try {
      result = Xapian::Database::check((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_Database_check__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  int arg1 ;
  int arg2 ;
  size_t result;
  
  SWIG_check_num_args("Xapian::Database::check",2,2)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::Database::check",1,"int");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Database::check",2,"int");
  arg1 = (int)lua_tonumber(L, 1);
  arg2 = (int)lua_tonumber(L, 2);
  {
    try {
      result = Xapian::Database::check(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_Database_check__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  int arg1 ;
  size_t result;
  
  SWIG_check_num_args("Xapian::Database::check",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Xapian::Database::check",1,"int");
  arg1 = (int)lua_tonumber(L, 1);
  {
    try {
      result = Xapian::Database::check(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_Database_check(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      return _wrap_Database_check__SWIG_3(L);
    }
  }
  if (argc == 1) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_Database_check__SWIG_1(L);
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_Database_check__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_Database_check__SWIG_0(L);
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Database_check'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Database::check(std::string const &,int)\n"
    "    Xapian::Database::check(std::string const &)\n"
    "    Xapian::Database::check(int,int)\n"
    "    Xapian::Database::check(int)\n");
  lua_error(L);return 0;
}


static int _wrap_Database_compact__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  unsigned int arg3 ;
  int arg4 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::Database::compact",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::compact",1,"Xapian::Database *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Database::compact",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Database::compact",3,"unsigned int");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::Database::compact",4,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_compact",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);
  arg4 = (int)lua_tonumber(L, 4);
  {
    try {
      (arg1)->compact((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_Database_compact__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  unsigned int arg3 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::Database::compact",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::compact",1,"Xapian::Database *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Database::compact",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Database::compact",3,"unsigned int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_compact",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 {
      (arg1)->compact((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_Database_compact__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::Database::compact",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::compact",1,"Xapian::Database *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Database::compact",2,"std::string const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_compact",1,SWIGTYPE_p_Xapian__Database);
  }
  
  temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
  {
    try {
      (arg1)->compact((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_Database_compact__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  int arg2 ;
  unsigned int arg3 ;
  int arg4 ;
  
  SWIG_check_num_args("Xapian::Database::compact",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::compact",1,"Xapian::Database *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Database::compact",2,"int");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Database::compact",3,"unsigned int");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::Database::compact",4,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_compact",1,SWIGTYPE_p_Xapian__Database);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (unsigned int)lua_tonumber(L, 3);
  arg4 = (int)lua_tonumber(L, 4);
  {
    try {
      (arg1)->compact(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_Database_compact__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  int arg2 ;
  unsigned int arg3 ;
  
  SWIG_check_num_args("Xapian::Database::compact",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::compact",1,"Xapian::Database *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Database::compact",2,"int");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Database::compact",3,"unsigned int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_compact",1,SWIGTYPE_p_Xapian__Database);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (unsigned int)lua_tonumber(L, 3);
  {
    try {
      (arg1)->compact(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_Database_compact__SWIG_5(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  int arg2 ;
  
  SWIG_check_num_args("Xapian::Database::compact",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::compact",1,"Xapian::Database *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Database::compact",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_compact",1,SWIGTYPE_p_Xapian__Database);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  {
    try {
      (arg1)->compact(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_Database_compact__SWIG_6(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  unsigned int arg3 ;
  int arg4 ;
  Xapian::Compactor *arg5 = 0 ;
  std::string temp2 ;
  
  SWIG_check_num_args("Xapian::Database::compact",5,5)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::compact",1,"Xapian::Database *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("Xapian::Database::compact",2,"std::string const &");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Database::compact",3,"unsigned int");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::Database::compact",4,"int");
  if(!lua_isuserdata(L,5)) SWIG_fail_arg("Xapian::Database::compact",5,"Xapian::Compactor &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_compact",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);
  arg4 = (int)lua_tonumber(L, 4);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,5,(void**)&arg5,SWIGTYPE_p_Xapian__Compactor,0))){
    SWIG_fail_ptr("Database_compact",5,SWIGTYPE_p_Xapian__Compactor);
  }
  
  {
    try {
      (arg1)->compact((std::string const &)*arg2,arg3,arg4,*arg5);
    } 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_compact__SWIG_7(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  int arg2 ;
  unsigned int arg3 ;
  int arg4 ;
  Xapian::Compactor *arg5 = 0 ;
  
  SWIG_check_num_args("Xapian::Database::compact",5,5)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Xapian::Database::compact",1,"Xapian::Database *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Database::compact",2,"int");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::Database::compact",3,"unsigned int");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::Database::compact",4,"int");
  if(!lua_isuserdata(L,5)) SWIG_fail_arg("Xapian::Database::compact",5,"Xapian::Compactor &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Xapian__Database,0))){
    SWIG_fail_ptr("Database_compact",1,SWIGTYPE_p_Xapian__Database);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (unsigned int)lua_tonumber(L, 3);
  arg4 = (int)lua_tonumber(L, 4);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,5,(void**)&arg5,SWIGTYPE_p_Xapian__Compactor,0))){
    SWIG_fail_ptr("Database_compact",5,SWIGTYPE_p_Xapian__Compactor);
  }
  
  {
    try {
      (arg1)->compact(arg2,arg3,arg4,*arg5);
    } 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_compact(lua_State* L) {
  int argc;
  int argv[6]={
    1,2,3,4,5,6
  };
  
  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_isnumber(L,argv[1]);
      }
      if (_v) {
        return _wrap_Database_compact__SWIG_5(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_compact__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__Database, 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_Database_compact__SWIG_4(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_compact__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__Database, 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_Database_compact__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__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) {
          {
            _v = lua_isnumber(L,argv[3]);
          }
          if (_v) {
            return _wrap_Database_compact__SWIG_0(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__Database, 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 (lua_isuserdata(L,argv[4])==0 || SWIG_ConvertPtr(L,argv[4], (void **) &ptr, SWIGTYPE_p_Xapian__Compactor, 0)) {
                _v = 0;
              } else {
                _v = 1;
              }
            }
            if (_v) {
              return _wrap_Database_compact__SWIG_7(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__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) {
          {
            _v = lua_isnumber(L,argv[3]);
          }
          if (_v) {
            {
              void *ptr;
              if (lua_isuserdata(L,argv[4])==0 || SWIG_ConvertPtr(L,argv[4], (void **) &ptr, SWIGTYPE_p_Xapian__Compactor, 0)) {
                _v = 0;
              } else {
                _v = 1;
              }
            }
            if (_v) {
              return _wrap_Database_compact__SWIG_6(L);
            }
          }
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Database_compact'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Database::compact(std::string const &,unsigned int,int)\n"
    "    Xapian::Database::compact(std::string const &,unsigned int)\n"
    "    Xapian::Database::compact(std::string const &)\n"
    "    Xapian::Database::compact(int,unsigned int,int)\n"
    "    Xapian::Database::compact(int,unsigned int)\n"
    "    Xapian::Database::compact(int)\n"
    "    Xapian::Database::compact(std::string const &,unsigned int,int,Xapian::Compactor &)\n"
    "    Xapian::Database::compact(int,unsigned int,int,Xapian::Compactor &)\n");
  lua_error(L);return 0;
}


static int _wrap_Database_allterms__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  SwigValueWrapper< 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 ;
  SwigValueWrapper< 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 ;
  SwigValueWrapper< 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 ;
  SwigValueWrapper< 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);
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 ;
  SwigValueWrapper< 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 ;
  SwigValueWrapper< 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 ;
  SwigValueWrapper< 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 int _proxy__wrap_new_Database(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_Database);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_Database_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_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},
    { "has_positions", _wrap_Database_has_positions},
    { "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_total_length", _wrap_Database_get_total_length},
    { "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},
    { "get_unique_terms", _wrap_Database_get_unique_terms},
    { "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},
    { "locked", _wrap_Database_locked},
    { "get_revision", _wrap_Database_get_revision},
    { "compact", _wrap_Database_compact},
    { "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_method swig_Database_meta[] = {
    { "__tostring", _wrap_Database___tostring},
    {0,0}
};

static swig_lua_attribute swig_Database_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_Database_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_Database_Sf_SwigStatic_methods[]= {
    { "check", _wrap_Database_check},
    {0,0}
};
static swig_lua_class* swig_Database_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_Database_Sf_SwigStatic = {
    "Database",
    swig_Database_Sf_SwigStatic_methods,
    swig_Database_Sf_SwigStatic_attributes,
    swig_Database_Sf_SwigStatic_constants,
    swig_Database_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_Database_bases[] = {0};
static const char *swig_Database_base_names[] = {0};
static swig_lua_class _wrap_class_Database = { "Database", "Database", &SWIGTYPE_p_Xapian__Database,_proxy__wrap_new_Database, swig_delete_Database, swig_Database_methods, swig_Database_attributes, &swig_Database_Sf_SwigStatic, swig_Database_meta, swig_Database_bases, swig_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 ;
  int arg3 ;
  std::string temp1 ;
  Xapian::WritableDatabase *result = 0 ;
  
  SWIG_check_num_args("Xapian::WritableDatabase::WritableDatabase",3,3)
  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");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Xapian::WritableDatabase::WritableDatabase",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::WritableDatabase *)new Xapian::WritableDatabase((std::string const &)*arg1,arg2,arg3);
    } 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;
  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_3(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string temp1 ;
  Xapian::WritableDatabase *result = 0 ;
  
  SWIG_check_num_args("Xapian::WritableDatabase::WritableDatabase",1,1)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::WritableDatabase::WritableDatabase",1,"std::string const &");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  {
    try {
      result = (Xapian::WritableDatabase *)new Xapian::WritableDatabase((std::string 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[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_WritableDatabase__SWIG_0(L);
  }
  if (argc == 1) {
    int _v;
    {
      _v = lua_isstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_WritableDatabase__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_WritableDatabase__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_new_WritableDatabase__SWIG_1(L);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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,int)\n"
    "    Xapian::WritableDatabase::WritableDatabase(std::string const &,int)\n"
    "    Xapian::WritableDatabase::WritableDatabase(std::string 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);
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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_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);
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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_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_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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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 int _proxy__wrap_new_WritableDatabase(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_WritableDatabase);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_WritableDatabase_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_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_method swig_WritableDatabase_meta[] = {
    { "__tostring", _wrap_WritableDatabase___tostring},
    {0,0}
};

static swig_lua_attribute swig_WritableDatabase_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_WritableDatabase_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_WritableDatabase_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_WritableDatabase_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_WritableDatabase_Sf_SwigStatic = {
    "WritableDatabase",
    swig_WritableDatabase_Sf_SwigStatic_methods,
    swig_WritableDatabase_Sf_SwigStatic_attributes,
    swig_WritableDatabase_Sf_SwigStatic_constants,
    swig_WritableDatabase_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_WritableDatabase_bases[] = {0,0};
static const char *swig_WritableDatabase_base_names[] = {"Xapian::Database *",0};
static swig_lua_class _wrap_class_WritableDatabase = { "WritableDatabase", "WritableDatabase", &SWIGTYPE_p_Xapian__WritableDatabase,_proxy__wrap_new_WritableDatabase, swig_delete_WritableDatabase, swig_WritableDatabase_methods, swig_WritableDatabase_attributes, &swig_WritableDatabase_Sf_SwigStatic, swig_WritableDatabase_meta, swig_WritableDatabase_bases, swig_WritableDatabase_base_names };

static int _wrap_open_stub__SWIG_0(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_open_stub__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  int arg2 ;
  std::string temp1 ;
  Xapian::WritableDatabase result;
  
  SWIG_check_num_args("Xapian::Auto::open_stub",2,2)
  if(!lua_isstring(L,1)) SWIG_fail_arg("Xapian::Auto::open_stub",1,"std::string const &");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Xapian::Auto::open_stub",2,"int");
  temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
  arg2 = (int)lua_tonumber(L, 2);
  {
    try {
      result = Xapian::Auto::open_stub((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_open_stub(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_open_stub__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_open_stub__SWIG_1(L);
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'open_stub'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Auto::open_stub(std::string const &)\n"
    "    Xapian::Auto::open_stub(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_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);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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_remote_open__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  unsigned int arg2 ;
  useconds_t arg3 ;
  useconds_t 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,"useconds_t");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::Remote::open",4,"useconds_t");
  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 = (useconds_t)lua_tonumber(L, 3);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (useconds_t)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 ;
  useconds_t 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,"useconds_t");
  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 = (useconds_t)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 ;
  useconds_t arg3 ;
  useconds_t arg4 ;
  int arg5 ;
  std::string temp1 ;
  Xapian::WritableDatabase result;
  
  SWIG_check_num_args("Xapian::Remote::open_writable",5,5)
  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,"useconds_t");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::Remote::open_writable",4,"useconds_t");
  if(!lua_isnumber(L,5)) SWIG_fail_arg("Xapian::Remote::open_writable",5,"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);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (useconds_t)lua_tonumber(L, 3);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (useconds_t)lua_tonumber(L, 4);
  arg5 = (int)lua_tonumber(L, 5);
  {
    try {
      result = Xapian::Remote::open_writable((std::string const &)*arg1,arg2,arg3,arg4,arg5);
    } 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 ;
  useconds_t arg3 ;
  useconds_t 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,"useconds_t");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::Remote::open_writable",4,"useconds_t");
  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 = (useconds_t)lua_tonumber(L, 3);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (useconds_t)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_2(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  unsigned int arg2 ;
  useconds_t 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,"useconds_t");
  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 = (useconds_t)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_3(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 ;
  useconds_t 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,"useconds_t");
  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 = (useconds_t)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);
          }
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'remote_open'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Xapian::Remote::open(std::string const &,unsigned int,useconds_t,useconds_t)\n"
    "    Xapian::Remote::open(std::string const &,unsigned int,useconds_t)\n"
    "    Xapian::Remote::open(std::string const &,unsigned int)\n"
    "    Xapian::Remote::open(std::string const &,std::string const &,useconds_t)\n"
    "    Xapian::Remote::open(std::string const &,std::string const &)\n");
  lua_error(L);return 0;
}


static int _wrap_remote_open_writable__SWIG_4(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  useconds_t arg3 ;
  int arg4 ;
  std::string temp1 ;
  std::string temp2 ;
  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_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,"useconds_t");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Xapian::Remote::open_writable",4,"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;
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (useconds_t)lua_tonumber(L, 3);
  arg4 = (int)lua_tonumber(L, 4);
  {
    try {
      result = Xapian::Remote::open_writable((std::string const &)*arg1,(std::string const &)*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_5(lua_State* L) {
  int SWIG_arg = 0;
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  useconds_t 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,"useconds_t");
  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 = (useconds_t)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_6(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[6]={
    1,2,3,4,5,6
  };
  
  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_3(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_6(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_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_remote_open_writable__SWIG_5(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_1(L);
          }
        }
      }
    }
  }
  if (argc == 4) {
    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) {
          {
            _v = lua_isnumber(L,argv[3]);
          }
          if (_v) {
            return _wrap_remote_open_writable__SWIG_4(L);
          }
        }
      }
    }
  }
  if (argc == 5) {
    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) {
            {
              _v = lua_isnumber(L,argv[4]);
            }
            if (_v) {
              return _wrap_remote_open_writable__SWIG_0(L);
            }
          }
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(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,useconds_t,useconds_t,int)\n"
    "    Xapian::Remote::open_writable(std::string const &,unsigned int,useconds_t,useconds_t)\n"
    "    Xapian::Remote::open_writable(std::string const &,unsigned int,useconds_t)\n"
    "    Xapian::Remote::open_writable(std::string const &,unsigned int)\n"
    "    Xapian::Remote::open_writable(std::string const &,std::string const &,useconds_t,int)\n"
    "    Xapian::Remote::open_writable(std::string const &,std::string const &,useconds_t)\n"
    "    Xapian::Remote::open_writable(std::string const &,std::string const &)\n");
  lua_error(L);return 0;
}


static swig_lua_attribute swig_SwigModule_attributes[] = {
    { "Query_MatchNothing", _wrap_Query_MatchNothing_get, SWIG_Lua_set_immutable },
    { "Query_MatchAll", _wrap_Query_MatchAll_get, SWIG_Lua_set_immutable },
    {0,0,0}
};
static swig_lua_const_info swig_SwigModule_constants[]= {
    {SWIG_LUA_CONSTTAB_INT("BAD_VALUENO", Xapian::BAD_VALUENO)},
    {SWIG_LUA_CONSTTAB_INT("DB_CREATE", Xapian::DB_CREATE)},
    {SWIG_LUA_CONSTTAB_INT("DB_CREATE_OR_OPEN", Xapian::DB_CREATE_OR_OPEN)},
    {SWIG_LUA_CONSTTAB_INT("DB_CREATE_OR_OVERWRITE", Xapian::DB_CREATE_OR_OVERWRITE)},
    {SWIG_LUA_CONSTTAB_INT("DB_OPEN", Xapian::DB_OPEN)},
    {SWIG_LUA_CONSTTAB_INT("DB_NO_SYNC", Xapian::DB_NO_SYNC)},
    {SWIG_LUA_CONSTTAB_INT("DB_FULL_SYNC", Xapian::DB_FULL_SYNC)},
    {SWIG_LUA_CONSTTAB_INT("DB_DANGEROUS", Xapian::DB_DANGEROUS)},
    {SWIG_LUA_CONSTTAB_INT("DB_NO_TERMLIST", Xapian::DB_NO_TERMLIST)},
    {SWIG_LUA_CONSTTAB_INT("DB_BACKEND_CHERT", Xapian::DB_BACKEND_CHERT)},
    {SWIG_LUA_CONSTTAB_INT("DB_BACKEND_GLASS", Xapian::DB_BACKEND_GLASS)},
    {SWIG_LUA_CONSTTAB_INT("DB_BACKEND_INMEMORY", Xapian::DB_BACKEND_INMEMORY)},
    {SWIG_LUA_CONSTTAB_INT("DB_BACKEND_STUB", Xapian::DB_BACKEND_STUB)},
    {SWIG_LUA_CONSTTAB_INT("DB_RETRY_LOCK", Xapian::DB_RETRY_LOCK)},
    {SWIG_LUA_CONSTTAB_INT("DBCHECK_SHORT_TREE", Xapian::DBCHECK_SHORT_TREE)},
    {SWIG_LUA_CONSTTAB_INT("DBCHECK_FULL_TREE", Xapian::DBCHECK_FULL_TREE)},
    {SWIG_LUA_CONSTTAB_INT("DBCHECK_SHOW_FREELIST", Xapian::DBCHECK_SHOW_FREELIST)},
    {SWIG_LUA_CONSTTAB_INT("DBCHECK_SHOW_STATS", Xapian::DBCHECK_SHOW_STATS)},
    {SWIG_LUA_CONSTTAB_INT("DBCHECK_FIX", Xapian::DBCHECK_FIX)},
    {SWIG_LUA_CONSTTAB_INT("DBCOMPACT_MULTIPASS", Xapian::DBCOMPACT_MULTIPASS)},
    {SWIG_LUA_CONSTTAB_INT("DBCOMPACT_NO_RENUMBER", Xapian::DBCOMPACT_NO_RENUMBER)},
    {SWIG_LUA_CONSTTAB_INT("DBCOMPACT_SINGLE_FILE", Xapian::DBCOMPACT_SINGLE_FILE)},
    {SWIG_LUA_CONSTTAB_INT("DOC_ASSUME_VALID", Xapian::DOC_ASSUME_VALID)},
    {SWIG_LUA_CONSTTAB_INT("Query_OP_AND", Xapian::Query::OP_AND)},
    {SWIG_LUA_CONSTTAB_INT("Query_OP_OR", Xapian::Query::OP_OR)},
    {SWIG_LUA_CONSTTAB_INT("Query_OP_AND_NOT", Xapian::Query::OP_AND_NOT)},
    {SWIG_LUA_CONSTTAB_INT("Query_OP_XOR", Xapian::Query::OP_XOR)},
    {SWIG_LUA_CONSTTAB_INT("Query_OP_AND_MAYBE", Xapian::Query::OP_AND_MAYBE)},
    {SWIG_LUA_CONSTTAB_INT("Query_OP_FILTER", Xapian::Query::OP_FILTER)},
    {SWIG_LUA_CONSTTAB_INT("Query_OP_NEAR", Xapian::Query::OP_NEAR)},
    {SWIG_LUA_CONSTTAB_INT("Query_OP_PHRASE", Xapian::Query::OP_PHRASE)},
    {SWIG_LUA_CONSTTAB_INT("Query_OP_VALUE_RANGE", Xapian::Query::OP_VALUE_RANGE)},
    {SWIG_LUA_CONSTTAB_INT("Query_OP_SCALE_WEIGHT", Xapian::Query::OP_SCALE_WEIGHT)},
    {SWIG_LUA_CONSTTAB_INT("Query_OP_ELITE_SET", Xapian::Query::OP_ELITE_SET)},
    {SWIG_LUA_CONSTTAB_INT("Query_OP_VALUE_GE", Xapian::Query::OP_VALUE_GE)},
    {SWIG_LUA_CONSTTAB_INT("Query_OP_VALUE_LE", Xapian::Query::OP_VALUE_LE)},
    {SWIG_LUA_CONSTTAB_INT("Query_OP_SYNONYM", Xapian::Query::OP_SYNONYM)},
    {SWIG_LUA_CONSTTAB_INT("Query_OP_MAX", Xapian::Query::OP_MAX)},
    {SWIG_LUA_CONSTTAB_INT("Query_OP_WILDCARD", Xapian::Query::OP_WILDCARD)},
    {SWIG_LUA_CONSTTAB_INT("Query_OP_INVALID", Xapian::Query::OP_INVALID)},
    {SWIG_LUA_CONSTTAB_INT("Query_WILDCARD_LIMIT_ERROR", Xapian::Query::WILDCARD_LIMIT_ERROR)},
    {SWIG_LUA_CONSTTAB_INT("Query_WILDCARD_LIMIT_FIRST", Xapian::Query::WILDCARD_LIMIT_FIRST)},
    {SWIG_LUA_CONSTTAB_INT("Query_WILDCARD_LIMIT_MOST_FREQUENT", Xapian::Query::WILDCARD_LIMIT_MOST_FREQUENT)},
    {SWIG_LUA_CONSTTAB_INT("TermGenerator_FLAG_SPELLING", Xapian::TermGenerator::FLAG_SPELLING)},
    {SWIG_LUA_CONSTTAB_INT("TermGenerator_FLAG_CJK_NGRAM", Xapian::TermGenerator::FLAG_CJK_NGRAM)},
    {SWIG_LUA_CONSTTAB_INT("TermGenerator_STEM_NONE", Xapian::TermGenerator::STEM_NONE)},
    {SWIG_LUA_CONSTTAB_INT("TermGenerator_STEM_SOME", Xapian::TermGenerator::STEM_SOME)},
    {SWIG_LUA_CONSTTAB_INT("TermGenerator_STEM_ALL", Xapian::TermGenerator::STEM_ALL)},
    {SWIG_LUA_CONSTTAB_INT("TermGenerator_STEM_ALL_Z", Xapian::TermGenerator::STEM_ALL_Z)},
    {SWIG_LUA_CONSTTAB_INT("TermGenerator_STEM_SOME_FULL_POS", Xapian::TermGenerator::STEM_SOME_FULL_POS)},
    {SWIG_LUA_CONSTTAB_INT("TermGenerator_STOP_NONE", Xapian::TermGenerator::STOP_NONE)},
    {SWIG_LUA_CONSTTAB_INT("TermGenerator_STOP_ALL", Xapian::TermGenerator::STOP_ALL)},
    {SWIG_LUA_CONSTTAB_INT("TermGenerator_STOP_STEMMED", Xapian::TermGenerator::STOP_STEMMED)},
    {SWIG_LUA_CONSTTAB_INT("MSet_SNIPPET_BACKGROUND_MODEL", Xapian::MSet::SNIPPET_BACKGROUND_MODEL)},
    {SWIG_LUA_CONSTTAB_INT("MSet_SNIPPET_EXHAUSTIVE", Xapian::MSet::SNIPPET_EXHAUSTIVE)},
    {SWIG_LUA_CONSTTAB_INT("MSet_SNIPPET_EMPTY_WITHOUT_MATCH", Xapian::MSet::SNIPPET_EMPTY_WITHOUT_MATCH)},
    {SWIG_LUA_CONSTTAB_INT("MSet_SNIPPET_CJK_NGRAM", Xapian::MSet::SNIPPET_CJK_NGRAM)},
    {SWIG_LUA_CONSTTAB_INT("Enquire_ASCENDING", Xapian::Enquire::ASCENDING)},
    {SWIG_LUA_CONSTTAB_INT("Enquire_DESCENDING", Xapian::Enquire::DESCENDING)},
    {SWIG_LUA_CONSTTAB_INT("Enquire_DONT_CARE", Xapian::Enquire::DONT_CARE)},
    {SWIG_LUA_CONSTTAB_INT("Enquire_INCLUDE_QUERY_TERMS", Xapian::Enquire::INCLUDE_QUERY_TERMS)},
    {SWIG_LUA_CONSTTAB_INT("Enquire_USE_EXACT_TERMFREQ", Xapian::Enquire::USE_EXACT_TERMFREQ)},
    {SWIG_LUA_CONSTTAB_INT("RP_SUFFIX", Xapian::RP_SUFFIX)},
    {SWIG_LUA_CONSTTAB_INT("RP_REPEATED", Xapian::RP_REPEATED)},
    {SWIG_LUA_CONSTTAB_INT("RP_DATE_PREFER_MDY", Xapian::RP_DATE_PREFER_MDY)},
    {SWIG_LUA_CONSTTAB_INT("QueryParser_FLAG_BOOLEAN", Xapian::QueryParser::FLAG_BOOLEAN)},
    {SWIG_LUA_CONSTTAB_INT("QueryParser_FLAG_PHRASE", Xapian::QueryParser::FLAG_PHRASE)},
    {SWIG_LUA_CONSTTAB_INT("QueryParser_FLAG_LOVEHATE", Xapian::QueryParser::FLAG_LOVEHATE)},
    {SWIG_LUA_CONSTTAB_INT("QueryParser_FLAG_BOOLEAN_ANY_CASE", Xapian::QueryParser::FLAG_BOOLEAN_ANY_CASE)},
    {SWIG_LUA_CONSTTAB_INT("QueryParser_FLAG_WILDCARD", Xapian::QueryParser::FLAG_WILDCARD)},
    {SWIG_LUA_CONSTTAB_INT("QueryParser_FLAG_PURE_NOT", Xapian::QueryParser::FLAG_PURE_NOT)},
    {SWIG_LUA_CONSTTAB_INT("QueryParser_FLAG_PARTIAL", Xapian::QueryParser::FLAG_PARTIAL)},
    {SWIG_LUA_CONSTTAB_INT("QueryParser_FLAG_SPELLING_CORRECTION", Xapian::QueryParser::FLAG_SPELLING_CORRECTION)},
    {SWIG_LUA_CONSTTAB_INT("QueryParser_FLAG_SYNONYM", Xapian::QueryParser::FLAG_SYNONYM)},
    {SWIG_LUA_CONSTTAB_INT("QueryParser_FLAG_AUTO_SYNONYMS", Xapian::QueryParser::FLAG_AUTO_SYNONYMS)},
    {SWIG_LUA_CONSTTAB_INT("QueryParser_FLAG_AUTO_MULTIWORD_SYNONYMS", Xapian::QueryParser::FLAG_AUTO_MULTIWORD_SYNONYMS)},
    {SWIG_LUA_CONSTTAB_INT("QueryParser_FLAG_CJK_NGRAM", Xapian::QueryParser::FLAG_CJK_NGRAM)},
    {SWIG_LUA_CONSTTAB_INT("QueryParser_FLAG_DEFAULT", Xapian::QueryParser::FLAG_DEFAULT)},
    {SWIG_LUA_CONSTTAB_INT("QueryParser_STEM_NONE", Xapian::QueryParser::STEM_NONE)},
    {SWIG_LUA_CONSTTAB_INT("QueryParser_STEM_SOME", Xapian::QueryParser::STEM_SOME)},
    {SWIG_LUA_CONSTTAB_INT("QueryParser_STEM_ALL", Xapian::QueryParser::STEM_ALL)},
    {SWIG_LUA_CONSTTAB_INT("QueryParser_STEM_ALL_Z", Xapian::QueryParser::STEM_ALL_Z)},
    {SWIG_LUA_CONSTTAB_INT("QueryParser_STEM_SOME_FULL_POS", Xapian::QueryParser::STEM_SOME_FULL_POS)},
    {SWIG_LUA_CONSTTAB_INT("Weight_TWO_STAGE_SMOOTHING", Xapian::Weight::TWO_STAGE_SMOOTHING)},
    {SWIG_LUA_CONSTTAB_INT("Weight_DIRICHLET_SMOOTHING", Xapian::Weight::DIRICHLET_SMOOTHING)},
    {SWIG_LUA_CONSTTAB_INT("Weight_ABSOLUTE_DISCOUNT_SMOOTHING", Xapian::Weight::ABSOLUTE_DISCOUNT_SMOOTHING)},
    {SWIG_LUA_CONSTTAB_INT("Weight_JELINEK_MERCER_SMOOTHING", Xapian::Weight::JELINEK_MERCER_SMOOTHING)},
    {SWIG_LUA_CONSTTAB_INT("Weight_DIRICHLET_PLUS_SMOOTHING", Xapian::Weight::DIRICHLET_PLUS_SMOOTHING)},
    {SWIG_LUA_CONSTTAB_INT("Compactor_STANDARD", Xapian::Compactor::STANDARD)},
    {SWIG_LUA_CONSTTAB_INT("Compactor_FULL", Xapian::Compactor::FULL)},
    {SWIG_LUA_CONSTTAB_INT("Compactor_FULLER", Xapian::Compactor::FULLER)},
    {0,0,0,0,0,0}
};
static swig_lua_method swig_SwigModule_methods[]= {
    { "version_string", _wrap_version_string},
    { "major_version", _wrap_major_version},
    { "minor_version", _wrap_minor_version},
    { "revision", _wrap_revision},
    { "Document_unserialise", _wrap_Document_unserialise},
    { "Query_unserialise", _wrap_Query_unserialise},
    { "Stem_get_available_languages", _wrap_Stem_get_available_languages},
    { "__eq", _wrap___eq},
    { "__lt", _wrap___lt},
    { "__le", _wrap___le},
    { "__add", _wrap___add},
    { "sortable_serialise", _wrap_sortable_serialise},
    { "sortable_unserialise", _wrap_sortable_unserialise},
    { "miles_to_metres", _wrap_miles_to_metres},
    { "metres_to_miles", _wrap_metres_to_miles},
    { "Database_check", _wrap_Database_check},
    { "open_stub", _wrap_open_stub},
    { "inmemory_open", _wrap_inmemory_open},
    { "chert_open", _wrap_chert_open},
    { "remote_open", _wrap_remote_open},
    { "remote_open_writable", _wrap_remote_open_writable},
    {0,0}
};
static swig_lua_class* swig_SwigModule_classes[]= {
&_wrap_class_string,
&_wrap_class_Error,
&_wrap_class_LogicError,
&_wrap_class_RuntimeError,
&_wrap_class_AssertionError,
&_wrap_class_InvalidArgumentError,
&_wrap_class_InvalidOperationError,
&_wrap_class_UnimplementedError,
&_wrap_class_DatabaseError,
&_wrap_class_DatabaseCorruptError,
&_wrap_class_DatabaseCreateError,
&_wrap_class_DatabaseLockError,
&_wrap_class_DatabaseModifiedError,
&_wrap_class_DatabaseOpeningError,
&_wrap_class_DatabaseVersionError,
&_wrap_class_DocNotFoundError,
&_wrap_class_FeatureUnavailableError,
&_wrap_class_InternalError,
&_wrap_class_NetworkError,
&_wrap_class_NetworkTimeoutError,
&_wrap_class_QueryParserError,
&_wrap_class_SerialisationError,
&_wrap_class_RangeError,
&_wrap_class_WildcardError,
&_wrap_class_DatabaseNotFoundError,
&_wrap_class_DatabaseClosedError,
&_wrap_class_PositionIterator,
&_wrap_class_PostingIterator,
&_wrap_class_TermIterator,
&_wrap_class_ValueIterator,
&_wrap_class_Document,
&_wrap_class_Registry,
&_wrap_class_Query,
&_wrap_class_Stem,
&_wrap_class_TermGenerator,
&_wrap_class_MSet,
&_wrap_class_MSetIterator,
&_wrap_class_ESet,
&_wrap_class_ESetIterator,
&_wrap_class_RSet,
&_wrap_class_MatchDecider,
&_wrap_class_Enquire,
&_wrap_class_ExpandDecider,
&_wrap_class_ExpandDeciderAnd,
&_wrap_class_ExpandDeciderFilterPrefix,
&_wrap_class_KeyMaker,
&_wrap_class_MultiValueKeyMaker,
&_wrap_class_Stopper,
&_wrap_class_SimpleStopper,
&_wrap_class_RangeProcessor,
&_wrap_class_DateRangeProcessor,
&_wrap_class_NumberRangeProcessor,
&_wrap_class_ValueRangeProcessor,
&_wrap_class_StringValueRangeProcessor,
&_wrap_class_DateValueRangeProcessor,
&_wrap_class_NumberValueRangeProcessor,
&_wrap_class_FieldProcessor,
&_wrap_class_QueryParser,
&_wrap_class_ValueSetMatchDecider,
&_wrap_class_Weight,
&_wrap_class_BoolWeight,
&_wrap_class_TfIdfWeight,
&_wrap_class_BM25Weight,
&_wrap_class_BM25PlusWeight,
&_wrap_class_TradWeight,
&_wrap_class_InL2Weight,
&_wrap_class_IfB2Weight,
&_wrap_class_IneB2Weight,
&_wrap_class_BB2Weight,
&_wrap_class_DLHWeight,
&_wrap_class_PL2Weight,
&_wrap_class_PL2PlusWeight,
&_wrap_class_DPHWeight,
&_wrap_class_LMWeight,
&_wrap_class_CoordWeight,
&_wrap_class_Compactor,
&_wrap_class_PostingSource,
&_wrap_class_ValuePostingSource,
&_wrap_class_ValueWeightPostingSource,
&_wrap_class_DecreasingValueWeightPostingSource,
&_wrap_class_ValueMapPostingSource,
&_wrap_class_FixedWeightPostingSource,
&_wrap_class_MatchSpy,
&_wrap_class_ValueCountMatchSpy,
&_wrap_class_LatLongCoord,
&_wrap_class_LatLongCoordsIterator,
&_wrap_class_LatLongCoords,
&_wrap_class_LatLongMetric,
&_wrap_class_GreatCircleMetric,
&_wrap_class_LatLongDistancePostingSource,
&_wrap_class_LatLongDistanceKeyMaker,
&_wrap_class_Database,
&_wrap_class_WritableDatabase,
    0
};
static swig_lua_namespace* swig_SwigModule_namespaces[] = {
    0
};

static swig_lua_namespace swig_SwigModule = {
    "xapian",
    swig_SwigModule_methods,
    swig_SwigModule_attributes,
    swig_SwigModule_constants,
    swig_SwigModule_classes,
    swig_SwigModule_namespaces
};
#ifdef __cplusplus
}
#endif

/* -------- 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__GreatCircleMetricTo_p_Xapian__LatLongMetric(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::LatLongMetric *)  ((Xapian::GreatCircleMetric *) 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__ExpandDeciderFilterPrefixTo_p_Xapian__ExpandDecider(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::ExpandDecider *)  ((Xapian::ExpandDeciderFilterPrefix *) x));
}
static void *_p_Xapian__ExpandDeciderAndTo_p_Xapian__ExpandDecider(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::ExpandDecider *)  ((Xapian::ExpandDeciderAnd *) x));
}
static void *_p_Xapian__ExpandDeciderFilterTermsTo_p_Xapian__ExpandDecider(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::ExpandDecider *)  ((Xapian::ExpandDeciderFilterTerms *) 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__MultiValueKeyMakerTo_p_Xapian__KeyMaker(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::KeyMaker *)  ((Xapian::MultiValueKeyMaker *) x));
}
static void *_p_Xapian__LatLongDistanceKeyMakerTo_p_Xapian__KeyMaker(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::KeyMaker *)  ((Xapian::LatLongDistanceKeyMaker *) 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__LatLongDistancePostingSourceTo_p_Xapian__PostingSource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::PostingSource *) (Xapian::ValuePostingSource *) ((Xapian::LatLongDistancePostingSource *) 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__LatLongDistancePostingSourceTo_p_Xapian__ValuePostingSource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::ValuePostingSource *)  ((Xapian::LatLongDistancePostingSource *) 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__DPHWeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::DPHWeight *) x));
}
static void *_p_Xapian__PL2WeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::PL2Weight *) x));
}
static void *_p_Xapian__DLHWeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::DLHWeight *) x));
}
static void *_p_Xapian__BB2WeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::BB2Weight *) x));
}
static void *_p_Xapian__IneB2WeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::IneB2Weight *) x));
}
static void *_p_Xapian__IfB2WeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::IfB2Weight *) x));
}
static void *_p_Xapian__InL2WeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::InL2Weight *) 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__TfIdfWeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::TfIdfWeight *) 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__CoordWeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::CoordWeight *) x));
}
static void *_p_Xapian__LMWeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::LMWeight *) x));
}
static void *_p_Xapian__PL2PlusWeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::PL2PlusWeight *) x));
}
static void *_p_Xapian__BM25PlusWeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::BM25PlusWeight *) 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__DatabaseNotFoundErrorTo_p_Xapian__DatabaseOpeningError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::DatabaseOpeningError *)  ((Xapian::DatabaseNotFoundError *) 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__DatabaseClosedErrorTo_p_Xapian__DatabaseError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::DatabaseError *)  ((Xapian::DatabaseClosedError *) x));
}
static void *_p_Xapian__DatabaseNotFoundErrorTo_p_Xapian__DatabaseError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::DatabaseError *) (Xapian::DatabaseOpeningError *) ((Xapian::DatabaseNotFoundError *) 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__WildcardErrorTo_p_Xapian__RuntimeError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::RuntimeError *)  ((Xapian::WildcardError *) x));
}
static void *_p_Xapian__DatabaseNotFoundErrorTo_p_Xapian__RuntimeError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::RuntimeError *) (Xapian::DatabaseError *)(Xapian::DatabaseOpeningError *) ((Xapian::DatabaseNotFoundError *) 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__DatabaseClosedErrorTo_p_Xapian__RuntimeError(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::RuntimeError *) (Xapian::DatabaseError *) ((Xapian::DatabaseClosedError *) 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__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__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__DateRangeProcessorTo_p_Xapian__RangeProcessor(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::RangeProcessor *)  ((Xapian::DateRangeProcessor *) x));
}
static void *_p_Xapian__NumberRangeProcessorTo_p_Xapian__RangeProcessor(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::RangeProcessor *)  ((Xapian::NumberRangeProcessor *) 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__WildcardErrorTo_p_Xapian__Error(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Error *) (Xapian::RuntimeError *) ((Xapian::WildcardError *) x));
}
static void *_p_Xapian__DatabaseNotFoundErrorTo_p_Xapian__Error(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Error *) (Xapian::RuntimeError *)(Xapian::DatabaseError *)(Xapian::DatabaseOpeningError *) ((Xapian::DatabaseNotFoundError *) 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__DatabaseClosedErrorTo_p_Xapian__Error(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Error *) (Xapian::RuntimeError *)(Xapian::DatabaseError *) ((Xapian::DatabaseClosedError *) 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_AssertionError, 0};
static swig_type_info _swigt__p_Xapian__BB2Weight = {"_p_Xapian__BB2Weight", "Xapian::BB2Weight *", 0, 0, (void*)&_wrap_class_BB2Weight, 0};
static swig_type_info _swigt__p_Xapian__BM25PlusWeight = {"_p_Xapian__BM25PlusWeight", "Xapian::BM25PlusWeight *", 0, 0, (void*)&_wrap_class_BM25PlusWeight, 0};
static swig_type_info _swigt__p_Xapian__BM25Weight = {"_p_Xapian__BM25Weight", "Xapian::BM25Weight *", 0, 0, (void*)&_wrap_class_BM25Weight, 0};
static swig_type_info _swigt__p_Xapian__BoolWeight = {"_p_Xapian__BoolWeight", "Xapian::BoolWeight *", 0, 0, (void*)&_wrap_class_BoolWeight, 0};
static swig_type_info _swigt__p_Xapian__Compactor = {"_p_Xapian__Compactor", "Xapian::Compactor *", 0, 0, (void*)&_wrap_class_Compactor, 0};
static swig_type_info _swigt__p_Xapian__CoordWeight = {"_p_Xapian__CoordWeight", "Xapian::CoordWeight *", 0, 0, (void*)&_wrap_class_CoordWeight, 0};
static swig_type_info _swigt__p_Xapian__DLHWeight = {"_p_Xapian__DLHWeight", "Xapian::DLHWeight *", 0, 0, (void*)&_wrap_class_DLHWeight, 0};
static swig_type_info _swigt__p_Xapian__DPHWeight = {"_p_Xapian__DPHWeight", "Xapian::DPHWeight *", 0, 0, (void*)&_wrap_class_DPHWeight, 0};
static swig_type_info _swigt__p_Xapian__Database = {"_p_Xapian__Database", "Xapian::Database *", 0, 0, (void*)&_wrap_class_Database, 0};
static swig_type_info _swigt__p_Xapian__DatabaseClosedError = {"_p_Xapian__DatabaseClosedError", "Xapian::DatabaseClosedError *", 0, 0, (void*)&_wrap_class_DatabaseClosedError, 0};
static swig_type_info _swigt__p_Xapian__DatabaseCorruptError = {"_p_Xapian__DatabaseCorruptError", "Xapian::DatabaseCorruptError *", 0, 0, (void*)&_wrap_class_DatabaseCorruptError, 0};
static swig_type_info _swigt__p_Xapian__DatabaseCreateError = {"_p_Xapian__DatabaseCreateError", "Xapian::DatabaseCreateError *", 0, 0, (void*)&_wrap_class_DatabaseCreateError, 0};
static swig_type_info _swigt__p_Xapian__DatabaseError = {"_p_Xapian__DatabaseError", "Xapian::DatabaseError *", 0, 0, (void*)&_wrap_class_DatabaseError, 0};
static swig_type_info _swigt__p_Xapian__DatabaseLockError = {"_p_Xapian__DatabaseLockError", "Xapian::DatabaseLockError *", 0, 0, (void*)&_wrap_class_DatabaseLockError, 0};
static swig_type_info _swigt__p_Xapian__DatabaseModifiedError = {"_p_Xapian__DatabaseModifiedError", "Xapian::DatabaseModifiedError *", 0, 0, (void*)&_wrap_class_DatabaseModifiedError, 0};
static swig_type_info _swigt__p_Xapian__DatabaseNotFoundError = {"_p_Xapian__DatabaseNotFoundError", "Xapian::DatabaseNotFoundError *", 0, 0, (void*)&_wrap_class_DatabaseNotFoundError, 0};
static swig_type_info _swigt__p_Xapian__DatabaseOpeningError = {"_p_Xapian__DatabaseOpeningError", "Xapian::DatabaseOpeningError *", 0, 0, (void*)&_wrap_class_DatabaseOpeningError, 0};
static swig_type_info _swigt__p_Xapian__DatabaseVersionError = {"_p_Xapian__DatabaseVersionError", "Xapian::DatabaseVersionError *", 0, 0, (void*)&_wrap_class_DatabaseVersionError, 0};
static swig_type_info _swigt__p_Xapian__DateRangeProcessor = {"_p_Xapian__DateRangeProcessor", "Xapian::DateRangeProcessor *", 0, 0, (void*)&_wrap_class_DateRangeProcessor, 0};
static swig_type_info _swigt__p_Xapian__DateValueRangeProcessor = {"_p_Xapian__DateValueRangeProcessor", "Xapian::DateValueRangeProcessor *", 0, 0, (void*)&_wrap_class_DateValueRangeProcessor, 0};
static swig_type_info _swigt__p_Xapian__DecreasingValueWeightPostingSource = {"_p_Xapian__DecreasingValueWeightPostingSource", "Xapian::DecreasingValueWeightPostingSource *", 0, 0, (void*)&_wrap_class_DecreasingValueWeightPostingSource, 0};
static swig_type_info _swigt__p_Xapian__DocNotFoundError = {"_p_Xapian__DocNotFoundError", "Xapian::DocNotFoundError *", 0, 0, (void*)&_wrap_class_DocNotFoundError, 0};
static swig_type_info _swigt__p_Xapian__Document = {"_p_Xapian__Document", "Xapian::Document *", 0, 0, (void*)&_wrap_class_Document, 0};
static swig_type_info _swigt__p_Xapian__ESet = {"_p_Xapian__ESet", "Xapian::ESet *", 0, 0, (void*)&_wrap_class_ESet, 0};
static swig_type_info _swigt__p_Xapian__ESetIterator = {"_p_Xapian__ESetIterator", "Xapian::ESetIterator *", 0, 0, (void*)&_wrap_class_ESetIterator, 0};
static swig_type_info _swigt__p_Xapian__Enquire = {"_p_Xapian__Enquire", "Xapian::Enquire *", 0, 0, (void*)&_wrap_class_Enquire, 0};
static swig_type_info _swigt__p_Xapian__Error = {"_p_Xapian__Error", "Xapian::Error *", 0, 0, (void*)&_wrap_class_Error, 0};
static swig_type_info _swigt__p_Xapian__ExpandDecider = {"_p_Xapian__ExpandDecider", "Xapian::ExpandDecider *", 0, 0, (void*)&_wrap_class_ExpandDecider, 0};
static swig_type_info _swigt__p_Xapian__ExpandDeciderFilterTerms = {"_p_Xapian__ExpandDeciderFilterTerms", 0, 0, 0, 0, 0};
static swig_type_info _swigt__p_Xapian__ExpandDeciderAnd = {"_p_Xapian__ExpandDeciderAnd", "Xapian::ExpandDeciderAnd *", 0, 0, (void*)&_wrap_class_ExpandDeciderAnd, 0};
static swig_type_info _swigt__p_Xapian__ExpandDeciderFilterPrefix = {"_p_Xapian__ExpandDeciderFilterPrefix", "Xapian::ExpandDeciderFilterPrefix *", 0, 0, (void*)&_wrap_class_ExpandDeciderFilterPrefix, 0};
static swig_type_info _swigt__p_Xapian__FeatureUnavailableError = {"_p_Xapian__FeatureUnavailableError", "Xapian::FeatureUnavailableError *", 0, 0, (void*)&_wrap_class_FeatureUnavailableError, 0};
static swig_type_info _swigt__p_Xapian__FieldProcessor = {"_p_Xapian__FieldProcessor", "Xapian::FieldProcessor *", 0, 0, (void*)&_wrap_class_FieldProcessor, 0};
static swig_type_info _swigt__p_Xapian__FixedWeightPostingSource = {"_p_Xapian__FixedWeightPostingSource", "Xapian::FixedWeightPostingSource *", 0, 0, (void*)&_wrap_class_FixedWeightPostingSource, 0};
static swig_type_info _swigt__p_Xapian__GreatCircleMetric = {"_p_Xapian__GreatCircleMetric", "Xapian::GreatCircleMetric *", 0, 0, (void*)&_wrap_class_GreatCircleMetric, 0};
static swig_type_info _swigt__p_Xapian__IfB2Weight = {"_p_Xapian__IfB2Weight", "Xapian::IfB2Weight *", 0, 0, (void*)&_wrap_class_IfB2Weight, 0};
static swig_type_info _swigt__p_Xapian__InL2Weight = {"_p_Xapian__InL2Weight", "Xapian::InL2Weight *", 0, 0, (void*)&_wrap_class_InL2Weight, 0};
static swig_type_info _swigt__p_Xapian__IneB2Weight = {"_p_Xapian__IneB2Weight", "Xapian::IneB2Weight *", 0, 0, (void*)&_wrap_class_IneB2Weight, 0};
static swig_type_info _swigt__p_Xapian__InternalError = {"_p_Xapian__InternalError", "Xapian::InternalError *", 0, 0, (void*)&_wrap_class_InternalError, 0};
static swig_type_info _swigt__p_Xapian__InvalidArgumentError = {"_p_Xapian__InvalidArgumentError", "Xapian::InvalidArgumentError *", 0, 0, (void*)&_wrap_class_InvalidArgumentError, 0};
static swig_type_info _swigt__p_Xapian__InvalidOperationError = {"_p_Xapian__InvalidOperationError", "Xapian::InvalidOperationError *", 0, 0, (void*)&_wrap_class_InvalidOperationError, 0};
static swig_type_info _swigt__p_Xapian__KeyMaker = {"_p_Xapian__KeyMaker", "Xapian::KeyMaker *", 0, 0, (void*)&_wrap_class_KeyMaker, 0};
static swig_type_info _swigt__p_Xapian__LMWeight = {"_p_Xapian__LMWeight", "Xapian::LMWeight *", 0, 0, (void*)&_wrap_class_LMWeight, 0};
static swig_type_info _swigt__p_Xapian__LatLongCoord = {"_p_Xapian__LatLongCoord", "Xapian::LatLongCoord *", 0, 0, (void*)&_wrap_class_LatLongCoord, 0};
static swig_type_info _swigt__p_Xapian__LatLongCoords = {"_p_Xapian__LatLongCoords", "Xapian::LatLongCoords *", 0, 0, (void*)&_wrap_class_LatLongCoords, 0};
static swig_type_info _swigt__p_Xapian__LatLongCoordsIterator = {"_p_Xapian__LatLongCoordsIterator", "Xapian::LatLongCoordsIterator *", 0, 0, (void*)&_wrap_class_LatLongCoordsIterator, 0};
static swig_type_info _swigt__p_Xapian__LatLongDistanceKeyMaker = {"_p_Xapian__LatLongDistanceKeyMaker", "Xapian::LatLongDistanceKeyMaker *", 0, 0, (void*)&_wrap_class_LatLongDistanceKeyMaker, 0};
static swig_type_info _swigt__p_Xapian__LatLongDistancePostingSource = {"_p_Xapian__LatLongDistancePostingSource", "Xapian::LatLongDistancePostingSource *", 0, 0, (void*)&_wrap_class_LatLongDistancePostingSource, 0};
static swig_type_info _swigt__p_Xapian__LatLongMetric = {"_p_Xapian__LatLongMetric", "Xapian::LatLongMetric *", 0, 0, (void*)&_wrap_class_LatLongMetric, 0};
static swig_type_info _swigt__p_Xapian__LogicError = {"_p_Xapian__LogicError", "Xapian::LogicError *", 0, 0, (void*)&_wrap_class_LogicError, 0};
static swig_type_info _swigt__p_Xapian__MSet = {"_p_Xapian__MSet", "Xapian::MSet *", 0, 0, (void*)&_wrap_class_MSet, 0};
static swig_type_info _swigt__p_Xapian__MSetIterator = {"_p_Xapian__MSetIterator", "Xapian::MSetIterator *", 0, 0, (void*)&_wrap_class_MSetIterator, 0};
static swig_type_info _swigt__p_Xapian__MatchDecider = {"_p_Xapian__MatchDecider", "Xapian::MatchDecider *", 0, 0, (void*)&_wrap_class_MatchDecider, 0};
static swig_type_info _swigt__p_Xapian__MatchSpy = {"_p_Xapian__MatchSpy", "Xapian::MatchSpy *", 0, 0, (void*)&_wrap_class_MatchSpy, 0};
static swig_type_info _swigt__p_Xapian__MultiValueKeyMaker = {"_p_Xapian__MultiValueKeyMaker", "Xapian::MultiValueKeyMaker *", 0, 0, (void*)&_wrap_class_MultiValueKeyMaker, 0};
static swig_type_info _swigt__p_Xapian__NetworkError = {"_p_Xapian__NetworkError", "Xapian::NetworkError *", 0, 0, (void*)&_wrap_class_NetworkError, 0};
static swig_type_info _swigt__p_Xapian__NetworkTimeoutError = {"_p_Xapian__NetworkTimeoutError", "Xapian::NetworkTimeoutError *", 0, 0, (void*)&_wrap_class_NetworkTimeoutError, 0};
static swig_type_info _swigt__p_Xapian__NumberRangeProcessor = {"_p_Xapian__NumberRangeProcessor", "Xapian::NumberRangeProcessor *", 0, 0, (void*)&_wrap_class_NumberRangeProcessor, 0};
static swig_type_info _swigt__p_Xapian__NumberValueRangeProcessor = {"_p_Xapian__NumberValueRangeProcessor", "Xapian::NumberValueRangeProcessor *", 0, 0, (void*)&_wrap_class_NumberValueRangeProcessor, 0};
static swig_type_info _swigt__p_Xapian__PL2PlusWeight = {"_p_Xapian__PL2PlusWeight", "Xapian::PL2PlusWeight *", 0, 0, (void*)&_wrap_class_PL2PlusWeight, 0};
static swig_type_info _swigt__p_Xapian__PL2Weight = {"_p_Xapian__PL2Weight", "Xapian::PL2Weight *", 0, 0, (void*)&_wrap_class_PL2Weight, 0};
static swig_type_info _swigt__p_Xapian__PositionIterator = {"_p_Xapian__PositionIterator", "Xapian::PositionIterator *", 0, 0, (void*)&_wrap_class_PositionIterator, 0};
static swig_type_info _swigt__p_Xapian__PostingIterator = {"_p_Xapian__PostingIterator", "Xapian::PostingIterator *", 0, 0, (void*)&_wrap_class_PostingIterator, 0};
static swig_type_info _swigt__p_Xapian__PostingSource = {"_p_Xapian__PostingSource", "Xapian::PostingSource *", 0, 0, (void*)&_wrap_class_PostingSource, 0};
static swig_type_info _swigt__p_Xapian__Query = {"_p_Xapian__Query", "Xapian::Query *", 0, 0, (void*)&_wrap_class_Query, 0};
static swig_type_info _swigt__p_Xapian__QueryParser = {"_p_Xapian__QueryParser", "Xapian::QueryParser *", 0, 0, (void*)&_wrap_class_QueryParser, 0};
static swig_type_info _swigt__p_Xapian__QueryParserError = {"_p_Xapian__QueryParserError", "Xapian::QueryParserError *", 0, 0, (void*)&_wrap_class_QueryParserError, 0};
static swig_type_info _swigt__p_Xapian__RSet = {"_p_Xapian__RSet", "Xapian::RSet *", 0, 0, (void*)&_wrap_class_RSet, 0};
static swig_type_info _swigt__p_Xapian__RangeError = {"_p_Xapian__RangeError", "Xapian::RangeError *", 0, 0, (void*)&_wrap_class_RangeError, 0};
static swig_type_info _swigt__p_Xapian__RangeProcessor = {"_p_Xapian__RangeProcessor", "Xapian::RangeProcessor *", 0, 0, (void*)&_wrap_class_RangeProcessor, 0};
static swig_type_info _swigt__p_Xapian__Registry = {"_p_Xapian__Registry", "Xapian::Registry *", 0, 0, (void*)&_wrap_class_Registry, 0};
static swig_type_info _swigt__p_Xapian__RuntimeError = {"_p_Xapian__RuntimeError", "Xapian::RuntimeError *", 0, 0, (void*)&_wrap_class_RuntimeError, 0};
static swig_type_info _swigt__p_Xapian__SerialisationError = {"_p_Xapian__SerialisationError", "Xapian::SerialisationError *", 0, 0, (void*)&_wrap_class_SerialisationError, 0};
static swig_type_info _swigt__p_Xapian__SimpleStopper = {"_p_Xapian__SimpleStopper", "Xapian::SimpleStopper *", 0, 0, (void*)&_wrap_class_SimpleStopper, 0};
static swig_type_info _swigt__p_Xapian__Stem = {"_p_Xapian__Stem", "Xapian::Stem *", 0, 0, (void*)&_wrap_class_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_Stopper, 0};
static swig_type_info _swigt__p_Xapian__StringValueRangeProcessor = {"_p_Xapian__StringValueRangeProcessor", "Xapian::StringValueRangeProcessor *", 0, 0, (void*)&_wrap_class_StringValueRangeProcessor, 0};
static swig_type_info _swigt__p_Xapian__TermGenerator = {"_p_Xapian__TermGenerator", "Xapian::TermGenerator *", 0, 0, (void*)&_wrap_class_TermGenerator, 0};
static swig_type_info _swigt__p_Xapian__TermIterator = {"_p_Xapian__TermIterator", "Xapian::TermIterator *", 0, 0, (void*)&_wrap_class_TermIterator, 0};
static swig_type_info _swigt__p_Xapian__TfIdfWeight = {"_p_Xapian__TfIdfWeight", "Xapian::TfIdfWeight *", 0, 0, (void*)&_wrap_class_TfIdfWeight, 0};
static swig_type_info _swigt__p_Xapian__TradWeight = {"_p_Xapian__TradWeight", "Xapian::TradWeight *", 0, 0, (void*)&_wrap_class_TradWeight, 0};
static swig_type_info _swigt__p_Xapian__UnimplementedError = {"_p_Xapian__UnimplementedError", "Xapian::UnimplementedError *", 0, 0, (void*)&_wrap_class_UnimplementedError, 0};
static swig_type_info _swigt__p_Xapian__ValueCountMatchSpy = {"_p_Xapian__ValueCountMatchSpy", "Xapian::ValueCountMatchSpy *", 0, 0, (void*)&_wrap_class_ValueCountMatchSpy, 0};
static swig_type_info _swigt__p_Xapian__ValueIterator = {"_p_Xapian__ValueIterator", "Xapian::ValueIterator *", 0, 0, (void*)&_wrap_class_ValueIterator, 0};
static swig_type_info _swigt__p_Xapian__ValueMapPostingSource = {"_p_Xapian__ValueMapPostingSource", "Xapian::ValueMapPostingSource *", 0, 0, (void*)&_wrap_class_ValueMapPostingSource, 0};
static swig_type_info _swigt__p_Xapian__ValuePostingSource = {"_p_Xapian__ValuePostingSource", "Xapian::ValuePostingSource *", 0, 0, (void*)&_wrap_class_ValuePostingSource, 0};
static swig_type_info _swigt__p_Xapian__ValueRangeProcessor = {"_p_Xapian__ValueRangeProcessor", "Xapian::ValueRangeProcessor *", 0, 0, (void*)&_wrap_class_ValueRangeProcessor, 0};
static swig_type_info _swigt__p_Xapian__ValueSetMatchDecider = {"_p_Xapian__ValueSetMatchDecider", "Xapian::ValueSetMatchDecider *", 0, 0, (void*)&_wrap_class_ValueSetMatchDecider, 0};
static swig_type_info _swigt__p_Xapian__ValueWeightPostingSource = {"_p_Xapian__ValueWeightPostingSource", "Xapian::ValueWeightPostingSource *", 0, 0, (void*)&_wrap_class_ValueWeightPostingSource, 0};
static swig_type_info _swigt__p_Xapian__Weight = {"_p_Xapian__Weight", "Xapian::Weight *", 0, 0, (void*)&_wrap_class_Weight, 0};
static swig_type_info _swigt__p_Xapian__WildcardError = {"_p_Xapian__WildcardError", "Xapian::WildcardError *", 0, 0, (void*)&_wrap_class_WildcardError, 0};
static swig_type_info _swigt__p_Xapian__WritableDatabase = {"_p_Xapian__WritableDatabase", "Xapian::WritableDatabase *", 0, 0, (void*)&_wrap_class_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_flags = {"_p_flags", "flags *", 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_std__string = {"_p_std__string", "std::string *", 0, 0, (void*)&_wrap_class_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_stop_strategy = {"_p_stop_strategy", "stop_strategy *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_type_smoothing = {"_p_type_smoothing", "type_smoothing *", 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 _swigt__p_unsigned_long = {"_p_unsigned_long", "Xapian::rev *|unsigned long *|Xapian::totallength *", 0, 0, (void*)0, 0};

static swig_type_info *swig_type_initial[] = {
  &_swigt__p_Xapian__AssertionError,
  &_swigt__p_Xapian__BB2Weight,
  &_swigt__p_Xapian__BM25PlusWeight,
  &_swigt__p_Xapian__BM25Weight,
  &_swigt__p_Xapian__BoolWeight,
  &_swigt__p_Xapian__Compactor,
  &_swigt__p_Xapian__CoordWeight,
  &_swigt__p_Xapian__DLHWeight,
  &_swigt__p_Xapian__DPHWeight,
  &_swigt__p_Xapian__Database,
  &_swigt__p_Xapian__DatabaseClosedError,
  &_swigt__p_Xapian__DatabaseCorruptError,
  &_swigt__p_Xapian__DatabaseCreateError,
  &_swigt__p_Xapian__DatabaseError,
  &_swigt__p_Xapian__DatabaseLockError,
  &_swigt__p_Xapian__DatabaseModifiedError,
  &_swigt__p_Xapian__DatabaseNotFoundError,
  &_swigt__p_Xapian__DatabaseOpeningError,
  &_swigt__p_Xapian__DatabaseVersionError,
  &_swigt__p_Xapian__DateRangeProcessor,
  &_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__ExpandDeciderAnd,
  &_swigt__p_Xapian__ExpandDeciderFilterPrefix,
  &_swigt__p_Xapian__ExpandDeciderFilterTerms,
  &_swigt__p_Xapian__FeatureUnavailableError,
  &_swigt__p_Xapian__FieldProcessor,
  &_swigt__p_Xapian__FixedWeightPostingSource,
  &_swigt__p_Xapian__GreatCircleMetric,
  &_swigt__p_Xapian__IfB2Weight,
  &_swigt__p_Xapian__InL2Weight,
  &_swigt__p_Xapian__IneB2Weight,
  &_swigt__p_Xapian__InternalError,
  &_swigt__p_Xapian__InvalidArgumentError,
  &_swigt__p_Xapian__InvalidOperationError,
  &_swigt__p_Xapian__KeyMaker,
  &_swigt__p_Xapian__LMWeight,
  &_swigt__p_Xapian__LatLongCoord,
  &_swigt__p_Xapian__LatLongCoords,
  &_swigt__p_Xapian__LatLongCoordsIterator,
  &_swigt__p_Xapian__LatLongDistanceKeyMaker,
  &_swigt__p_Xapian__LatLongDistancePostingSource,
  &_swigt__p_Xapian__LatLongMetric,
  &_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__NetworkError,
  &_swigt__p_Xapian__NetworkTimeoutError,
  &_swigt__p_Xapian__NumberRangeProcessor,
  &_swigt__p_Xapian__NumberValueRangeProcessor,
  &_swigt__p_Xapian__PL2PlusWeight,
  &_swigt__p_Xapian__PL2Weight,
  &_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__RangeProcessor,
  &_swigt__p_Xapian__Registry,
  &_swigt__p_Xapian__RuntimeError,
  &_swigt__p_Xapian__SerialisationError,
  &_swigt__p_Xapian__SimpleStopper,
  &_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__TfIdfWeight,
  &_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__WildcardError,
  &_swigt__p_Xapian__WritableDatabase,
  &_swigt__p_compaction_level,
  &_swigt__p_docid_order,
  &_swigt__p_double,
  &_swigt__p_feature_flag,
  &_swigt__p_flags,
  &_swigt__p_int,
  &_swigt__p_std__string,
  &_swigt__p_stem_strategy,
  &_swigt__p_stop_strategy,
  &_swigt__p_type_smoothing,
  &_swigt__p_unsigned_int,
  &_swigt__p_unsigned_long,
};

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__BB2Weight[] = {  {&_swigt__p_Xapian__BB2Weight, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__BM25PlusWeight[] = {  {&_swigt__p_Xapian__BM25PlusWeight, 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__CoordWeight[] = {  {&_swigt__p_Xapian__CoordWeight, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__DLHWeight[] = {  {&_swigt__p_Xapian__DLHWeight, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__DPHWeight[] = {  {&_swigt__p_Xapian__DPHWeight, 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__DatabaseClosedError[] = {  {&_swigt__p_Xapian__DatabaseClosedError, 0, 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__DatabaseClosedError, _p_Xapian__DatabaseClosedErrorTo_p_Xapian__DatabaseError, 0, 0},  {&_swigt__p_Xapian__DatabaseNotFoundError, _p_Xapian__DatabaseNotFoundErrorTo_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__DatabaseNotFoundError[] = {  {&_swigt__p_Xapian__DatabaseNotFoundError, 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},  {&_swigt__p_Xapian__DatabaseNotFoundError, _p_Xapian__DatabaseNotFoundErrorTo_p_Xapian__DatabaseOpeningError, 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__DateRangeProcessor[] = {  {&_swigt__p_Xapian__DateRangeProcessor, 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__WildcardError, _p_Xapian__WildcardErrorTo_p_Xapian__Error, 0, 0},  {&_swigt__p_Xapian__DatabaseNotFoundError, _p_Xapian__DatabaseNotFoundErrorTo_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__UnimplementedError, _p_Xapian__UnimplementedErrorTo_p_Xapian__Error, 0, 0},  {&_swigt__p_Xapian__DatabaseClosedError, _p_Xapian__DatabaseClosedErrorTo_p_Xapian__Error, 0, 0},  {&_swigt__p_Xapian__DatabaseModifiedError, _p_Xapian__DatabaseModifiedErrorTo_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__RuntimeError, _p_Xapian__RuntimeErrorTo_p_Xapian__Error, 0, 0},  {&_swigt__p_Xapian__RangeError, _p_Xapian__RangeErrorTo_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__ExpandDeciderFilterTerms[] = {{&_swigt__p_Xapian__ExpandDeciderFilterTerms, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ExpandDecider[] = {  {&_swigt__p_Xapian__ExpandDeciderFilterPrefix, _p_Xapian__ExpandDeciderFilterPrefixTo_p_Xapian__ExpandDecider, 0, 0},  {&_swigt__p_Xapian__ExpandDecider, 0, 0, 0},  {&_swigt__p_Xapian__ExpandDeciderAnd, _p_Xapian__ExpandDeciderAndTo_p_Xapian__ExpandDecider, 0, 0},  {&_swigt__p_Xapian__ExpandDeciderFilterTerms, _p_Xapian__ExpandDeciderFilterTermsTo_p_Xapian__ExpandDecider, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ExpandDeciderAnd[] = {  {&_swigt__p_Xapian__ExpandDeciderAnd, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ExpandDeciderFilterPrefix[] = {  {&_swigt__p_Xapian__ExpandDeciderFilterPrefix, 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__FieldProcessor[] = {  {&_swigt__p_Xapian__FieldProcessor, 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__GreatCircleMetric[] = {  {&_swigt__p_Xapian__GreatCircleMetric, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__IfB2Weight[] = {  {&_swigt__p_Xapian__IfB2Weight, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__InL2Weight[] = {  {&_swigt__p_Xapian__InL2Weight, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__IneB2Weight[] = {  {&_swigt__p_Xapian__IneB2Weight, 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__KeyMaker, 0, 0, 0},  {&_swigt__p_Xapian__MultiValueKeyMaker, _p_Xapian__MultiValueKeyMakerTo_p_Xapian__KeyMaker, 0, 0},  {&_swigt__p_Xapian__LatLongDistanceKeyMaker, _p_Xapian__LatLongDistanceKeyMakerTo_p_Xapian__KeyMaker, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__LMWeight[] = {  {&_swigt__p_Xapian__LMWeight, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__LatLongCoord[] = {  {&_swigt__p_Xapian__LatLongCoord, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__LatLongCoords[] = {  {&_swigt__p_Xapian__LatLongCoords, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__LatLongCoordsIterator[] = {  {&_swigt__p_Xapian__LatLongCoordsIterator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__LatLongDistanceKeyMaker[] = {  {&_swigt__p_Xapian__LatLongDistanceKeyMaker, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__LatLongDistancePostingSource[] = {  {&_swigt__p_Xapian__LatLongDistancePostingSource, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__LatLongMetric[] = {  {&_swigt__p_Xapian__LatLongMetric, 0, 0, 0},  {&_swigt__p_Xapian__GreatCircleMetric, _p_Xapian__GreatCircleMetricTo_p_Xapian__LatLongMetric, 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__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__NumberRangeProcessor[] = {  {&_swigt__p_Xapian__NumberRangeProcessor, 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__PL2PlusWeight[] = {  {&_swigt__p_Xapian__PL2PlusWeight, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__PL2Weight[] = {  {&_swigt__p_Xapian__PL2Weight, 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__LatLongDistancePostingSource, _p_Xapian__LatLongDistancePostingSourceTo_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__RangeProcessor[] = {  {&_swigt__p_Xapian__RangeProcessor, 0, 0, 0},  {&_swigt__p_Xapian__DateRangeProcessor, _p_Xapian__DateRangeProcessorTo_p_Xapian__RangeProcessor, 0, 0},  {&_swigt__p_Xapian__NumberRangeProcessor, _p_Xapian__NumberRangeProcessorTo_p_Xapian__RangeProcessor, 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__WildcardError, _p_Xapian__WildcardErrorTo_p_Xapian__RuntimeError, 0, 0},  {&_swigt__p_Xapian__DatabaseNotFoundError, _p_Xapian__DatabaseNotFoundErrorTo_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__DatabaseClosedError, _p_Xapian__DatabaseClosedErrorTo_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__DatabaseVersionError, _p_Xapian__DatabaseVersionErrorTo_p_Xapian__RuntimeError, 0, 0},  {&_swigt__p_Xapian__SerialisationError, _p_Xapian__SerialisationErrorTo_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__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__TfIdfWeight[] = {  {&_swigt__p_Xapian__TfIdfWeight, 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},  {&_swigt__p_Xapian__LatLongDistancePostingSource, _p_Xapian__LatLongDistancePostingSourceTo_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__DPHWeight, _p_Xapian__DPHWeightTo_p_Xapian__Weight, 0, 0},  {&_swigt__p_Xapian__PL2Weight, _p_Xapian__PL2WeightTo_p_Xapian__Weight, 0, 0},  {&_swigt__p_Xapian__DLHWeight, _p_Xapian__DLHWeightTo_p_Xapian__Weight, 0, 0},  {&_swigt__p_Xapian__BB2Weight, _p_Xapian__BB2WeightTo_p_Xapian__Weight, 0, 0},  {&_swigt__p_Xapian__IneB2Weight, _p_Xapian__IneB2WeightTo_p_Xapian__Weight, 0, 0},  {&_swigt__p_Xapian__IfB2Weight, _p_Xapian__IfB2WeightTo_p_Xapian__Weight, 0, 0},  {&_swigt__p_Xapian__InL2Weight, _p_Xapian__InL2WeightTo_p_Xapian__Weight, 0, 0},  {&_swigt__p_Xapian__TradWeight, _p_Xapian__TradWeightTo_p_Xapian__Weight, 0, 0},  {&_swigt__p_Xapian__TfIdfWeight, _p_Xapian__TfIdfWeightTo_p_Xapian__Weight, 0, 0},  {&_swigt__p_Xapian__BoolWeight, _p_Xapian__BoolWeightTo_p_Xapian__Weight, 0, 0},  {&_swigt__p_Xapian__CoordWeight, _p_Xapian__CoordWeightTo_p_Xapian__Weight, 0, 0},  {&_swigt__p_Xapian__LMWeight, _p_Xapian__LMWeightTo_p_Xapian__Weight, 0, 0},  {&_swigt__p_Xapian__PL2PlusWeight, _p_Xapian__PL2PlusWeightTo_p_Xapian__Weight, 0, 0},  {&_swigt__p_Xapian__Weight, 0, 0, 0},  {&_swigt__p_Xapian__BM25PlusWeight, _p_Xapian__BM25PlusWeightTo_p_Xapian__Weight, 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__WildcardError[] = {  {&_swigt__p_Xapian__WildcardError, 0, 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_flags[] = {  {&_swigt__p_flags, 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_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_stop_strategy[] = {  {&_swigt__p_stop_strategy, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_type_smoothing[] = {  {&_swigt__p_type_smoothing, 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 _swigc__p_unsigned_long[] = {  {&_swigt__p_unsigned_long, 0, 0, 0},{0, 0, 0, 0}};

static swig_cast_info *swig_cast_initial[] = {
  _swigc__p_Xapian__AssertionError,
  _swigc__p_Xapian__BB2Weight,
  _swigc__p_Xapian__BM25PlusWeight,
  _swigc__p_Xapian__BM25Weight,
  _swigc__p_Xapian__BoolWeight,
  _swigc__p_Xapian__Compactor,
  _swigc__p_Xapian__CoordWeight,
  _swigc__p_Xapian__DLHWeight,
  _swigc__p_Xapian__DPHWeight,
  _swigc__p_Xapian__Database,
  _swigc__p_Xapian__DatabaseClosedError,
  _swigc__p_Xapian__DatabaseCorruptError,
  _swigc__p_Xapian__DatabaseCreateError,
  _swigc__p_Xapian__DatabaseError,
  _swigc__p_Xapian__DatabaseLockError,
  _swigc__p_Xapian__DatabaseModifiedError,
  _swigc__p_Xapian__DatabaseNotFoundError,
  _swigc__p_Xapian__DatabaseOpeningError,
  _swigc__p_Xapian__DatabaseVersionError,
  _swigc__p_Xapian__DateRangeProcessor,
  _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__ExpandDeciderAnd,
  _swigc__p_Xapian__ExpandDeciderFilterPrefix,
  _swigc__p_Xapian__ExpandDeciderFilterTerms,
  _swigc__p_Xapian__FeatureUnavailableError,
  _swigc__p_Xapian__FieldProcessor,
  _swigc__p_Xapian__FixedWeightPostingSource,
  _swigc__p_Xapian__GreatCircleMetric,
  _swigc__p_Xapian__IfB2Weight,
  _swigc__p_Xapian__InL2Weight,
  _swigc__p_Xapian__IneB2Weight,
  _swigc__p_Xapian__InternalError,
  _swigc__p_Xapian__InvalidArgumentError,
  _swigc__p_Xapian__InvalidOperationError,
  _swigc__p_Xapian__KeyMaker,
  _swigc__p_Xapian__LMWeight,
  _swigc__p_Xapian__LatLongCoord,
  _swigc__p_Xapian__LatLongCoords,
  _swigc__p_Xapian__LatLongCoordsIterator,
  _swigc__p_Xapian__LatLongDistanceKeyMaker,
  _swigc__p_Xapian__LatLongDistancePostingSource,
  _swigc__p_Xapian__LatLongMetric,
  _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__NetworkError,
  _swigc__p_Xapian__NetworkTimeoutError,
  _swigc__p_Xapian__NumberRangeProcessor,
  _swigc__p_Xapian__NumberValueRangeProcessor,
  _swigc__p_Xapian__PL2PlusWeight,
  _swigc__p_Xapian__PL2Weight,
  _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__RangeProcessor,
  _swigc__p_Xapian__Registry,
  _swigc__p_Xapian__RuntimeError,
  _swigc__p_Xapian__SerialisationError,
  _swigc__p_Xapian__SimpleStopper,
  _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__TfIdfWeight,
  _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__WildcardError,
  _swigc__p_Xapian__WritableDatabase,
  _swigc__p_compaction_level,
  _swigc__p_docid_order,
  _swigc__p_double,
  _swigc__p_feature_flag,
  _swigc__p_flags,
  _swigc__p_int,
  _swigc__p_std__string,
  _swigc__p_stem_strategy,
  _swigc__p_stop_strategy,
  _swigc__p_type_smoothing,
  _swigc__p_unsigned_int,
  _swigc__p_unsigned_long,
};


/* -------- 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 statically 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 init;

  /* 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);
  } else {
    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
    iter=module_head;
    do {
      if (iter==&swig_module) {
        /* Our module is already in the list, so there's nothing more to do. */
        return;
      }
      iter=iter->next;
    } while (iter!= module_head);

    /* otherwise we must add our module into the list */
    swig_module.next = module_head->next;
    module_head->next = &swig_module;
  }

  /* When multiple interpreters 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 earlier #define will rename it
*/
#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
LUALIB_API int SWIG_init(lua_State* L)
#else
SWIGEXPORT int SWIG_init(lua_State* L) /* default Lua action */
#endif
{
#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) /* valid for both Lua and eLua */
  int i;
  int globalRegister = 0;
  /* start with global table */
  lua_pushglobaltable (L);
  /* SWIG's internal initialisation */
  SWIG_InitializeModule((void*)L);
  SWIG_PropagateClientData();
#endif

#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) || defined(SWIG_LUA_ELUA_EMULATE)
  /* add a global fn */
  SWIG_Lua_add_function(L,"swig_type",SWIG_Lua_type);
  SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_class_equal);
#endif

#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
  /* set up base class pointers (the hierarchy) */
  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));
    }
  }
#ifdef SWIG_LUA_MODULE_GLOBAL
  globalRegister = 1;
#endif


#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
  SWIG_Lua_namespace_register(L,&swig_SwigModule, globalRegister);
#endif

#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
  for (i = 0; swig_types[i]; i++){
    if (swig_types[i]->clientdata){
      SWIG_Lua_elua_class_register_instance(L,(swig_lua_class*)(swig_types[i]->clientdata));
    }
  }
#endif

#if defined(SWIG_LUA_ELUA_EMULATE)
  lua_newtable(L);
  SWIG_Lua_elua_emulate_register(L,swig_SwigModule.ns_methods);
  SWIG_Lua_elua_emulate_register_clear(L);
  if(globalRegister) {
    lua_pushstring(L,swig_SwigModule.name);
    lua_pushvalue(L,-2);
    lua_rawset(L,-4);
  }
#endif

#endif

#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
  /* invoke user-specific initialization */
  SWIG_init_user(L);
  /* end module */
  /* Note: We do not clean up the stack here (Lua will do this for us). At this
     point, we have the globals table and out module table on the stack. Returning
     one value makes the module table the result of the require command. */
  return 1;
#else
  return 0;
#endif
}

#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);
}

