Tabnine Logo
OContextualRecordId
Code IndexAdd Tabnine to your IDE (free)

How to use
OContextualRecordId
in
com.orientechnologies.orient.core.id

Best Java code snippets using com.orientechnologies.orient.core.id.OContextualRecordId (Showing top 10 results out of 315)

origin: orientechnologies/orientdb-lucene

@Override
public OIdentifiable next() {
 if (localIndex == array.length) {
  localIndex = 0;
  fetchMoreResult();
 }
 final ScoreDoc score = array[localIndex++];
 Document ret = null;
 OContextualRecordId res = null;
 try {
  ret = queryContext.searcher.doc(score.doc);
  String rId = ret.get(OLuceneIndexManagerAbstract.RID);
  res = new OContextualRecordId(rId);
  manager.onRecordAddedToResultSet(queryContext, res, ret, score);
 } catch (IOException e) {
  e.printStackTrace();
 }
 index++;
 return res;
}
origin: com.orientechnologies/orientdb-core

public void setElement(OIdentifiable element) {
 if (element instanceof OElement) {
  this.element = element;
 } else if (element instanceof OIdentifiable) {
  this.element = element.getRecord();
 } else {
  this.element = element;
 }
 if (element instanceof OContextualRecordId) {
  this.addMetadata(((OContextualRecordId) element).getContext());
 }
}
origin: orientechnologies/orientdb-lucene

@Override
public void onRecordAddedToResultSet(QueryContext queryContext, OContextualRecordId recordId, Document ret, final ScoreDoc score) {
 recordId.setContext(new HashMap<String, Object>() {
  {
   put("score", score.score);
  }
 });
}
origin: com.orientechnologies/orientdb-lucene

@Override
public void onRecordAddedToResultSet(OLuceneQueryContext queryContext, OContextualRecordId recordId, Document ret,
  final ScoreDoc score) {
 recordId.setContext(new HashMap<String, Object>() {{
  HashMap<String, TextFragment[]> frag = queryContext.getFragments();
  frag.entrySet().stream().forEach(f -> {
   TextFragment[] fragments = f.getValue();
   StringBuilder hlField = new StringBuilder();
   for (int j = 0; j < fragments.length; j++) {
    if ((fragments[j] != null) && (fragments[j].getScore() > 0)) {
     hlField.append(fragments[j].toString());
    }
   }
   put("$" + f.getKey() + "_hl", hlField.toString());
  });
  put("$score", score.score);
 }});
}
origin: com.orientechnologies/orientdb-core

Map<String, Object> meta = ((OContextualRecordId) iCurrentRecord).getContext();
if (meta != null && meta.containsKey(varName)) {
 return meta.get(varName);
origin: com.orientechnologies/orientdb-lucene

private OContextualRecordId toRecordId(Document doc, ScoreDoc score) {
 String rId = doc.get(OLuceneIndexEngineAbstract.RID);
 OContextualRecordId res = new OContextualRecordId(rId);
 IndexReader indexReader = queryContext.getSearcher().getIndexReader();
 try {
  for (String field : highlighted) {
   String text = doc.get(field);
   TokenStream tokenStream = TokenSources.getAnyTokenStream(indexReader, score.doc, field, doc, engine.indexAnalyzer());
   TextFragment[] frag = highlighter.getBestTextFragments(tokenStream, text, true, maxNumFragments);
   queryContext.addHighlightFragment(field, frag);
  }
  engine.onRecordAddedToResultSet(queryContext, res, doc, score);
  return res;
 } catch (IOException | InvalidTokenOffsetsException e) {
  throw OException.wrapException(new OLuceneIndexException("error while highlighting"), e);
 }
}
origin: com.orientechnologies/orientdb-lucene

@Override
public void onRecordAddedToResultSet(OLuceneQueryContext queryContext, OContextualRecordId recordId, Document doc,
  ScoreDoc score) {
 OSpatialQueryContext spatialContext = (OSpatialQueryContext) queryContext;
 if (spatialContext.spatialArgs != null) {
  Point docPoint = (Point) ctx.readShape(doc.get(strategy.getFieldName()));
  double docDistDEG = ctx.getDistCalc().distance(spatialContext.spatialArgs.getShape().getCenter(), docPoint);
  final double docDistInKM = DistanceUtils.degrees2Dist(docDistDEG, DistanceUtils.EARTH_EQUATORIAL_RADIUS_KM);
  recordId.setContext(new HashMap<String, Object>() {
   {
    put("distance", docDistInKM);
   }
  });
 }
}
origin: com.orientechnologies/orientdb-core

if (!(id instanceof ORecord)) {
 record = getDatabase().load(id.getIdentity(), null, !isUseCache());
 if (id instanceof OContextualRecordId && ((OContextualRecordId) id).getContext() != null) {
  Map<String, Object> ridContext = ((OContextualRecordId) id).getContext();
  for (String key : ridContext.keySet()) {
   context.setVariable(key, ridContext.get(key));
origin: orientechnologies/orientdb-lucene

@Override
public void onRecordAddedToResultSet(QueryContext queryContext, OContextualRecordId recordId, Document doc, ScoreDoc score) {
 SpatialQueryContext spatialContext = (SpatialQueryContext) queryContext;
 if (spatialContext.spatialArgs != null) {
  Point docPoint = (Point) ctx.readShape(doc.get(strategy.getFieldName()));
  double docDistDEG = ctx.getDistCalc().distance(spatialContext.spatialArgs.getShape().getCenter(), docPoint);
  final double docDistInKM = DistanceUtils.degrees2Dist(docDistDEG, DistanceUtils.EARTH_EQUATORIAL_RADIUS_KM);
  recordId.setContext(new HashMap<String, Object>() {
   {
    put("distance", docDistInKM);
   }
  });
 }
}
origin: com.orientechnologies/orientdb-lucene

@Override
public void onRecordAddedToResultSet(OLuceneQueryContext queryContext, OContextualRecordId recordId, Document doc,
  ScoreDoc score) {
 OSpatialQueryContext spatialContext = (OSpatialQueryContext) queryContext;
 if (spatialContext.spatialArgs != null) {
  updateLastAccess();
  openIfClosed();
  Point docPoint = (Point) ctx.readShape(doc.get(strategy.getFieldName()));
  double docDistDEG = ctx.getDistCalc().distance(spatialContext.spatialArgs.getShape().getCenter(), docPoint);
  final double docDistInKM = DistanceUtils.degrees2Dist(docDistDEG, DistanceUtils.EARTH_EQUATORIAL_RADIUS_KM);
  recordId.setContext(new HashMap<String, Object>() {
   {
    put("distance", docDistInKM);
   }
  });
 }
}
com.orientechnologies.orient.core.idOContextualRecordId

Most used methods

  • <init>
  • getContext
  • setContext

Popular in Java

  • Updating database using SQL prepared statement
  • getResourceAsStream (ClassLoader)
  • findViewById (Activity)
  • scheduleAtFixedRate (Timer)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Path (java.nio.file)
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now