[GitHub] lucene-solr pull request #416: WIP: SOLR-12519

classic Classic list List threaded Threaded
167 messages Options
1234 ... 9
Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr pull request #416: WIP: SOLR-12519

cbismuth
GitHub user moshebla opened a pull request:

    https://github.com/apache/lucene-solr/pull/416

    WIP: SOLR-12519

   

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/moshebla/lucene-solr SOLR-12519-3

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/lucene-solr/pull/416.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #416
   
----
commit 2412a96fdb2c856adcfcb0bbccdaa336ef0b224c
Author: user <user@...>
Date:   2018-06-05T08:58:10Z

    first tests

commit e8f41e33ec99c2b7c6c565f5ea30c80d4739e84f
Author: user <user@...>
Date:   2018-06-06T00:31:47Z

    only index fields from conf

commit 446f05a711add0632484449c96532e56b53793fc
Author: Moshe <moshebla@...>
Date:   2018-06-06T13:36:31Z

    SOLR-12441: tests with query

commit 9128f5955c9034ceec7d8fb8614287b10adc1172
Author: Moshe <moshebla@...>
Date:   2018-06-11T07:54:56Z

    SOLR-12441: use EnumSet for conf

commit 5ecd071c5c97b9120f3a9a633dc5542919575d6b
Author: Moshe <moshebla@...>
Date:   2018-06-25T09:03:17Z

    SOLR-12441: add tests for children too

commit d0dc305a5a918bf02a88dd5887e91d13b10fe92f
Author: Moshe <moshebla@...>
Date:   2018-06-26T06:29:45Z

    SOLR-12441: use iterator for field values

commit 1b115cdc7846647859ce2dbaf46ef316422e8bd8
Author: Moshe <moshebla@...>
Date:   2018-06-26T07:02:58Z

    SOLR-12441: remove NestedFlags.ALL and LEVEL_FIELD_NAME

commit 4942520dee2312c4428d3e1aacdaa561049525b7
Author: Moshe <moshebla@...>
Date:   2018-06-26T08:06:05Z

    SOLR-12441: raise exception if fieldName contains splitChar

commit 2cad6c95fac369ce99b3a4a113162ad1cd2e6e8e
Author: Moshe <moshebla@...>
Date:   2018-06-26T08:25:56Z

    SOLR-12441: change addField to setField

commit 8f57c21070678804cf2aa487e79faf6bb1d3fbc4
Author: Moshe <moshebla@...>
Date:   2018-06-26T08:37:58Z

    SOLR-12441: make nestedurp test exception less doc specific

commit 9e3cd08149c47f86c24caba0946033a98091be95
Author: Moshe <moshebla@...>
Date:   2018-06-26T09:39:44Z

    SOLR-12441: rename to nestedUpdateProcessor

commit 14b676f0124c6be92fbb7d900c97b3616e045e88
Author: Moshe <moshebla@...>
Date:   2018-06-26T10:11:20Z

    SOLR-12441: config param fix error message

commit 421fbccd5586b19a0d523e2d9f97bc67b4f1d756
Author: user <user@...>
Date:   2018-06-04T05:22:29Z

    add skip and limit stream

commit 6c4c767d8999a0ed076674de99df84133a5e53c8
Author: Moshe <moshebla@...>
Date:   2018-06-26T13:49:12Z

    SOLR-12441: remove "Deeply" from urp

commit b0119523a3cc4d31224152dd76c0d0065d0b49fc
Author: Moshe <moshebla@...>
Date:   2018-06-26T14:42:32Z

    SOLR-12441: replace EnumSet config with two booleans

commit d7448f293573d9a2a45a958fb45236539915b5e6
Author: Moshe <moshebla@...>
Date:   2018-06-26T14:46:29Z

    SOLR-12441: all test use PATH_SEP_CHAR constant

commit 8c2b1589a61efcc6902aa634316dacfddde122ef
Author: Moshe <moshebla@...>
Date:   2018-06-28T05:36:37Z

    SOLR-12441: failing test for idless child docs

commit 1600fa14034cacc5814e1b3ba8c61868e02ddf01
Author: Moshe <moshebla@...>
Date:   2018-07-02T06:26:26Z

    SOLR-12441: req.getSchema().getUniqueKeyField().getName() as field

commit f773bffa9d0b0e65c07351643ff6c8e630e7e61a
Author: Moshe <moshebla@...>
Date:   2018-07-02T06:49:03Z

    SOLR-12441: combined moved NestedUpdateProcessor into NestedUpdateProcessorFactory

commit 9f46adee1962b491c61507e07222b5b183da1b6c
Author: Moshe <moshebla@...>
Date:   2018-07-02T07:10:36Z

    SOLR-12441: use updateJ for NestedUpdateProcessor tests

commit ed4b0f264d6e88eef301f6c6c28eb47e4ddeb712
Author: Moshe <moshebla@...>
Date:   2018-07-03T11:29:50Z

    SOLR-12441: use string concatenation

commit b77645abd628babb8ea26a29b96c117ddcc02a95
Author: Moshe <moshebla@...>
Date:   2018-07-04T13:03:52Z

    SOLR-12519: add transformer and initial tests

commit 5388c8fa195705faf93fae9a76fea1e442601a68
Author: Moshe <moshebla@...>
Date:   2018-07-04T13:04:35Z

    SOLR-12519: add deeply nested transformer to transformer factory

commit c2061d66776b54847af58a0cbffe22c264bc703e
Author: Moshe <moshebla@...>
Date:   2018-07-04T13:05:05Z

    SOLR-12519: do not iterate over SolrDocument when adding a child doc

