From: <br...@us...> - 2007-01-12 12:43:07
|
Revision: 5184 http://svn.sourceforge.net/exist/?rev=5184&view=rev Author: brihaye Date: 2007-01-12 04:43:00 -0800 (Fri, 12 Jan 2007) Log Message: ----------- Unified storeAttribute() in NativeValueIndex. Currently looks strange, I reckognize Modified Paths: -------------- trunk/eXist/src/org/exist/storage/NativeBroker.java trunk/eXist/src/org/exist/storage/NativeTextEngine.java trunk/eXist/src/org/exist/storage/NativeValueIndex.java Modified: trunk/eXist/src/org/exist/storage/NativeBroker.java =================================================================== --- trunk/eXist/src/org/exist/storage/NativeBroker.java 2007-01-12 09:55:37 UTC (rev 5183) +++ trunk/eXist/src/org/exist/storage/NativeBroker.java 2007-01-12 12:43:00 UTC (rev 5184) @@ -2408,7 +2408,7 @@ GeneralRangeIndexSpec spec2 = doc.getCollection().getIndexByPathConfiguration(this, currentPath); if(spec2 != null) { valueIndex.setDocument(doc); - valueIndex.storeAttribute(spec2, (AttrImpl) node); + valueIndex.storeAttribute(spec2, (AttrImpl) node, null, NativeValueIndex.WITHOUT_PATH); } // RangeIndexSpec qnIdx = idxSpec.getIndexByQName(idxQName); // if (qnIdx != null && qnameValueIndexation) { @@ -2953,12 +2953,12 @@ } if (idxSpec != null && idxSpec.getIndexByPath(currentPath) != null) { valueIndex.setDocument((DocumentImpl)node.getOwnerDocument()); - valueIndex.storeAttribute(idxSpec.getIndexByPath(currentPath), (AttrImpl) node); + valueIndex.storeAttribute(idxSpec.getIndexByPath(currentPath), (AttrImpl) node, null, NativeValueIndex.WITHOUT_PATH); } //TODO : investigate. 0/1 seem tobe totally unused ! //And so is null ;-) - notifyStoreAttribute(null, (AttrImpl)node, currentPath, fullTextIndex ? 1 : 0); + notifyStoreAttribute(null, (AttrImpl)node, currentPath, fullTextIndex ? -1 : -2); //Special handling for fulltext index //TODO : harmonize Modified: trunk/eXist/src/org/exist/storage/NativeTextEngine.java =================================================================== --- trunk/eXist/src/org/exist/storage/NativeTextEngine.java 2007-01-12 09:55:37 UTC (rev 5183) +++ trunk/eXist/src/org/exist/storage/NativeTextEngine.java 2007-01-12 12:43:00 UTC (rev 5184) @@ -248,8 +248,8 @@ * Indexes the tokens contained in a text node. * * @param indexSpec The index configuration - * @param text The text node to be indexed - * @param noTokenizing + * @param node The text node to be indexed + * @param indexingHint * if <code>true</code>, given text is indexed as a single token * if <code>false</code>, it is tokenized before being indexed */ Modified: trunk/eXist/src/org/exist/storage/NativeValueIndex.java =================================================================== --- trunk/eXist/src/org/exist/storage/NativeValueIndex.java 2007-01-12 09:55:37 UTC (rev 5183) +++ trunk/eXist/src/org/exist/storage/NativeValueIndex.java 2007-01-12 12:43:00 UTC (rev 5184) @@ -92,6 +92,10 @@ public static final String FILE_NAME = "values.dbx"; public static final String FILE_KEY_IN_CONFIG = "db-connection.values"; + //TODO : find the real semantics + public static final int WITH_PATH = 1; + public static final int WITHOUT_PATH = 2; + public static final double DEFAULT_VALUE_CACHE_GROWTH = 1.25; public static final double DEFAULT_VALUE_KEY_THRESHOLD = 0.01; public static final double DEFAULT_VALUE_VALUE_THRESHOLD = 0.04; @@ -205,7 +209,11 @@ * @param spec The index specification * @param node The attribute */ - public void storeAttribute(RangeIndexSpec spec, AttrImpl node) { + public void storeAttribute(RangeIndexSpec spec, AttrImpl node, NodePath currentPath, int indexingHint) { + //Return early + if (indexingHint != WITHOUT_PATH) + return; + if (doc.getDocId() != node.getDocId()) { throw new IllegalArgumentException("Document id ('" + doc.getDocId() + "') and proxy id ('" + node.getDocId() + "') differ !"); @@ -229,10 +237,6 @@ buf.add(node.getNodeId()); } - public void storeAttribute(RangeIndexSpec spec, AttrImpl node, NodePath currentPath, int indexingHint) { - // TODO Auto-generated method stub - } - public void storeText(TextImpl node, NodePath currentPath, int indexingHint) { // TODO Auto-generated method stub } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |