code: public void index(Record record) {
      if (directory == null)
        init();
  
      if (!overwrite && path != null)
        delete(record);
  
      Document doc = new Document();
      for (String propname : record.getProperties()) {
        Property prop = config.getPropertyByName(propname);
        if (prop == null)
          throw new DukeConfigException("Record has property " + propname +
                                        " for which there is no configuration");
  
        if (prop.getComparator() instanceof GeopositionComparator &&
            geoprop != null) {
          // index specially as geocoordinates
  
          String v = record.getValue(propname);
          if (v == null || v.equals(""))
            continue;
  
          // this gives us a searchable geoindexed value
          for (IndexableField f : geoprop.createIndexableFields(v))
            doc.add(f);
  
          // this preserves the coordinates in readable form for display purposes
          doc.add(new Field(propname, v, Field.Store.YES,
                            Field.Index.NOT_ANALYZED));
        } else {
          Field.Index ix;
          if (prop.isIdProperty())
            ix = Field.Index.NOT_ANALYZED; // so findRecordById will work
          else // if (prop.isAnalyzedProperty())
            ix = Field.Index.ANALYZED;
          // FIXME: it turns out that with the StandardAnalyzer you can't have a
          // multi-token value that's not analyzed if you want to find it again...
          // else
          //   ix = Field.Index.NOT_ANALYZED;
  
          Float boost = getBoostFactor(prop.getHighProbability(), BoostMode.INDEX);
          for (String v : record.getValues(propname)) {
            if (v.equals(""))
              continue; // FIXME: not sure if this is necessary
  
            Field field = new Field(propname, v, Field.Store.YES, ix);
            if (boost != null)
              field.setBoost(boost);
            doc.add(field);
          }
        }
      }
  
      try {
        iwriter.addDocument(doc);
      } catch (IOException e) {
        throw new DukeException(e);
      }
    }
docs: Add the record to the index.