commit 7cb6730eec69ebffb7f5bf6cae04aae237828ba7
Author: Moshe <moshebla@...>
Date:   2018-07-04T13:56:28Z

    SOLR-12441: fix nestedupdateprocessor id generator algorithm

commit 9823c92d9ce4a9e5aac296256f0dce5bacfa34c0
Author: Moshe <moshebla@...>
Date:   2018-07-04T13:58:29Z

    SOLR-12441: fix id less child docs test for nestedUpdateProcessor

commit 1dc731d4c2360450eaece5948984d45e3b040b27
Author: Moshe <moshebla@...>
Date:   2018-07-05T05:02:33Z

    SOLR-12441: use string concat for NestedUpdateProcessor.generateChildUniqueId

commit 98408761ebb593401f58d5c03be5fcfd543329e8
Author: Moshe <moshebla@...>
Date:   2018-07-05T05:02:56Z

    SOLR-12441: improve id less child doc test

commit 1fed36e0e67a8ed548ad1dc897e116500087124d
Author: Moshe <moshebla@...>
Date:   2018-07-05T05:05:21Z

    SOLR-12441: add "NEST" prefix to nested internal fields var name

commit 4276cf917e5b29a12c1ca93b314deda827ba6547
Author: Moshe <moshebla@...>
Date:   2018-07-05T05:47:00Z

    SOLR-12441: add num sep char to nested URP

----


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr pull request #416: WIP: SOLR-12519

