Lists the context types available in an index
353514
def list_types(index_name, host='localhost',port='9200'):
        '''
        
        '''
        return ElasticSearch(host=host, port=port).type_list(index_name)
318497
def get_list_index(lst, index_or_name):
    
    if isinstance(index_or_name, six.integer_types):
        return index_or_name

    return lst.index(index_or_name)
1021002
def list(self, request):
        """"""
        query = get_query_params(request).get("search", "")
        results = []
        base = self.model.get_base_class()
        doctypes = indexable_registry.families[base]
        for doctype, klass in doctypes.items():
            name = klass._meta.verbose_name.title()
            if query.lower() in name.lower():
                results.append(dict(
                    name=name,
                    doctype=doctype
                ))
                results.sort(key=lambda x: x["name"])
        return Response(dict(results=results))
102797
def get_context_data(self, **kwargs):
        """"""
        
        context = super(CrossTypeAnimalList, self).get_context_data(**kwargs)
        context['list_type'] = self.kwargs['breeding_type']
        return context
43728
function indexWidgets() {
  const { widgets = {} } = getComponentsSettings();

  return index({
    file: 'widgets.js',
    config: {
      type: TYPE_WIDGETS,
      config: widgets,
    },
    ...getIndexLogTranslations(TYPE_WIDGETS),
  });
}
591659
function getSearchableIndexFormAttrs(isindexStartTagToken) {
    var indexAction = Tokenizer.getTokenAttr(isindexStartTagToken, ATTRS.ACTION),
        attrs = [];

    if (indexAction !== null) {
        attrs.push({
            name: ATTRS.ACTION,
            value: indexAction
        });
    }

    return attrs;
}
433755
def index(ctx, view):
    """"""
    adapter = ctx.obj['adapter']
    if view:
        click.echo(adapter.indexes())
        return
    adapter.ensure_indexes()
292900
function getIndex(index) {
        if (this[_privateKey]._options.keysIgnoreCase && typeof index === 'string') {
            const indexLowerCase = index.toLowerCase();
            for (const key in this[_privateKey]._schema) {
                if (typeof key === 'string' && key.toLowerCase() === indexLowerCase) {
                    return key;
                }
            }
        }

        return index;
    }
689371
def index_list(self):
        '''
        
        '''
        logger.info('Listing indexes')
        _ix = {}
        _i = self.inspector
        for tbl in _i.get_table_names():
            _ix.setdefault(tbl, [])
            for ix in _i.get_indexes(tbl):
                _ix[tbl].append(ix)
        return _ix
128759
public static function getContextTypes(): array
    {
        return [
            self::CONTEXT_TYPE_CONTROLLER => __d('model_history', 'context.type.controller'),
            self::CONTEXT_TYPE_SHELL => __d('model_history', 'context.type.shell'),
            self::CONTEXT_TYPE_SLUG => __d('model_history', 'context.type.slug')
        ];
    }
