def missing(self, field, last=True):
        '''
        Numeric fields support specific handling for missing fields in a doc.
        The missing value can be _last, _first, or a custom value
        (that will be used for missing docs as the sort value).

        missing('price')
        > {"price" : {"missing": "_last" } }
        missing('price',False)
        > {"price" : {"missing": "_first"} }
        '''
        if last:
            self.append({field: {'missing': '_last'}})
        else:
            self.append({field: {'missing': '_first'}})

        return self
def missing ( self , field , last = True ) : if last : self . append ( { field : { 'missing' : '_last' } } ) else : self . append ( { field : { 'missing' : '_first' } } ) return self
Numeric fields support specific handling for missing fields in a doc.
        The missing value can be _last, _first, or a custom value
        (that will be used for missing docs as the sort value).

        missing('price')
        > {"price" : {"missing": "_last" } }
        missing('price',False)
        > {"price" : {"missing": "_first"} }