cbismuth
Github user dsmiley commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/416#discussion_r203718591
 
    --- Diff: solr/core/src/java/org/apache/solr/response/transform/DeeplyNestedChildDocTransformerFactory.java ---
    @@ -0,0 +1,367 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.solr.response.transform;
    +
    +import java.io.IOException;
    +import java.util.ArrayList;
    +import java.util.List;
    +import java.util.Set;
    +import java.util.regex.Pattern;
    +
    +import org.apache.lucene.document.Document;
    +import org.apache.lucene.index.DocValues;
    +import org.apache.lucene.index.ReaderUtil;
    +import org.apache.lucene.index.SortedDocValues;
    +import org.apache.lucene.search.Query;
    +import org.apache.lucene.search.join.BitSetProducer;
    +import org.apache.lucene.search.join.QueryBitSetProducer;
    +import org.apache.lucene.search.join.ToChildBlockJoinQuery;
    +import org.apache.solr.common.SolrDocument;
    +import org.apache.solr.common.SolrException;
    +import org.apache.solr.common.SolrException.ErrorCode;
    +import org.apache.solr.common.params.SolrParams;
    +import org.apache.solr.common.util.StrUtils;
    +import org.apache.solr.request.SolrQueryRequest;
    +import org.apache.solr.response.DocsStreamer;
    +import org.apache.solr.schema.FieldType;
    +import org.apache.solr.schema.SchemaField;
    +import org.apache.solr.search.DocIterator;
    +import org.apache.solr.search.DocList;
    +import org.apache.solr.search.QParser;
    +import org.apache.solr.search.SolrDocumentFetcher;
    +import org.apache.solr.search.SolrReturnFields;
    +import org.apache.solr.search.SyntaxError;
    +
    +import static org.apache.solr.response.transform.DeeplyNestedChildDocTransformerFactory.PATH_SEP_CHAR;
    +import static org.apache.solr.schema.IndexSchema.NEST_PATH_FIELD_NAME;
    +import static org.apache.solr.schema.IndexSchema.ROOT_FIELD_NAME;
    +
    +/**
    + *
    + * @since solr 4.9
    + *
    + * This transformer returns all descendants of each parent document in a flat list nested inside the parent document.
    + *
    + *
    + * The "parentFilter" parameter is mandatory.
    + * Optionally you can provide a "childFilter" param to filter out which child documents should be returned and a
    + * "limit" param which provides an option to specify the number of child documents
    + * to be returned per parent document. By default it's set to 10.
    + *
    + * Examples -
    + * [child parentFilter="fieldName:fieldValue"]
    + * [child parentFilter="fieldName:fieldValue" childFilter="fieldName:fieldValue"]
    + * [child parentFilter="fieldName:fieldValue" childFilter="fieldName:fieldValue" limit=20]
    + */
    +public class DeeplyNestedChildDocTransformerFactory extends TransformerFactory {
    --- End diff --
   
    FWIW I'm not convinced we need a distinct class from ChildDocTransformer.  I think CDT is fine... the part that changes is what follows obtaining the matching child doc iterator.   That could split out to two different methods -- plain/flat (current) and nested with ancestors (new).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr pull request #416: WIP: SOLR-12519

cbismuth
In reply to this post by cbismuth
Github user dsmiley commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/416#discussion_r203719810
 
    --- Diff: solr/core/src/java/org/apache/solr/response/transform/DeeplyNestedChildTransformerBase.java ---
    @@ -0,0 +1,139 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.solr.response.transform;
    +
    +import java.util.ArrayList;
    +import java.util.Iterator;
    +import java.util.List;
    +import java.util.Objects;
    +import java.util.stream.Stream;
    +
    +import org.apache.lucene.index.IndexableField;
    +import org.apache.lucene.search.Sort;
    +import org.apache.lucene.search.SortField;
    +import org.apache.lucene.search.join.BitSetProducer;
    +import org.apache.lucene.util.BitSet;
    +import org.apache.solr.common.SolrDocument;
    +import org.apache.solr.request.SolrQueryRequest;
    +import org.apache.solr.schema.FieldType;
    +import org.apache.solr.schema.IndexSchema;
    +import org.apache.solr.schema.SchemaField;
    +
    +import static org.apache.solr.response.transform.DeeplyNestedChildDocTransformerFactory.NUM_SEP_CHAR;
    +import static org.apache.solr.schema.IndexSchema.NEST_PATH_FIELD_NAME;
    +
    +/**
    + *
    + * This base class helps create a child doc transformer which caches the parent query using QueryBitProducer
    + *
    + *
    + * "limit" param which provides an option to specify the number of child documents
    + * to be returned per parent document. By default it's set to 10.
    + *
    + * @see org.apache.solr.response.transform.DeeplyNestedChildDocTransformer
    + * @see org.apache.solr.response.transform.DeeplyNestedFilterChildDocTransformer
    + */
    +
    +abstract class DeeplyNestedChildDocTransformerBase extends DocTransformer {
    +  private final String name;
    +  protected final SchemaField idField;
    +  protected final SolrQueryRequest req;
    +  protected final IndexSchema schema;
    +  protected BitSetProducer parentsFilter;
    +  protected BitSet parents;
    +  protected int limit;
    +  protected final Sort pathKeySort;
    +
    +  public DeeplyNestedChildDocTransformerBase( String name, final BitSetProducer parentsFilter,
    +                                          final SolrQueryRequest req, int limit) {
    +    this.name = name;
    +    this.schema = req.getSchema();
    +    this.idField = this.schema.getUniqueKeyField();
    +    this.req = req;
    +    this.parentsFilter = parentsFilter;
    +    this.limit = limit;
    +    this.pathKeySort = new Sort(new SortField(NEST_PATH_FIELD_NAME, SortField.Type.STRING, false),
    +        new SortField(idField.getName(), SortField.Type.STRING, false));
    +  }
    +
    +  @Override
    +  public String getName()  {
    +    return name;
    +  }
    +
    +  @Override
    +  public String[] getExtraRequestFields() {
    +    // we always need the idField (of the parent) in order to fill out it's children
    +    return new String[] { idField.getName() };
    +  }
    +
    +  protected static SolrDocument getChildByPath(String[] pathAndNum, SolrDocument lastDoc) {
    +    List<Object> fieldsValues = (List<Object>) lastDoc.getFieldValues(pathAndNum[0]);
    +    int childIndex = Integer.parseInt(pathAndNum[1]);
    +    return fieldsValues.size() > childIndex ? (SolrDocument) fieldsValues.get(childIndex): null;
    +  }
    +
    +  protected static void addChild(SolrDocument parentDoc, String[] pathAndNum, SolrDocument cDoc) {
    +    if(!pathAndNum[1].equals("") && (parentDoc.get(pathAndNum[0]) == null)) {
    +      parentDoc.setField(pathAndNum[0], new NullFilteringArrayList<SolrDocument>());
    +    }
    +    NullFilteringArrayList fieldValues = (NullFilteringArrayList) parentDoc.getFieldValues(pathAndNum[0]);
    +    int pathNum = Integer.parseInt(pathAndNum[1]);
    +
    +    fieldValues.addWithPlaceHolder(pathNum, cDoc);
    +  }
    +
    +  protected static String[] getPathAndNum(String lastPath) {
    +    return lastPath.split(NUM_SEP_CHAR);
    +  }
    +
    +  protected static String getSolrFieldString(Object fieldVal, FieldType fieldType) {
    +    return fieldVal instanceof IndexableField
    +        ? fieldType.toExternal((IndexableField)fieldVal)
    +        : fieldVal.toString();
    +  }
    +
    +  protected static class NullFilteringArrayList<T> extends ArrayList<T> {
    --- End diff --
   
    Um; this ArrayList subclass seems undesirable to me; I'm not sure yet why it's used (though I'm sure you have your reasons)... but maybe there could be some change to the logic to avoid the need for this thing.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr pull request #416: WIP: SOLR-12519

cbismuth
In reply to this post by cbismuth
Github user dsmiley commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/416#discussion_r203722021
 
    --- Diff: solr/core/src/java/org/apache/solr/response/transform/DeeplyNestedChildDocTransformerFactory.java ---
    @@ -0,0 +1,367 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.solr.response.transform;
    +
    +import java.io.IOException;
    +import java.util.ArrayList;
    +import java.util.List;
    +import java.util.Set;
    +import java.util.regex.Pattern;
    +
    +import org.apache.lucene.document.Document;
    +import org.apache.lucene.index.DocValues;
    +import org.apache.lucene.index.ReaderUtil;
    +import org.apache.lucene.index.SortedDocValues;
    +import org.apache.lucene.search.Query;
    +import org.apache.lucene.search.join.BitSetProducer;
    +import org.apache.lucene.search.join.QueryBitSetProducer;
    +import org.apache.lucene.search.join.ToChildBlockJoinQuery;
    +import org.apache.solr.common.SolrDocument;
    +import org.apache.solr.common.SolrException;
    +import org.apache.solr.common.SolrException.ErrorCode;
    +import org.apache.solr.common.params.SolrParams;
    +import org.apache.solr.common.util.StrUtils;
    +import org.apache.solr.request.SolrQueryRequest;
    +import org.apache.solr.response.DocsStreamer;
    +import org.apache.solr.schema.FieldType;
    +import org.apache.solr.schema.SchemaField;
    +import org.apache.solr.search.DocIterator;
    +import org.apache.solr.search.DocList;
    +import org.apache.solr.search.QParser;
    +import org.apache.solr.search.SolrDocumentFetcher;
    +import org.apache.solr.search.SolrReturnFields;
    +import org.apache.solr.search.SyntaxError;
    +
    +import static org.apache.solr.response.transform.DeeplyNestedChildDocTransformerFactory.PATH_SEP_CHAR;
    +import static org.apache.solr.schema.IndexSchema.NEST_PATH_FIELD_NAME;
    +import static org.apache.solr.schema.IndexSchema.ROOT_FIELD_NAME;
    +
    +/**
    + *
    + * @since solr 4.9
    + *
    + * This transformer returns all descendants of each parent document in a flat list nested inside the parent document.
    + *
    + *
    + * The "parentFilter" parameter is mandatory.
    + * Optionally you can provide a "childFilter" param to filter out which child documents should be returned and a
    + * "limit" param which provides an option to specify the number of child documents
    + * to be returned per parent document. By default it's set to 10.
    + *
    + * Examples -
    + * [child parentFilter="fieldName:fieldValue"]
    + * [child parentFilter="fieldName:fieldValue" childFilter="fieldName:fieldValue"]
    + * [child parentFilter="fieldName:fieldValue" childFilter="fieldName:fieldValue" limit=20]
    + */
    +public class DeeplyNestedChildDocTransformerFactory extends TransformerFactory {
    +
    +  public static final String PATH_SEP_CHAR = "/";
    +  public static final String NUM_SEP_CHAR = "#";
    +
    +  @Override
    +  public DocTransformer create(String field, SolrParams params, SolrQueryRequest req) {
    +    SchemaField uniqueKeyField = req.getSchema().getUniqueKeyField();
    +    if(uniqueKeyField == null) {
    +      throw new SolrException( ErrorCode.BAD_REQUEST,
    +          " ChildDocTransformer requires the schema to have a uniqueKeyField." );
    +    }
    +
    +    String childFilter = params.get( "childFilter" );
    +    String nestPath = null;
    +    int limit = params.getInt( "limit", 10 );
    +
    +    Query childFilterQuery = null;
    +    List<String> split = null;
    +    List<String> splitPath = null;
    +    if(childFilter != null) {
    +      split = StrUtils.splitSmart(childFilter, ':');
    +      splitPath = StrUtils.splitSmart(split.get(0), PATH_SEP_CHAR.charAt(0));
    +      try {
    +        if (childFilter.contains(PATH_SEP_CHAR)) {
    +          nestPath = String.join(PATH_SEP_CHAR, splitPath.subList(0, splitPath.size() - 1));
    +          // TODO: filter out parents who's childDocs don't match the original childFilter
    +          childFilter = "(" + splitPath.get(splitPath.size() - 1) + ":\"" + split.get(split.size() - 1) + "\" AND " + NEST_PATH_FIELD_NAME + ":\"" + nestPath + "/\")";
    +        }
    +        childFilterQuery = QParser.getParser(childFilter, req).getQuery();
    +      } catch (SyntaxError syntaxError) {
    +        throw new SolrException( ErrorCode.BAD_REQUEST, "Failed to create correct child filter query" );
    +      }
    +    }
    +
    +    String parentFilter = params.get( "parentFilter" );
    +
    +    BitSetProducer parentsFilter = null;
    +
    +    if(parentFilter != null) {
    +      try {
    +        Query parentFilterQuery = QParser.getParser( parentFilter, req).getQuery();
    +        //TODO shouldn't we try to use the Solr filter cache, and then ideally implement
    +        //  BitSetProducer over that?
    +        // DocSet parentDocSet = req.getSearcher().getDocSet(parentFilterQuery);
    +        // then return BitSetProducer with custom BitSet impl accessing the docSet
    +        parentsFilter = new QueryBitSetProducer(parentFilterQuery);
    +      } catch (SyntaxError syntaxError) {
    +        throw new SolrException( ErrorCode.BAD_REQUEST, "Failed to create correct parent filter query" );
    +      }
    +    } else {
    +      String sRootFilter = "{!frange l=1 u=1}strdist(" + req.getSchema().getUniqueKeyField().getName() + "," + ROOT_FIELD_NAME + ",edit)";
    +      try {
    +        Query parentFilterQuery = QParser.getParser(sRootFilter, req).getQuery();
    +        //TODO shouldn't we try to use the Solr filter cache, and then ideally implement
    +        //  BitSetProducer over that?
    +        // DocSet parentDocSet = req.getSearcher().getDocSet(parentFilterQuery);
    +        // then return BitSetProducer with custom BitSet impl accessing the docSet
    +        parentsFilter = new QueryBitSetProducer(parentFilterQuery);
    +      } catch (SyntaxError syntaxError) {
    +        throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, "Failed to create correct parent filter query" );
    +      }
    +    }
    +
    +    if(childFilterQuery == null) {
    +      return new DeeplyNestedChildDocTransformer(field, parentsFilter, req, limit);
    +    }
    +    return new DeeplyNestedFilterChildDocTransformer(field, parentsFilter, req, childFilterQuery, nestPath!=null? generatePattern(splitPath): null, limit);
    +  }
    +
    +  private Pattern generatePattern(List<String> pathList) {
    +    if(pathList.size() <= 2) {
    +      return Pattern.compile(pathList.get(0) + NUM_SEP_CHAR + "\\d");
    +    }
    +    return Pattern.compile(String.join(NUM_SEP_CHAR + "\\d" + PATH_SEP_CHAR, pathList.subList(0, pathList.size() - 1)) + NUM_SEP_CHAR + "\\d");
    +  }
    +}
    +
    +class DeeplyNestedFilterChildDocTransformer extends DeeplyNestedChildDocTransformerBase {
    +
    +  private Query childFilterQuery;
    +  private Pattern nestPathMatcher;
    +
    +  public DeeplyNestedFilterChildDocTransformer( String name, final BitSetProducer parentsFilter,
    +                              final SolrQueryRequest req, final Query childFilterQuery, Pattern pathPattern, int limit) {
    +    super(name, parentsFilter, req, limit);
    +    this.childFilterQuery = childFilterQuery;
    +    this.nestPathMatcher = pathPattern;
    +  }
    +
    +  @Override
    +  public void transform(SolrDocument rootDoc, int docid) {
    --- End diff --
   
    This is a going to be a real challenge to come up with something that is understandable (doesn't appear *too* complicated).  Right now it appears too complicated to me; it's hard to review.  Tonight I think I'll propose some pseudocode on how to structure it.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr pull request #416: WIP: SOLR-12519

cbismuth
In reply to this post by cbismuth
Github user moshebla commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/416#discussion_r204227753
 
    --- Diff: solr/core/src/java/org/apache/solr/response/transform/DeeplyNestedChildDocTransformerFactory.java ---
    @@ -0,0 +1,367 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.solr.response.transform;
    +
    +import java.io.IOException;
    +import java.util.ArrayList;
    +import java.util.List;
    +import java.util.Set;
    +import java.util.regex.Pattern;
    +
    +import org.apache.lucene.document.Document;
    +import org.apache.lucene.index.DocValues;
    +import org.apache.lucene.index.ReaderUtil;
    +import org.apache.lucene.index.SortedDocValues;
    +import org.apache.lucene.search.Query;
    +import org.apache.lucene.search.join.BitSetProducer;
    +import org.apache.lucene.search.join.QueryBitSetProducer;
    +import org.apache.lucene.search.join.ToChildBlockJoinQuery;
    +import org.apache.solr.common.SolrDocument;
    +import org.apache.solr.common.SolrException;
    +import org.apache.solr.common.SolrException.ErrorCode;
    +import org.apache.solr.common.params.SolrParams;
    +import org.apache.solr.common.util.StrUtils;
    +import org.apache.solr.request.SolrQueryRequest;
    +import org.apache.solr.response.DocsStreamer;
    +import org.apache.solr.schema.FieldType;
    +import org.apache.solr.schema.SchemaField;
    +import org.apache.solr.search.DocIterator;
    +import org.apache.solr.search.DocList;
    +import org.apache.solr.search.QParser;
    +import org.apache.solr.search.SolrDocumentFetcher;
    +import org.apache.solr.search.SolrReturnFields;
    +import org.apache.solr.search.SyntaxError;
    +
    +import static org.apache.solr.response.transform.DeeplyNestedChildDocTransformerFactory.PATH_SEP_CHAR;
    +import static org.apache.solr.schema.IndexSchema.NEST_PATH_FIELD_NAME;
    +import static org.apache.solr.schema.IndexSchema.ROOT_FIELD_NAME;
    +
    +/**
    + *
    + * @since solr 4.9
    + *
    + * This transformer returns all descendants of each parent document in a flat list nested inside the parent document.
    + *
    + *
    + * The "parentFilter" parameter is mandatory.
    + * Optionally you can provide a "childFilter" param to filter out which child documents should be returned and a
    + * "limit" param which provides an option to specify the number of child documents
    + * to be returned per parent document. By default it's set to 10.
    + *
    + * Examples -
    + * [child parentFilter="fieldName:fieldValue"]
    + * [child parentFilter="fieldName:fieldValue" childFilter="fieldName:fieldValue"]
    + * [child parentFilter="fieldName:fieldValue" childFilter="fieldName:fieldValue" limit=20]
    + */
    +public class DeeplyNestedChildDocTransformerFactory extends TransformerFactory {
    --- End diff --
   
    Sure thing, I will merge the two transformers


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr pull request #416: WIP: SOLR-12519

cbismuth
In reply to this post by cbismuth
Github user moshebla commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/416#discussion_r204227785
 
    --- Diff: solr/core/src/java/org/apache/solr/response/transform/DeeplyNestedChildTransformerBase.java ---
    @@ -0,0 +1,139 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.solr.response.transform;
    +
    +import java.util.ArrayList;
    +import java.util.Iterator;
    +import java.util.List;
    +import java.util.Objects;
    +import java.util.stream.Stream;
    +
    +import org.apache.lucene.index.IndexableField;
    +import org.apache.lucene.search.Sort;
    +import org.apache.lucene.search.SortField;
    +import org.apache.lucene.search.join.BitSetProducer;
    +import org.apache.lucene.util.BitSet;
    +import org.apache.solr.common.SolrDocument;
    +import org.apache.solr.request.SolrQueryRequest;
    +import org.apache.solr.schema.FieldType;
    +import org.apache.solr.schema.IndexSchema;
    +import org.apache.solr.schema.SchemaField;
    +
    +import static org.apache.solr.response.transform.DeeplyNestedChildDocTransformerFactory.NUM_SEP_CHAR;
    +import static org.apache.solr.schema.IndexSchema.NEST_PATH_FIELD_NAME;
    +
    +/**
    + *
    + * This base class helps create a child doc transformer which caches the parent query using QueryBitProducer
    + *
    + *
    + * "limit" param which provides an option to specify the number of child documents
    + * to be returned per parent document. By default it's set to 10.
    + *
    + * @see org.apache.solr.response.transform.DeeplyNestedChildDocTransformer
    + * @see org.apache.solr.response.transform.DeeplyNestedFilterChildDocTransformer
    + */
    +
    +abstract class DeeplyNestedChildDocTransformerBase extends DocTransformer {
    +  private final String name;
    +  protected final SchemaField idField;
    +  protected final SolrQueryRequest req;
    +  protected final IndexSchema schema;
    +  protected BitSetProducer parentsFilter;
    +  protected BitSet parents;
    +  protected int limit;
    +  protected final Sort pathKeySort;
    +
    +  public DeeplyNestedChildDocTransformerBase( String name, final BitSetProducer parentsFilter,
    +                                          final SolrQueryRequest req, int limit) {
    +    this.name = name;
    +    this.schema = req.getSchema();
    +    this.idField = this.schema.getUniqueKeyField();
    +    this.req = req;
    +    this.parentsFilter = parentsFilter;
    +    this.limit = limit;
    +    this.pathKeySort = new Sort(new SortField(NEST_PATH_FIELD_NAME, SortField.Type.STRING, false),
    +        new SortField(idField.getName(), SortField.Type.STRING, false));
    +  }
    +
    +  @Override
    +  public String getName()  {
    +    return name;
    +  }
    +
    +  @Override
    +  public String[] getExtraRequestFields() {
    +    // we always need the idField (of the parent) in order to fill out it's children
    +    return new String[] { idField.getName() };
    +  }
    +
    +  protected static SolrDocument getChildByPath(String[] pathAndNum, SolrDocument lastDoc) {
    +    List<Object> fieldsValues = (List<Object>) lastDoc.getFieldValues(pathAndNum[0]);
    +    int childIndex = Integer.parseInt(pathAndNum[1]);
    +    return fieldsValues.size() > childIndex ? (SolrDocument) fieldsValues.get(childIndex): null;
    +  }
    +
    +  protected static void addChild(SolrDocument parentDoc, String[] pathAndNum, SolrDocument cDoc) {
    +    if(!pathAndNum[1].equals("") && (parentDoc.get(pathAndNum[0]) == null)) {
    +      parentDoc.setField(pathAndNum[0], new NullFilteringArrayList<SolrDocument>());
    +    }
    +    NullFilteringArrayList fieldValues = (NullFilteringArrayList) parentDoc.getFieldValues(pathAndNum[0]);
    +    int pathNum = Integer.parseInt(pathAndNum[1]);
    +
    +    fieldValues.addWithPlaceHolder(pathNum, cDoc);
    +  }
    +
    +  protected static String[] getPathAndNum(String lastPath) {
    +    return lastPath.split(NUM_SEP_CHAR);
    +  }
    +
    +  protected static String getSolrFieldString(Object fieldVal, FieldType fieldType) {
    +    return fieldVal instanceof IndexableField
    +        ? fieldType.toExternal((IndexableField)fieldVal)
    +        : fieldVal.toString();
    +  }
    +
    +  protected static class NullFilteringArrayList<T> extends ArrayList<T> {
    --- End diff --
   
    I used this since the paths in the documents are stored as array indexes. In case some documents from the array were filtered, I insert null values, so the child docs that matched the filter will be in the same array index as they were originally. Inside the iterator method, the null values are filtered, so they don't get written by the response writer.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr pull request #416: WIP: SOLR-12519

cbismuth
In reply to this post by cbismuth
Github user moshebla commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/416#discussion_r204227797
 
    --- Diff: solr/core/src/java/org/apache/solr/response/transform/DeeplyNestedChildDocTransformerFactory.java ---
    @@ -0,0 +1,367 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.solr.response.transform;
    +
    +import java.io.IOException;
    +import java.util.ArrayList;
    +import java.util.List;
    +import java.util.Set;
    +import java.util.regex.Pattern;
    +
    +import org.apache.lucene.document.Document;
    +import org.apache.lucene.index.DocValues;
    +import org.apache.lucene.index.ReaderUtil;
    +import org.apache.lucene.index.SortedDocValues;
    +import org.apache.lucene.search.Query;
    +import org.apache.lucene.search.join.BitSetProducer;
    +import org.apache.lucene.search.join.QueryBitSetProducer;
    +import org.apache.lucene.search.join.ToChildBlockJoinQuery;
    +import org.apache.solr.common.SolrDocument;
    +import org.apache.solr.common.SolrException;
    +import org.apache.solr.common.SolrException.ErrorCode;
    +import org.apache.solr.common.params.SolrParams;
    +import org.apache.solr.common.util.StrUtils;
    +import org.apache.solr.request.SolrQueryRequest;
    +import org.apache.solr.response.DocsStreamer;
    +import org.apache.solr.schema.FieldType;
    +import org.apache.solr.schema.SchemaField;
    +import org.apache.solr.search.DocIterator;
    +import org.apache.solr.search.DocList;
    +import org.apache.solr.search.QParser;
    +import org.apache.solr.search.SolrDocumentFetcher;
    +import org.apache.solr.search.SolrReturnFields;
    +import org.apache.solr.search.SyntaxError;
    +
    +import static org.apache.solr.response.transform.DeeplyNestedChildDocTransformerFactory.PATH_SEP_CHAR;
    +import static org.apache.solr.schema.IndexSchema.NEST_PATH_FIELD_NAME;
    +import static org.apache.solr.schema.IndexSchema.ROOT_FIELD_NAME;
    +
    +/**
    + *
    + * @since solr 4.9
    + *
    + * This transformer returns all descendants of each parent document in a flat list nested inside the parent document.
    + *
    + *
    + * The "parentFilter" parameter is mandatory.
    + * Optionally you can provide a "childFilter" param to filter out which child documents should be returned and a
    + * "limit" param which provides an option to specify the number of child documents
    + * to be returned per parent document. By default it's set to 10.
    + *
    + * Examples -
    + * [child parentFilter="fieldName:fieldValue"]
    + * [child parentFilter="fieldName:fieldValue" childFilter="fieldName:fieldValue"]
    + * [child parentFilter="fieldName:fieldValue" childFilter="fieldName:fieldValue" limit=20]
    + */
    +public class DeeplyNestedChildDocTransformerFactory extends TransformerFactory {
    +
    +  public static final String PATH_SEP_CHAR = "/";
    +  public static final String NUM_SEP_CHAR = "#";
    +
    +  @Override
    +  public DocTransformer create(String field, SolrParams params, SolrQueryRequest req) {
    +    SchemaField uniqueKeyField = req.getSchema().getUniqueKeyField();
    +    if(uniqueKeyField == null) {
    +      throw new SolrException( ErrorCode.BAD_REQUEST,
    +          " ChildDocTransformer requires the schema to have a uniqueKeyField." );
    +    }
    +
    +    String childFilter = params.get( "childFilter" );
    +    String nestPath = null;
    +    int limit = params.getInt( "limit", 10 );
    +
    +    Query childFilterQuery = null;
    +    List<String> split = null;
    +    List<String> splitPath = null;
    +    if(childFilter != null) {
    +      split = StrUtils.splitSmart(childFilter, ':');
    +      splitPath = StrUtils.splitSmart(split.get(0), PATH_SEP_CHAR.charAt(0));
    +      try {
    +        if (childFilter.contains(PATH_SEP_CHAR)) {
    +          nestPath = String.join(PATH_SEP_CHAR, splitPath.subList(0, splitPath.size() - 1));
    +          // TODO: filter out parents who's childDocs don't match the original childFilter
    +          childFilter = "(" + splitPath.get(splitPath.size() - 1) + ":\"" + split.get(split.size() - 1) + "\" AND " + NEST_PATH_FIELD_NAME + ":\"" + nestPath + "/\")";
    +        }
    +        childFilterQuery = QParser.getParser(childFilter, req).getQuery();
    +      } catch (SyntaxError syntaxError) {
    +        throw new SolrException( ErrorCode.BAD_REQUEST, "Failed to create correct child filter query" );
    +      }
    +    }
    +
    +    String parentFilter = params.get( "parentFilter" );
    +
    +    BitSetProducer parentsFilter = null;
    +
    +    if(parentFilter != null) {
    +      try {
    +        Query parentFilterQuery = QParser.getParser( parentFilter, req).getQuery();
    +        //TODO shouldn't we try to use the Solr filter cache, and then ideally implement
    +        //  BitSetProducer over that?
    +        // DocSet parentDocSet = req.getSearcher().getDocSet(parentFilterQuery);
    +        // then return BitSetProducer with custom BitSet impl accessing the docSet
    +        parentsFilter = new QueryBitSetProducer(parentFilterQuery);
    +      } catch (SyntaxError syntaxError) {
    +        throw new SolrException( ErrorCode.BAD_REQUEST, "Failed to create correct parent filter query" );
    +      }
    +    } else {
    +      String sRootFilter = "{!frange l=1 u=1}strdist(" + req.getSchema().getUniqueKeyField().getName() + "," + ROOT_FIELD_NAME + ",edit)";
    +      try {
    +        Query parentFilterQuery = QParser.getParser(sRootFilter, req).getQuery();
    +        //TODO shouldn't we try to use the Solr filter cache, and then ideally implement
    +        //  BitSetProducer over that?
    +        // DocSet parentDocSet = req.getSearcher().getDocSet(parentFilterQuery);
    +        // then return BitSetProducer with custom BitSet impl accessing the docSet
    +        parentsFilter = new QueryBitSetProducer(parentFilterQuery);
    +      } catch (SyntaxError syntaxError) {
    +        throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, "Failed to create correct parent filter query" );
    +      }
    +    }
    +
    +    if(childFilterQuery == null) {
    +      return new DeeplyNestedChildDocTransformer(field, parentsFilter, req, limit);
    +    }
    +    return new DeeplyNestedFilterChildDocTransformer(field, parentsFilter, req, childFilterQuery, nestPath!=null? generatePattern(splitPath): null, limit);
    +  }
    +
    +  private Pattern generatePattern(List<String> pathList) {
    +    if(pathList.size() <= 2) {
    +      return Pattern.compile(pathList.get(0) + NUM_SEP_CHAR + "\\d");
    +    }
    +    return Pattern.compile(String.join(NUM_SEP_CHAR + "\\d" + PATH_SEP_CHAR, pathList.subList(0, pathList.size() - 1)) + NUM_SEP_CHAR + "\\d");
    +  }
    +}
    +
    +class DeeplyNestedFilterChildDocTransformer extends DeeplyNestedChildDocTransformerBase {
    +
    +  private Query childFilterQuery;
    +  private Pattern nestPathMatcher;
    +
    +  public DeeplyNestedFilterChildDocTransformer( String name, final BitSetProducer parentsFilter,
    +                              final SolrQueryRequest req, final Query childFilterQuery, Pattern pathPattern, int limit) {
    +    super(name, parentsFilter, req, limit);
    +    this.childFilterQuery = childFilterQuery;
    +    this.nestPathMatcher = pathPattern;
    +  }
    +
    +  @Override
    +  public void transform(SolrDocument rootDoc, int docid) {
    --- End diff --
   
    Sure thing, any help would be welcome.
    This is a pretty rough draft, so I will try to work on this ASAP before I add more logic to the transformer.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr issue #416: WIP: SOLR-12519

cbismuth
In reply to this post by cbismuth
Github user moshebla commented on the issue:

    https://github.com/apache/lucene-solr/pull/416
 
    This is only a start, I will merge this into the main ChildDocTransformerFactory.
    This new algorithm is simpler, just like you suggested, although it contains a few minor implementation changes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr issue #416: WIP: SOLR-12519

cbismuth
In reply to this post by cbismuth
Github user dsmiley commented on the issue:

    https://github.com/apache/lucene-solr/pull/416
 
    Before I look further I want to mention 2 things:
    * There needn't be separation between the non-nested and nested algorithm.  We could simply use the nested algorithm but special-case when the SortedDocValues we get is null due to non-existent path.  In that event, all docs get added to the root, anonymously (unlabelled).  I suspect doing it this way is less code and will be sufficiently clear but we'll see?
    * My pseudocode had a TODO about double-resolving the path in order to get the label at the time the docs are added to the parent.  If we make the pending data structure a Multimap<Integer,Multimap<String,SolrDocument>> then at the time we read the document and get the path we could store the relationship at this time.  Or perhaps you have a better idea.  I thought of putting the label into a temporary field of the SolrDocument; though I'm not sure I like that any better; maybe less.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr issue #416: WIP: SOLR-12519

cbismuth
In reply to this post by cbismuth
Github user moshebla commented on the issue:

    https://github.com/apache/lucene-solr/pull/416
 
    In my implementation I have used a Multimap<String,SolrDocument> for the pending data, so we can decide if we put the number in the array of the parent's key. That way, There can be an option to add all parents if the child documents parent is inside a list, or only the child doc's direct parent. This can be done by the way we store the pending child doc's key, with or with out the array index.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr issue #416: WIP: SOLR-12519

cbismuth
In reply to this post by cbismuth
Github user dsmiley commented on the issue:

    https://github.com/apache/lucene-solr/pull/416
 
    When you refer to the "array index", what do you mean?  Do you mean a DocValue ord?  Do you mean the '#2' or whatever child index?  AFAIK this code shouldn't care about child index.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr issue #416: WIP: SOLR-12519

cbismuth
In reply to this post by cbismuth
Github user moshebla commented on the issue:

    https://github.com/apache/lucene-solr/pull/416
 
    I was referring to the '#2'.
    Imagine a query for a social network, where all the posts comments made by a specific user are required, including the ones he commented on, which would not ,atch the ChildFilter commnent.author:Joe. To display these comments we would need to bring all the hierarchy above.
    In another scenario one might want to get statistics of how many comments, including replies Joe commented on each post. This can be done using just the Path, excluding the array index, so isAncestor returns true.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr issue #416: WIP: SOLR-12519

cbismuth
In reply to this post by cbismuth
Github user moshebla commented on the issue:

    https://github.com/apache/lucene-solr/pull/416
 
    I will push another commit soon.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr issue #416: WIP: SOLR-12519

cbismuth
In reply to this post by cbismuth
Github user dsmiley commented on the issue:

    https://github.com/apache/lucene-solr/pull/416
 
    > Imagine a query for a social network, where all the posts comments made by a specific user are required, including the ones he commented on, which would not match the ChildFilter comment.author:Joe.
   
    Assuming a comment on another comment is a parent/child relationship (i.e. the recursive comments are ancestors), wouldn't our doc transformer return those ancestors?  We're expressly writing it to return those ancestors so it would.  The ancestor path ord IDs will refer to paths distinguishing the comment occurrences, e.g. might resolve to a path looking something like `comment#3/comment#9/comment#1/` and thus we don't mix up which comment is on which.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr issue #416: WIP: SOLR-12519

cbismuth
In reply to this post by cbismuth
Github user dsmiley commented on the issue:

    https://github.com/apache/lucene-solr/pull/416
 
    I think this issue should only be about returning a nested hierarchy.  That at least seems clear -- something everyone would want.  But computing stats... wow thats a large scope increase that deserves its own issue.  Lets table that.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr issue #416: WIP: SOLR-12519

cbismuth
In reply to this post by cbismuth
Github user moshebla commented on the issue:

    https://github.com/apache/lucene-solr/pull/416
 
    Sure thing it won't mix up the comments, but what if the user also requests all the comments which in the same thread, thus being in the same array just a path above?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr issue #416: WIP: SOLR-12519

cbismuth
In reply to this post by cbismuth
Github user dsmiley commented on the issue:

    https://github.com/apache/lucene-solr/pull/416
 
    > what if the user also requests all the comments which in the same thread, thus being in the same array just a path above?
   
    Sounds like a distinct issue.  It'd add some complexity... for example the very first child doc ID might be the 2nd child of its parent.  We'd need to grab the first doc of the parent, which would have a docID earlier than we have even seen.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr issue #416: WIP: SOLR-12519

cbismuth
In reply to this post by cbismuth
Github user moshebla commented on the issue:

    https://github.com/apache/lucene-solr/pull/416
 
    OK, We'll scratch that for now, and discuss this in a separate issue.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr issue #416: WIP: SOLR-12519

cbismuth
In reply to this post by cbismuth
Github user moshebla commented on the issue:

    https://github.com/apache/lucene-solr/pull/416
 
    I found this nasty bug in [AtomicUpdateDocumentMerger#isAtomicUpdate](https://github.com/apache/lucene-solr/pull/416/commits/7cd1dbc3208746541bd80f2d2656b6464fecd23d#diff-50d2f2a4580a649dc2a08749061504a0R78), where single child docs(non array) were mistaken for an atomicUpdate.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr issue #416: WIP: SOLR-12519

cbismuth
In reply to this post by cbismuth
Github user dsmiley commented on the issue:

    https://github.com/apache/lucene-solr/pull/416
 
    RE isAtomicUpdate:  Good catch!  Please add a test to call this; perhaps it's just one additional line to an existing test.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

1234 ... 9