You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by al...@apache.org on 2012/10/19 16:06:57 UTC

svn commit: r1400103 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexLookup.java

Author: alexparvulescu
Date: Fri Oct 19 14:06:56 2012
New Revision: 1400103

URL: http://svn.apache.org/viewvc?rev=1400103&view=rev
Log:
OAK-388 Add NodeType Index

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexLookup.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexLookup.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexLookup.java?rev=1400103&r1=1400102&r2=1400103&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexLookup.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexLookup.java Fri Oct 19 14:06:56 2012
@@ -42,7 +42,7 @@ import com.google.common.collect.Sets;
  * {
  *     NodeState state = ... // get a node state
  *     PropertyIndexLookup lookup = new PropertyIndexLookup(state);
- *     Set<String> hits = lookup.find("foo", "xyz");
+ *     Set<String> hits = lookup.find("foo", PropertyValues.newString("xyz"));
  * }
  * </code>
  * </pre>
@@ -84,10 +84,28 @@ public class PropertyIndexLookup {
                 name, path.substring(slash));
     }
 
+    /**
+     * Searches for a given <code>String<code> value within this index.
+     * 
+     * <p><b>Note</b> if the property you are looking for is not of type <code>String<code>, the converted key value might not match the index key, and there will be no hits on the index.</p>
+     * 
+     * @param name
+     *            the property name
+     * @param value
+     *            the property value
+     * @return the set of matched paths
+     */
     public Set<String> find(String name, String value) {
         return find(name, PropertyValues.newString(value));
     }
 
+    /**
+     * Searches for a given value within this index.
+     * 
+     * @param name the property name
+     * @param value the property value
+     * @return the set of matched paths
+     */
     public Set<String> find(String name, PropertyValue value) {
         Set<String> paths = Sets.newHashSet();