Browse files

Documentation graphs now user autoindexing

  • Loading branch information...
1 parent da1293f commit 7d9b8d9d33bacaa03945b7518ba15052f8705649 @systay committed Jun 27, 2012
View
6 cypher/src/test/scala/org/neo4j/cypher/docgen/DocumentingTestBase.scala
@@ -24,6 +24,7 @@ import org.junit.{Before, After}
import scala.collection.JavaConverters._
import java.io.{PrintWriter, File}
import org.neo4j.graphdb._
+import factory.{GraphDatabaseSetting, GraphDatabaseSettings}
import java.io.ByteArrayOutputStream
import org.neo4j.visualization.graphviz.{AsciiDocStyle, GraphvizWriter, GraphStyle}
import org.neo4j.walk.Walker
@@ -158,7 +159,10 @@ abstract class DocumentingTestBase extends Assertions with DocumentationHelper {
@Before
def init() {
- db = new TestGraphDatabaseFactory().newImpermanentDatabaseBuilder().newGraphDatabase()
+ db = new TestGraphDatabaseFactory().newImpermanentDatabaseBuilder().
+ setConfig( GraphDatabaseSettings.node_keys_indexable, "name" ).
+ setConfig( GraphDatabaseSettings.node_auto_indexing, GraphDatabaseSetting.TRUE ).
+ newGraphDatabase()
engine = new ExecutionEngine(db)
db.asInstanceOf[ImpermanentGraphDatabase].cleanContent(false)
View
4 ...r/src/test/scala/org/neo4j/cypher/docgen/cookbook/BoostingRecommendationResultsTest.scala
@@ -29,7 +29,7 @@ class BoostingRecommendationResultsTest extends DocumentingTestBase {
generateInitialGraphForConsole = false
@Test def boostingRecommendations() {
- executeQuery("""create
+ executeQuery("""create
clark={name: "Clark Kent"},
lois={name:"Lois Lane"},
jimmy={name:"Jimmy Olsen"},
@@ -54,7 +54,7 @@ perry-[:WORKSAT {weight: 2, activity: 3}]->cnn""")
"""This query finds the recommended friends for the origin that are working at the same place as the origin,
or know a person that the origin knows, also, the origin should not already know the target. This recommendation is
weighted for the weight of the relationship `r2`, and boosted with a factor of 2, if there is an `activity`-property on that relationship""",
- queryText = """START origin=node(1)
+ queryText = """START origin=node:node_auto_index(name = "Clark Kent")
MATCH origin-[r1:KNOWS|WORKSAT]-(c)-[r2:KNOWS|WORKSAT]-candidate
WHERE type(r1)=type(r2) AND (NOT (origin-[:KNOWS]-candidate))
RETURN origin.name as origin, candidate.name as candidate, SUM(ROUND(r2.weight +

0 comments on commit 7d9b8d9

Please sign in to comment.