Performs a secondary index query.
334239
def get_index(self, bucket, index, startkey, endkey=None,
                  return_terms=None, max_results=None, continuation=None,
                  timeout=None, term_regex=None):
        
        raise NotImplementedError
731760
def __store_query(self, query_items):
        
        temp_index = self._current_query_index
        if len(self._queries) - 1 < temp_index:
            self._queries.append([])

        self._queries[temp_index].append(query_items)
160267
def find_by_index(self, cls, index_name, value):
        """"""
        return self.backend.find_by_index(cls, index_name, value)
25138
@Override
    public void index(ByteBuffer key, ColumnFamily columnFamily) {
        Log.debug("Indexing row %s in index %s ", key, logName);
        lock.readLock().lock();
        try {
            if (rowService != null) {
                long timestamp = System.currentTimeMillis();
                rowService.index(key, columnFamily, timestamp);
            }
        } catch (RuntimeException e) {
            Log.error("Error while indexing row %s", key);
            throw e;
        } finally {
            lock.readLock().unlock();
        }
    }
15173
def addIndex(self, index):
        
        index.setSchema(self)
        self.__indexes[index.name()] = index
685147
private function loadIndexes(): void
    {
        if (null !== $this->gsi) {
            return;
        }

        $this->gsi = [];
        foreach ($this->getIndexes() as $gsi) {
            $this->gsi[$gsi->getAlias()] = $gsi;
        }
    }
1326545
public synchronized void index(long offset, long term) {
    if (lookup(offset) != term) {
      terms.put(offset, term);
    }
  }
577983
private void indexQuery(QueryEntry entry, ServerSessionContext session, CompletableFuture<QueryResponse> future) {
    // If the query index is greater than the session's last applied index, queue the request for handling once the
    // state machine is caught up.
    if (entry.getIndex() > session.getLastApplied()) {
      session.registerIndexQuery(entry.getIndex(), () -> applyQuery(entry, future));
    } else {
      applyQuery(entry, future);
    }
  }
1315677
private void initializeSecondaryIndexer() {
    SecondaryIndex secondaryIndexAnnotation = field.getAnnotation(SecondaryIndex.class);
    if (secondaryIndexAnnotation == null) {
      return;
    }
    String indexName = secondaryIndexAnnotation.name();
    if (indexName == null || indexName.trim().length() == 0) {
      indexName = DEFAULT_SECONDARY_INDEX_PREFIX + mappedName;
    }
    this.secondaryIndexName = indexName;
    try {
      secondaryIndexer = IndexerFactory.getInstance().getIndexer(field);
    } catch (Exception exp) {
      String pattern = "No suitable Indexer found or error occurred while creating the indexer "
          + "for field %s in class %s";
      String message = String.format(pattern, field.getName(), field.getDeclaringClass().getName());
      throw new EntityManagerException(message, exp);
    }

  }
673407
@Override
    public void index(Class entityClazz, EntityMetadata m, Map<String, Object> values, Object parentId,
            Class parentClazz)
    {
        Set<String> indexNames = values.keySet();
        for (String idx_Name : indexNames)
        {
            Double value = (Double) values.get(idx_Name);
            Pipeline pipeLine = null;
            try
            {
                if (this.pipeLineOrConnection.getClass().isAssignableFrom(Jedis.class))
                {
                    pipeLine = ((Jedis) this.pipeLineOrConnection).pipelined();
                    pipeLine.zadd(idx_Name, value, parentId.toString());
                    // pipeLine.sync();
                }
                else
                {
                    ((Transaction) this.pipeLineOrConnection).zadd(idx_Name, value, parentId.toString());
                }
            }
            finally
            {
                if (pipeLine != null)
                {
                    pipeLine.sync();
                }
            }
        }

    }
356465
public void setLastApplied(long index) {
    // Query callbacks for this session are added to the indexQueries map to be executed once the required index
    // for the query is reached. For each increment of the index, trigger query callbacks that are dependent
    // on the specific index.
    for (long i = lastApplied + 1; i <= index; i++) {
      lastApplied = i;
      List<Runnable> queries = this.indexQueries.remove(lastApplied);
      if (queries != null) {
        for (Runnable query : queries) {
          query.run();
        }
      }
    }
  }
