Returns the last document stored in the Solr engine.
498833
def get_last_doc(self):
        
        #search everything, sort by descending timestamp, return 1 row
        try:
            result = self.solr.search('*:*', sort='_ts desc', rows=1)
        except ValueError:
            return None

        for r in result:
            r['_id'] = r.pop(self.unique_key)
            return r
928266
public int last() {
    assertNonEmpty();
    short lastKey = keys[size - 1];
    Container container = values[size - 1];
    return lastKey << 16 | container.last();
  }
415843
def get_last_item_field(self, field, filters_=[], offset=False):
        '''
            
        '''

        last_value = None

        url = self.index_url
        url += "/_search"

        if filters_ is None:
            filters_ = []

        terms = []
        for filter_ in filters_:
            if not filter_:
                continue
            term = '''{"term" : { "%s" : "%s"}}''' % (filter_['name'], filter_['value'])
            terms.append(term)

        data_query = '''"query": {"bool": {"filter": [%s]}},''' % (','.join(terms))

        data_agg = '''
            "aggs": {
                "1": {
                  "max": {
                    "field": "%s"
                  }
                }
            }
        ''' % field

        data_json = '''
        { "size": 0, %s  %s
        } ''' % (data_query, data_agg)

        logger.debug("%s %s", self.anonymize_url(url), data_json)

        headers = {"Content-Type": "application/json"}

        res = self.requests.post(url, data=data_json, headers=headers)
        res.raise_for_status()
        res_json = res.json()

        if 'aggregations' in res_json:
            last_value = res_json["aggregations"]["1"]["value"]

            if offset:
                if last_value is not None:
                    last_value = int(last_value)
            else:
                if "value_as_string" in res_json["aggregations"]["1"]:
                    last_value = res_json["aggregations"]["1"]["value_as_string"]
                    last_value = parser.parse(last_value)
                else:
                    last_value = res_json["aggregations"]["1"]["value"]
                    if last_value:
                        try:
                            last_value = unixtime_to_datetime(last_value)
                        except ValueError:
                            # last_value is in microsecs
                            last_value = unixtime_to_datetime(last_value / 1000)
        return last_value
1303475
def _last(self, **spec):
        
        for record in self._entries(spec).order_by(orm.desc(model.Entry.local_date),
                                                   orm.desc(model.Entry.id))[:1]:
            return entry.Entry(record)
        return None
827436
def last(self):
        """"""
        # End of file
        self.__file.seek(0, 2)

        # Get the last struct
        data = self.get(self.length - 1)

        return data
334874
protected String getLastQueryParam() {

        String param = parseOptionalStringValue(m_configObject, JSON_KEY_LAST_QUERYPARAM);
        if (param == null) {
            return null != m_baseConfig
            ? m_baseConfig.getGeneralConfig().getLastQueryParam()
            : DEFAULT_LAST_QUERY_PARAM;
        } else {
            return param;
        }
    }
286127
public File getSolrFile() {

        if (m_solrFile == null) {
            String solrFileName = m_solrFileName != null ? m_solrFileName : SOLR_CONFIG_FILE;
            m_solrFile = new File(getHome() + File.separator + solrFileName);
        }
        return m_solrFile;
    }
752583
def get_last_date(self, field, filters_=[]):
        '''
            
        '''

        last_date = self.get_last_item_field(field, filters_=filters_)

        return last_date
1202050
def document(self):
        
        doc = {'mode': self.__mongos_mode}
        if self.__tag_sets not in (None, [{}]):
            doc['tags'] = self.__tag_sets
        if self.__max_staleness != -1:
            doc['maxStalenessSeconds'] = self.__max_staleness
        return doc
139856
def last_bookmark(bookmarks):
    
    last = None
    for bookmark in bookmarks:
        if last is None:
            last = bookmark
        else:
            last = _last_bookmark(last, bookmark)
    return last
1103989
def last(self):
        
        last_items = []
        for (k, v) in self.items():
            if isinstance(v, NdMapping):
                item = (k, v.clone((v.last_key, v.last)))
            elif isinstance(v, AdjointLayout):
                item = (k, v.last)
            else:
                item = (k, v)
            last_items.append(item)
        return self.clone(last_items)
260061
private static long getOldestIndexDate(CmsObject cms) {

        final File path = new File(getSolrSpellcheckRfsPath());
        final File[] directories = path.listFiles(SPELLCHECKING_DIRECTORY_NAME_FILTER);

        // Initialize with the greatest value a long type can hold
        long oldestIndexDate = Long.MAX_VALUE;

        for (final File dir : directories) {
            long date = dir.lastModified();
            if (date < oldestIndexDate) {
                oldestIndexDate = date;
            }
        }

        // If no file(s) have been found oldestIndexDate is still holding
        // Long.MAX_VALUE. In that case return Long.MIN_VALUE to ensure
        // that no indexing operation takes place.
        if (Long.MAX_VALUE == oldestIndexDate) {
            LOG.warn("It appears that no spellcheck indices have been found in " + getSolrSpellcheckRfsPath() + ". ");
            return Long.MIN_VALUE;
        }

        return oldestIndexDate;
    }
273026
public static function getLastVisitedUrl() {
	    $urls = common_session_SessionManager::getSession()->getUserPropertyValues(TaoOntology::PROPERTY_USER_LAST_EXTENSION);
	    if (!empty($urls)) {
	        $lastUrl = current($urls);
	        return ROOT_URL.$lastUrl;
	    } else {
	        return null;
	    }
	}
620782
public function getLastSearchWasExecutedWithEmptyQueryString()
    {
        $wasEmptyQueryString = false;
        if ($this->lastResultSet != null) {
            $wasEmptyQueryString = $this->lastResultSet->getUsedSearchRequest()->getRawUserQueryIsEmptyString();
        }

        return $wasEmptyQueryString;
    }
108515
public function last()
    {
        $this->generatorToArray();

        $key_last = \array_key_last($this->array);

        if ($key_last === null) {
            return null;
        }

        return $this->get($key_last);
    }
254252
def get_documents(self):
        
        return self.session.query(Document).order_by(Document.name).all()
743731
def lastId(self):
        
        if self._last is False:
            # Request the next urn
            self._last = self.childIds[-1]
        return self._last