public Document newBuild(OIndexDefinition indexDefinition, Object key, OIdentifiable oid) { if (oid != null) { ORecord record = oid.getRecord(); OElement element = record.load(); } return null; }
private void addLikeQueries(List<ORecord> others, MoreLikeThis mlt, Builder queryBuilder) { others.stream().map(or -> or.<OElement>load()).forEach(element -> Arrays.stream(mlt.getFieldNames()).forEach(fieldName -> { String property = element.getProperty(fieldName); try { Query fieldQuery = mlt.like(fieldName, new StringReader(property)); if (!fieldQuery.toString().isEmpty()) queryBuilder.add(fieldQuery, Occur.SHOULD); } catch (IOException e) { //FIXME handle me! OLogManager.instance().error(this, "Error during Lucene query generation", e); } }) ); }
@SuppressWarnings({ "unchecked", "rawtypes" }) private Object loadIfNeed(Object o) { final ORecord record = (ORecord) o; if (record.getRecord().getInternalStatus() == ORecordElement.STATUS.NOT_LOADED) { try { o = record.<ORecord>load(); } catch (ORecordNotFoundException e) { throw OException.wrapException(new ODatabaseException("Error during loading record with id : " + record.getIdentity()), e); } } return o; } }
@ConsoleCommand(description = "Loook up a record using the dictionary. If found, set it as the current record", onlineHelp = "Console-Command-Dictionary-Get") public void dictionaryGet(@ConsoleParameter(name = "key", description = "The key to search") final String iKey) { checkForDatabase(); currentRecord = currentDatabase.getDictionary().get(iKey); if (currentRecord == null) message("\nEntry not found in dictionary."); else { currentRecord = (ORecord) currentRecord.load(); displayRecord(null); } }
if (iCurrentRecord != null && ((ORecord) iCurrentRecord).getInternalStatus() == ORecordElement.STATUS.NOT_LOADED) { try { iCurrentRecord = iCurrentRecord.getRecord().load(); } catch (ORecordNotFoundException ignore) { return null;