Speed up 'see also' search using an Oak index
diff --git a/org.apache.sling.graphql.samples.website/src/main/java/org/apache/sling/graphql/samples/website/datafetchers/SeeAlsoDataFetcher.java b/org.apache.sling.graphql.samples.website/src/main/java/org/apache/sling/graphql/samples/website/datafetchers/SeeAlsoDataFetcher.java
index 3ee358e..d9ea5c7 100644
--- a/org.apache.sling.graphql.samples.website/src/main/java/org/apache/sling/graphql/samples/website/datafetchers/SeeAlsoDataFetcher.java
+++ b/org.apache.sling.graphql.samples.website/src/main/java/org/apache/sling/graphql/samples/website/datafetchers/SeeAlsoDataFetcher.java
@@ -47,7 +47,7 @@
      *  we can use the full path + title to render links.
      */
     private static Map<String, Object> toArticleRef(ResourceResolver resolver, String nodeName) {
-        final String jcrQuery = "/jcr:root/content/articles//" + nodeName;
+        final String jcrQuery = String.format("/jcr:root/content/articles//*[@filename='%s']", nodeName);
         final Iterator<Resource> it = resolver.findResources(jcrQuery, "xpath");
 
         // We want exactly one result
diff --git a/org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/oak%3Aindex/articleFilename.json b/org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/oak%3Aindex/articleFilename.json
new file mode 100644
index 0000000..e1248f6
--- /dev/null
+++ b/org.apache.sling.graphql.samples.website/src/main/resources/SLING-INF/initial-content/oak%3Aindex/articleFilename.json
@@ -0,0 +1,9 @@
+{
+	"jcr:primaryType": "oak:QueryIndexDefinition",
+	"jcr:name:propertyNames": [
+		"filename"
+	],
+	"type": "property",
+	"reindex": false,
+	"reindexCount": 1
+}