979823
public static void index(final IndexContext _context,
                             final List<Instance> _instances)
        throws EFapsException
    {
        if (CollectionUtils.isNotEmpty(_instances)) {
            final Company currentCompany = Context.getThreadContext().getCompany();
            final String currentLanguage = Context.getThreadContext().getLanguage();

            Context.getThreadContext().setCompany(Company.get(_context.getCompanyId()));
            Context.getThreadContext().setLanguage(_context.getLanguage());
            final IndexWriterConfig config = new IndexWriterConfig(_context.getAnalyzer());
            try (
                    IndexWriter writer = new IndexWriter(_context.getDirectory(), config);
                    TaxonomyWriter taxonomyWriter = new DirectoryTaxonomyWriter(_context.getTaxonomyDirectory());
                ) {

                final IndexDefinition def = IndexDefinition.get(_instances.get(0).getType().getUUID());
                final MultiPrintQuery multi = new MultiPrintQuery(_instances);
                for (final IndexField field : def.getFields()) {
                    multi.addSelect(field.getSelect());
                }
                Attribute createdAttr = null;
                if (!_instances.get(0).getType().getAttributes(CreatedType.class).isEmpty()) {
                    createdAttr = _instances.get(0).getType().getAttributes(CreatedType.class).iterator().next();
                    multi.addAttribute(createdAttr);
                }
                multi.addMsgPhrase(def.getMsgPhrase());
                multi.executeWithoutAccessCheck();
                while (multi.next()) {
                    final String oid = multi.getCurrentInstance().getOid();
                    final String type = multi.getCurrentInstance().getType().getLabel();
                    final DateTime created;
                    if (createdAttr == null) {
                        created = new DateTime();
                    } else {
                        created = multi.getAttribute(createdAttr);
                    }

                    final Document doc = new Document();
                    doc.add(new FacetField(Dimension.DIMTYPE.name(), type));
                    doc.add(new FacetField(Dimension.DIMCREATED.name(), String.valueOf(created.getYear()),
                                    String.format("%02d", created.getMonthOfYear())));
                    doc.add(new StringField(Key.OID.name(), oid, Store.YES));
                    doc.add(new TextField(DBProperties.getProperty("index.Type"), type, Store.YES));
                    doc.add(new NumericDocValuesField(Key.CREATED.name(), created.getMillis()));
                    doc.add(new StringField(Key.CREATEDSTR.name(),
                                    DateTools.dateToString(created.toDate(), DateTools.Resolution.DAY), Store.NO));

                    final StringBuilder allBldr = new StringBuilder()
                                    .append(type).append(" ");

                    for (final IndexField field : def.getFields()) {
                        final String name = DBProperties.getProperty(field.getKey());
                        Object value = multi.getSelect(field.getSelect());
                        if (value != null) {
                            if (StringUtils.isNoneEmpty(field.getTransform())) {
                                final Class<?> clazz = Class.forName(field.getTransform(),
                                                false, EFapsClassLoader.getInstance());
                                final ITransformer transformer = (ITransformer) clazz.newInstance();
                                value = transformer.transform(value);
                            }
                            switch (field.getFieldType()) {
                                case LONG:
                                    long val = 0;
                                    if (value instanceof String) {
                                        val = NumberUtils.toLong((String) value);
                                    } else if (value instanceof Number) {
                                        val = ((Number) value).longValue();
                                    }
                                    doc.add(new LongField(name, val, Store.YES));
                                    allBldr.append(value).append(" ");
                                    break;
                                case SEARCHLONG:
                                    long val2 = 0;
                                    if (value instanceof String) {
                                        val2 = NumberUtils.toLong((String) value);
                                    } else if (value instanceof Number) {
                                        val2 = ((Number) value).longValue();
                                    }
                                    doc.add(new LongField(name, val2, Store.NO));
                                    allBldr.append(value).append(" ");
                                    break;
                                case STRING:
                                    doc.add(new StringField(name, String.valueOf(value), Store.YES));
                                    allBldr.append(value).append(" ");
                                    break;
                                case SEARCHSTRING:
                                    doc.add(new StringField(name, String.valueOf(value), Store.NO));
                                    allBldr.append(value).append(" ");
                                    break;
                                case TEXT:
                                    doc.add(new TextField(name, String.valueOf(value), Store.YES));
                                    allBldr.append(value).append(" ");
                                    break;
                                case SEARCHTEXT:
                                    doc.add(new TextField(name, String.valueOf(value), Store.NO));
                                    allBldr.append(value).append(" ");
                                    break;
                                case STORED:
                                    doc.add(new StoredField(name, String.valueOf(value)));
                                    allBldr.append(value).append(" ");
                                    break;
                                default:
                                    break;
                            }
                        }
                    }
                    doc.add(new StoredField(Key.MSGPHRASE.name(), multi.getMsgPhrase(def.getMsgPhrase())));
                    doc.add(new TextField(Key.ALL.name(), allBldr.toString(), Store.NO));
                    writer.updateDocument(new Term(Key.OID.name(), oid),
                                    Index.getFacetsConfig().build(taxonomyWriter, doc));
                    LOG.debug("Add Document: {}", doc);
                }
                writer.close();
                taxonomyWriter.close();
            } catch (final IOException | ClassNotFoundException | InstantiationException | IllegalAccessException e) {
                throw new EFapsException(Indexer.class, "IOException", e);
            } finally {
                Context.getThreadContext().setCompany(currentCompany);
                Context.getThreadContext().setLanguage(currentLanguage);
            }
        }
    }
884564
def _index_classes(self) -> Dict[Text, Type[Platform]]:
        

        out = {}

        for p in get_platform_settings():
            cls: Type[Platform] = import_class(p['class'])

            if 'name' in p:
                out[p['name']] = cls
            else:
                out[cls.NAME] = cls

        return out
749795
def get_context_data(self, **kwargs):
        """"""
        
        context = super(AnimalListAlive, self).get_context_data(**kwargs)
        context['list_type'] = 'Alive'
        return context
1009895
def index(self, request):
        """"""
        objects = self.model.objects.all()

        return self._render(
            request = request,
            template = 'index',
            context = {
                cc2us(pluralize(self.model.__name__)): objects,
            },
            status = 200
        )
936152
def _get_indexes(self):
        """"""
        indexes = {}
        for resource in self._get_elastic_resources():
            try:
                index = self._resource_index(resource)

            except KeyError:  # ignore missing
                continue

            if index not in indexes:
                indexes.update({
                    index: {
                        'resource': self.elastic(resource),
                        'index_settings': {
                            'mappings': {}
                        }
                    }
                })

                settings = self._resource_config(resource, 'SETTINGS')
                if settings:
                    indexes[index]['index_settings'].update(settings)

            resource_config = self.app.config['DOMAIN'][resource]
            properties = self._get_mapping_properties(resource_config, parent=self._get_parent_type(resource))
            datasource = self.get_datasource(resource)
            indexes[index]['index_settings']['mappings'][datasource[0]] = properties

        return indexes
1252346
def List(self, name, initial=None):
        
        return types.List(name, self.api, initial=initial)
1223569
def index(self, type_: Type[T]) -> int:
        
        for i, cond in ((q[0], q[1][0]) for q in enumerate(self.handlers)):
            try:
                match = cond(type_)
            except:
                if self.raiseconditionerrors:
                    raise
                match = False
            if match:
                return i
        raise ValueError('No matching condition found')