Searches the current entity for an instance with the specified index.

        Returns:
            The wanted instance if found, otherwise it returns `None`.
15308
def find(self, *index):
        
        assert self.wrapFunction is not None
        if len(index) == 1 and isinstance(index[0], (tuple, list)):
            index = index[0]
        it = self._impl.find(Tuple(index)._impl)
        if it == self._impl.end():
            return None
        else:
            return self.wrapFunction(it)
161219
def get_property(self, index, doctype, name):
        

        return self.indices[index][doctype].properties[name]
1045044
def find_by_index(self, cls, index_name, value):
        """"""
        return self._find(cls, {index_name: str(value)})
330730
def getIndexedValue(self, index):
        
        actions = self._actions

        if (type (actions) is list):
            dict = actions[index]
        else:
            dict = actions
        return dict.get('value', 'NoValue')
290936
def index(self, refresh=False):
        """"""
        es = connections.get_connection("default")
        index = self.__class__.search_objects.mapping.index
        doc_type = self.__class__.search_objects.mapping.doc_type
        es.index(index, doc_type,
                 id=self.pk,
                 body=self.to_dict(),
                 refresh=refresh)
1364289
def get_document(self, index=0):
        
        try:
            return Document(self.metadata()['alveo:documents'][index], self.client)
        except IndexError:
            raise ValueError('No document exists for this item with index: '
                             + str(index))
16775
def exists(self, using=None, **kwargs):
        
        return self._get_connection(using).indices.exists(index=self._name, **kwargs)
912764
def index(self, alias):
        
        clone = self._clone()
        clone._index = alias
        return clone
1080975
def get_index(self, index, type, alias=None, typed=None, read_only=True, kwargs=None):
        
        if kwargs.tjson != None:
            Log.error("used `typed` parameter, not `tjson`")
        if read_only:
            # GET EXACT MATCH, OR ALIAS
            aliases = wrap(self.get_aliases())
            if index in aliases.index:
                pass
            elif index in aliases.alias:
                match = [a for a in aliases if a.alias == index][0]
                kwargs.alias = match.alias
                kwargs.index = match.index
            else:
                Log.error("Can not find index {{index_name}}", index_name=kwargs.index)
            return Index(kwargs=kwargs, cluster=self)
        else:
            # GET BEST MATCH, INCLUDING PROTOTYPE
            best = self.get_best_matching_index(index, alias)
            if not best:
                Log.error("Can not find index {{index_name}}", index_name=kwargs.index)

            if best.alias != None:
                kwargs.alias = best.alias
                kwargs.index = best.index
            elif kwargs.alias == None:
                kwargs.alias = kwargs.index
                kwargs.index = best.index

            return Index(kwargs=kwargs, cluster=self)
915947
def search(self, using=None):
        
        return Search(
            using=using or self._using,
            index=self._name,
            doc_type=self._doc_types
        )
991192
def find_by_index(self, cls, index_name, value):
        """"""
        cur = self._conn().cursor()

        query = 'select id,value from %s where %s = ?' % (
            cls.get_table_name(),
            index_name
        )

        found = []
        for row in cur.execute(query, (value,)):
            id, data = row[0], row[1]
            obj = cls.from_data(data)
            assert id == obj.id
            found.append(obj)

        cur.close()

        return found
227648
def go_to_index(self, index):
        
        return CompletionState(self.original_document, self.current_completions, complete_index=index)
1114650
def getitem(self, index, context=None):
        
        return _container_getitem(self, self.elts, index, context=context)
234422
def get(self, instance, aslist=False, **kwargs):
        
        refs = self.get_versioned_references_for(instance)

        if not self.multiValued:
            if len(refs) > 1:
                logger.warning("Found {} references for non-multivalued "
                               "reference field '{}' of {}".format(
                                   len(refs), self.getName(), repr(instance)))
            if not aslist:
                if refs:
                    refs = refs[0]
                else:
                    refs = None

        if not self.referencesSortable or not hasattr(
                aq_base(instance), "at_ordered_refs"):
            return refs

        refs = instance.at_ordered_refs
        order = refs[self.relationship]
        if order is None:
            return refs

        by_uid = dict(map(lambda ob: (api.get_uid(ob), ob), refs))
        return [by_uid[uid] for uid in order if uid in by_uid]
1187986
async def get_entity(self):
        
        if not self.entity and await self.get_input_entity():
            try:
                self._entity =\
                    await self._client.get_entity(self._input_entity)
            except ValueError:
                pass

        return self._entity
690708
def get(self, object_id, cls=None):
        
        cls = self.cls if cls is None else cls
        return self.session.query(cls).get(object_id)
1350472
def get_models(cls, index, as_class=False):
        '''
        
        '''
        try:
            return cls._index_to_model[index] if as_class else cls._idx_name_to_mdl_to_mdlidx[index].keys()
        except KeyError:
            raise KeyError('Could not find any index named {}. Is this index defined in BUNGIESEARCH["INDICES"]?'.format(index))