You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by rmp91 <gi...@git.apache.org> on 2015/06/25 21:49:11 UTC

[GitHub] lucene-solr pull request: LUCENE-6610:Fixed potential resource lea...

GitHub user rmp91 opened a pull request:

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

    LUCENE-6610:Fixed potential resource leaks

    https://issues.apache.org/jira/browse/LUCENE-6610

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

    $ git pull https://github.com/rmp91/lucene-solr LUCENE-6610

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

    https://github.com/apache/lucene-solr/pull/162.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 #162
    
----
commit ded3f168e5204c2a88d23df02fd89c935f149d2c
Author: Rishabh Patel <ri...@gmail.com>
Date:   2015-06-25T19:45:38Z

    Fixed potential resource leaks

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] lucene-solr pull request #162: SOLR-8776: Support RankQuery in grouping

Posted by romseygeek <gi...@git.apache.org>.
Github user romseygeek commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/162#discussion_r117773779
  
    --- Diff: lucene/grouping/src/java/org/apache/lucene/search/grouping/TopGroupsCollector.java ---
    @@ -39,6 +39,14 @@
       private final Sort withinGroupSort;
       private final int maxDocsPerGroup;
     
    +  protected TopGroupsCollector(GroupReducer<T, TopDocsCollector<?>> groupReducer, GroupSelector<T> groupSelector, Collection<SearchGroup<T>> groups, Sort groupSort, Sort withinGroupSort,
    +                            int maxDocsPerGroup, boolean getScores, boolean getMaxScores, boolean fillSortFields) {
    +    super(groupSelector, groups, groupReducer);
    --- End diff --
    
    You can remove a few of these parameters now, I think?  They're for the Reducer, and as such don't need to be passed separately.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] lucene-solr pull request #162: SOLR-8776: Support RankQuery in grouping

Posted by ilaygit <gi...@git.apache.org>.
Github user ilaygit commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/162#discussion_r187527922
  
    --- Diff: solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java ---
    @@ -1270,7 +1270,7 @@ private void doProcessGroupedDistributedSearchFirstPhase(ResponseBuilder rb, Que
           final int topNGroups;
           Query query = cmd.getQuery();
           if (query instanceof AbstractReRankQuery){
    -        topNGroups = cmd.getOffset() + ((AbstractReRankQuery)query).getReRankDocs();
    +        topNGroups = Math.max(((AbstractReRankQuery)query).getReRankDocs(), cmd.getOffset() + cmd.getLen());
    --- End diff --
    
    Should this be handled for non distributed case as well in doProcessGroupedSearch(..), when pageSize>reRankDocs it returns only "reRankDocs" groups in non distributed case.


---

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


[GitHub] lucene-solr pull request #162: SOLR-8776: Support RankQuery in grouping

Posted by diegoceccarelli <gi...@git.apache.org>.
Github user diegoceccarelli commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/162#discussion_r185490261
  
    --- Diff: solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java ---
    @@ -1414,10 +1267,17 @@ private void doProcessGroupedDistributedSearchFirstPhase(ResponseBuilder rb, Que
             .setSearcher(searcher);
     
         for (String field : groupingSpec.getFields()) {
    +      final int topNGroups;
    +      Query query = cmd.getQuery();
    +      if (query instanceof AbstractReRankQuery){
    +        topNGroups = cmd.getOffset() + ((AbstractReRankQuery)query).getReRankDocs();
    +      } else {
    +        topNGroups = cmd.getOffset() + cmd.getLen();
    +      }
           topsGroupsActionBuilder.addCommandField(new SearchGroupsFieldCommand.Builder()
               .setField(schema.getField(field))
               .setGroupSort(groupingSpec.getGroupSort())
    -          .setTopNGroups(cmd.getOffset() + cmd.getLen())
    --- End diff --
    
    True, this currently reranks the top `start +  rerankDocuments `, I'll fix it. Thank you


---

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


[GitHub] lucene-solr pull request #162: SOLR-8776: Support RankQuery in grouping

Posted by ilaygit <gi...@git.apache.org>.
Github user ilaygit commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/162#discussion_r185438730
  
    --- Diff: solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java ---
    @@ -1414,10 +1267,17 @@ private void doProcessGroupedDistributedSearchFirstPhase(ResponseBuilder rb, Que
             .setSearcher(searcher);
     
         for (String field : groupingSpec.getFields()) {
    +      final int topNGroups;
    +      Query query = cmd.getQuery();
    +      if (query instanceof AbstractReRankQuery){
    +        topNGroups = cmd.getOffset() + ((AbstractReRankQuery)query).getReRankDocs();
    +      } else {
    +        topNGroups = cmd.getOffset() + cmd.getLen();
    +      }
           topsGroupsActionBuilder.addCommandField(new SearchGroupsFieldCommand.Builder()
               .setField(schema.getField(field))
               .setGroupSort(groupingSpec.getGroupSort())
    -          .setTopNGroups(cmd.getOffset() + cmd.getLen())
    --- End diff --
    
    Is it reRanking with respect to the "start" param in the solr query?
    Looks like the original LTR plugin is supposed to reRank top K irrespective of the offset.
    ref.http://lucene.472066.n3.nabble.com/Learning-to-Rank-LTR-with-grouping-td4366691i20.html#a4387929


---

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