예제 #1
0
 @Override
 protected Field parseCreateField(ParseContext context) throws IOException {
   // so, caching uid stream and field is fine
   // since we don't do any mapping parsing without immediate indexing
   // and, when percolating, we don't index the uid
   UidField field = fieldCache.get();
   field.setUid(Uid.createUid(context.stringBuilder(), context.type(), context.id()));
   context.uid(field);
   return field; // version get updated by the engine
 }
예제 #2
0
 @Override
 protected Fieldable parseCreateField(ParseContext context) throws IOException {
   if (context.id() == null) {
     throw new MapperParsingException("No id found while parsing the content source");
   }
   context.uid(Uid.createUid(context.stringBuilder(), context.type(), context.id()));
   // so, caching uid stream and field is fine
   // since we don't do any mapping parsing without immediate indexing
   // and, when percolating, we don't index the uid
   UidField field = fieldCache.get();
   field.setUid(context.uid());
   return field; // version get updated by the engine
 }