Skip to content

Commit

Permalink
Documentation graphs now user autoindexing
Browse files Browse the repository at this point in the history
  • Loading branch information
systay committed Jun 27, 2012
1 parent da1293f commit 7d9b8d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
Expand Up @@ -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"},
Expand All @@ -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 +
Expand Down

0 comments on commit 7d9b8d9

Please sign in to comment.