Github user dsmiley commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/416#discussion_r205465998
--- Diff:
solr/core/src/java/org/apache/solr/response/transform/ChildDocTransformerFactory.java
---
@@ -91,15 +100,37 @@ public DocTransformer create(String field, SolrParams
params, SolrQueryRequest r
Query childFilterQuery = null;
if(childFilter != null) {
- try {
- childFilterQuery = QParser.getParser( childFilter, req).getQuery();
- } catch (SyntaxError syntaxError) {
- throw new SolrException( ErrorCode.BAD_REQUEST, "Failed to create
correct child filter query" );
+ if(buildHierarchy) {
+ childFilter = buildHierarchyChildFilterString(childFilter);
+ return new DeeplyNestedChildDocTransformer(field, parentsFilter,
req,
+ getChildQuery(childFilter, req), limit);
}
+ childFilterQuery = getChildQuery(childFilter, req);
+ } else if(buildHierarchy) {
+ return new DeeplyNestedChildDocTransformer(field, parentsFilter,
req, null, limit);
}
return new ChildDocTransformer( field, parentsFilter, uniqueKeyField,
req.getSchema(), childFilterQuery, limit);
}
+
+ private static Query getChildQuery(String childFilter, SolrQueryRequest
req) {
+ try {
+ return QParser.getParser( childFilter, req).getQuery();
+ } catch (SyntaxError syntaxError) {
+ throw new SolrException( ErrorCode.BAD_REQUEST, "Failed to create
correct child filter query" );
+ }
+ }
+
+ protected static String buildHierarchyChildFilterString(String
queryString) {
--- End diff --
Remember to provide input/output example. I think this is where the
PathHierarchyTokenizer might come into play... and our discussions on the JIRA
issue about that hierarchy. Can we table this for now and do in a follow-up
issue? (i.e. have no special syntax right now). I'm just concerned the scope
of this may be bigger than limited to this doc transformer since presumably
users will want to do join queries using this syntax as well. And this touches
on how we index this; which is kinda a bigger discussion than all the stuff
going on already in this issue. And this'll need to be documented in the Solr
Ref Guide well.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]