408804
private List<T> records(int index, List<T> records, boolean reverse){
        this.index = index;
        if(reverse)
            Collections.reverse(records);
        firstRow = records.get(0);
        lastRow = records.get(records.size()-1);
        return records;
    }
1045044
def find_by_index(self, cls, index_name, value):
        """"""
        return self._find(cls, {index_name: str(value)})
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
        )
802014
def _index_and_mapping(self, namespace):
        """"""
        index, doc_type = namespace.split(".", 1)
        return index.lower(), doc_type
1135689
private Map<String, Map<String, IndexData>> processIndexes(TableDescription tableDescription,
                                                               ProjectionExpressionBuilder projectionExpressionBuilder,
                                                               IndexData baseIndexData) {
        // Collect information about the local secondary indexes.  These will be included with the global indexes below.
        Map<String, IndexData> localIndexes;
        List<LocalSecondaryIndexDescription> localSecondaryIndexes = tableDescription.getLocalSecondaryIndexes();
        if (localSecondaryIndexes != null) {
            localIndexes = new HashMap<>(localSecondaryIndexes.size() + 2);

            // We include these as local indexes to make findUsingQueryModel() code below simpler
            localIndexes.put(rangeKeyField, baseIndexData);
            localIndexes.put(null, baseIndexData);

            for (LocalSecondaryIndexDescription description : localSecondaryIndexes) {
                String indexField = getKeyAttributeNames(description.getKeySchema()).getSecond();
                boolean projectsOverEntity = description.getProjection().getProjectionType().equals("ALL")
                                             || projectionExpressionBuilder != null
                                                && projectionExpressionBuilder.isCoveredBy(description.getProjection());

                List<String> keyFields = new ArrayList<>(baseIndexData.keyFields);
                keyFields.add(indexField);

                localIndexes.put(indexField, new IndexData(description.getIndexName(), keyFields, projectsOverEntity));
            }
        } else if (rangeKeyField != null) {
            localIndexes = new HashMap<>(2);

            localIndexes.put(rangeKeyField, baseIndexData);
            localIndexes.put(null, baseIndexData);
        } else {
            localIndexes = Collections.singletonMap(null, baseIndexData);
        }

        // Process the global secondary indexes.  When done, add the local index information.
        List<GlobalSecondaryIndexDescription> globalSecondaryIndexes = tableDescription.getGlobalSecondaryIndexes();
        if (globalSecondaryIndexes != null) {
            Map<String, Map<String, IndexData>> indexes = new HashMap<>(globalSecondaryIndexes.size() + 1);

            for (GlobalSecondaryIndexDescription description : globalSecondaryIndexes) {
                Pair<String, String> indexFields = getKeyAttributeNames(description.getKeySchema());
                boolean projectsOverEntity = description.getProjection().getProjectionType().equals("ALL")
                                             || projectionExpressionBuilder != null
                                                && projectionExpressionBuilder.isCoveredBy(description.getProjection());

                List<String> keyFields = new ArrayList<>();
                keyFields.add(indexFields.getFirst());
                if (indexFields.getSecond() != null) {
                    keyFields.add(indexFields.getSecond());
                }
                keyFields.add(hashKeyField);
                if (rangeKeyField != null) {
                    keyFields.add(rangeKeyField);
                }

                IndexData indexData = new IndexData(description.getIndexName(), keyFields, projectsOverEntity);

                if (!indexes.containsKey(indexFields.getFirst())) {
                    indexes.put(indexFields.getFirst(), new HashMap<String, IndexData>());
                }

                indexes.get(indexFields.getFirst()).put(indexFields.getSecond(), indexData);

                // In case a query doesn't specify a range key, we still want to select an index for this hash key.
                // If one has already been selected, pick one that projects over this entity to avoid extra DB reads.
                IndexData noRangeKeyIndexData = indexes.get(indexFields.getFirst()).get(null);
                if (noRangeKeyIndexData == null || !noRangeKeyIndexData.projectsOverEntity) {
                    indexes.get(indexFields.getFirst()).put(null, indexData);
                }
            }

            indexes.put(hashKeyField, localIndexes);

            return indexes;
        } else {
            return Collections.singletonMap(hashKeyField, localIndexes);
        }
    }
784026
def filter(self, **kwargs):
        """"""
        assert not self._primary_keys
        self.queryset = self.queryset.filter(**kwargs)
        return self