You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by GitBox <gi...@apache.org> on 2019/04/08 05:15:42 UTC

[GitHub] [lucene-solr] dsmiley commented on a change in pull request #455: SOLR-12638

dsmiley commented on a change in pull request #455: SOLR-12638
URL: https://github.com/apache/lucene-solr/pull/455#discussion_r272887687
 
 

 ##########
 File path: solr/core/src/java/org/apache/solr/schema/IndexSchema.java
 ##########
 @@ -1959,6 +1959,21 @@ public boolean isUsableForChildDocs() {
             rootType.getTypeName().equals(uniqueKeyFieldType.getTypeName()));
   }
 
+  /**
+   * Helper method that returns <code>true</code> if the {@link #ROOT_FIELD_NAME} uses the exact
+   * same 'type' as the {@link #getUniqueKeyField()} and has {@link #NEST_PATH_FIELD_NAME}
+   * defined as a {@link NestPathField}
+   * @lucene.internal
+   */
+  public boolean savesChildDocRelations() {
+    //TODO make this boolean a field so it needn't be looked up each time?
+    if (!isUsableForChildDocs()) {
+      return false;
+    }
+    FieldType nestPathType = getFieldTypeNoEx(NEST_PATH_FIELD_NAME);
+    return null != nestPathType && nestPathType.getClass().equals(NestPathField.class);
 
 Review comment:
   if you do "instanceof NestPathField" it allows advanced users to subclass which is nicer.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org