junisphere_unleash_IndexProvider #20

Merged
merged 1 commit into from Dec 14, 2011

Projects

None yet

3 participants

@wwn

added
public string IndexProvider.createIndexValueForType(Class<?> type)
for a possibility to manipulate the indexName for the lowLevel types
indices

@junisphere junisphere junisphere_unleash_IndexProvider part2
added
public string IndexProvider.createIndexValueForType(Class<?> type)
for a possibility to manipulate the indexName for the lowLevel __types__
indices
8813ac2
@jexp jexp commented on the diff Dec 13, 2011
...representation/TypeRepresentationStrategyFactory.java
public TypeRepresentationStrategyFactory(GraphDatabase graphDatabaseService) {
- this(graphDatabaseService,chooseStrategy(graphDatabaseService));
+ this(graphDatabaseService,chooseStrategy(graphDatabaseService), null);
@jexp
jexp Dec 13, 2011

why is the index-provider optional for the Indexing TRS ? shouldn't it be always provided ?

@wwn
wwn Dec 13, 2011
@jexp jexp commented on the diff Dec 13, 2011
...sentation/IndexingNodeTypeRepresentationStrategy.java
typeCache = new EntityTypeCache();
}
- private Index<Node> getNodeTypesIndex() {
- return graphDb.createIndex(Node.class,INDEX_NAME, IndexType.SIMPLE);
- }
-
+ private Index<Node> getNodeTypesIndex() {
+ return graphDb.createIndex(Node.class, INDEX_NAME, IndexType.SIMPLE);
@jexp
jexp Dec 13, 2011

shouldn't the index-provider create this index?

@wwn
wwn Dec 13, 2011
@jexp jexp commented on the diff Dec 13, 2011
...springframework/data/neo4j/support/Neo4jTemplate.java
@@ -424,7 +431,7 @@ public void doWithGraphWithoutResult(GraphDatabase graph) throws Exception {
Index<Relationship> relationshipIndex = infrastructure.getGraphDatabase().createIndex(Relationship.class, indexName, IndexType.SIMPLE);
relationshipIndex.add((Relationship) element, field, value);
} else if (element instanceof Node) {
- infrastructure.getGraphDatabase().createIndex(Node.class, indexName, IndexType.SIMPLE).add((Node) element, field, value);
+ infrastructure.getIndexProvider().createIndex(Node.class, indexName, IndexType.SIMPLE).add((Node) element, field, value);
@jexp
jexp Dec 13, 2011

why only for nodes and not relationships ? Wouldn't it be sensible then to delegate all index creation in SDN the index-provider?

@wwn
wwn Dec 13, 2011
@jexp jexp merged commit 0266f12 into spring-projects:master Dec 14, 2011
@wwn wwn pushed a commit that referenced this pull request Dec 15, 2011
@junisphere junisphere - Made a IndexProvider.customizeIndexName(String indexName, Class<?>
  type). If you override the default implementation you can do something
  with the name for the hi level indices. With this change you are
  independent for the most part from upcoming changes.
- Added indexProvider related naming logic for relationships (compare
  with pull request #20 branch junisphere_unleash_IndexProvider features
  for node types)
99c12a7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment