if (nodeType == Node.ELEMENT_NODE && level <= depth) { new DOMTransaction(this, domDb, Lock.WRITE_LOCK) { public Object start() throws ReadOnlyException { try { domDb.addValue(new NodeRef(doc.getDocId(), gid), node.getInternalAddress()); } catch (BTreeException e) { LOG.warn("exception during reindex", e); } catch (IOException e) { LOG.warn("exception during reindex", e); } return null; } } .run(); }
	public void index(NodeImpl node) {		final DocumentImpl doc = (DocumentImpl) node.getOwnerDocument();		final long gid = node.getGID();		final short nodeType = node.getNodeType();		final String nodeName = node.getNodeName();		final long address = node.getInternalAddress();		IndexPaths idx =			(IndexPaths) config.getProperty(				"indexScheme." + node.getOwnerDocument().getDoctype().getName());		if (address < 0)			LOG.debug("node " + gid + ": internal address missing");		NodeProxy tempProxy = new NodeProxy(doc, gid, address);		switch (nodeType) {			case Node.ELEMENT_NODE :				// save element by calling ElementIndex				elementIndex.setDocument(doc);				elementIndex.addRow(nodeName, tempProxy);				break;			case Node.ATTRIBUTE_NODE :				elementIndex.setDocument(doc);				elementIndex.addRow("@" + nodeName, tempProxy);				// check if attribute value should be fulltext-indexed				// by calling IndexPaths.match(path) 				if (idx == null || idx.getIncludeAttributes())					textEngine.storeAttribute(idx, (AttrImpl) node);				// if the attribute has type ID, store the ID-value				// to the element index as well				if (((AttrImpl) node).getType() == AttrImpl.ID) {					elementIndex.addRow("&" + ((AttrImpl) node).getValue(), tempProxy);				}				break;			case Node.TEXT_NODE :				// check if this textual content should be fulltext-indexed				// by calling IndexPaths.match(path)				// if (idx == null || idx.match(currentPath))				textEngine.storeText(idx, (TextImpl) node);				break;		}	}