public void index(Record record) {
    // FIXME: check if record is already indexed

    // allocate an ID for this record
    long id = store.makeNewRecordId();
    store.registerRecord(id, record);
    
    // go through ID properties and register them
    for (Property p : config.getIdentityProperties())
      for (String extid : record.getValues(p.getName()))
        store.registerId(id, extid);

    // go through lookup properties and register those
    for (Property p : config.getLookupProperties()) {
      String propname = p.getName();
      for (String value : record.getValues(propname)) {
        String[] tokens = StringUtils.split(value);
        for (int ix = 0; ix < tokens.length; ix++)
          store.registerToken(id, propname, tokens[ix]);
      }
    }
  }
public void index ( Record record ) { long id = store . makeNewRecordId ( ) ; store . registerRecord ( id , record ) ; for ( Property p : config . getIdentityProperties ( ) ) for ( String extid : record . getValues ( p . getName ( ) ) ) store . registerId ( id , extid ) ; for ( Property p : config . getLookupProperties ( ) ) { String propname = p . getName ( ) ; for ( String value : record . getValues ( propname ) ) { String [ ] tokens = StringUtils . split ( value ) ; for ( int ix = 0 ; ix < tokens . length ; ix ++ ) store . registerToken ( id , propname , tokens [ ix ] ) ; } } }
Add the record to the index.