@classmethod
def get_by(cls, prop, value, offset=0, size=1):
    """Get an object using a query on a specific property

        prop must be one of the properties defined in the Document.
        If value is a list type a terms query is used.
        """
    query_type = isinstance(value, (list, tuple)) and 'terms' or 'term'
    body = {'query': {query_type: {prop.get_query_name(): value}}, 'size':
        size, 'from': offset}
    hits = cls.search(body)
    return hits['hits']['hits']
