Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 1.3
    • Fix Version/s: 3.3
    • Component/s: search
    • Labels:
      None

      Description

      This patch include a new feature called "Field collapsing".

      "Used in order to collapse a group of results with similar value for a given field to a single entry in the result set. Site collapsing is a special case of this, where all results for a given web site is collapsed into one or two entries in the result set, typically with an associated "more documents from this site" link. See also Duplicate detection."
      http://www.fastsearch.com/glossary.aspx?m=48&amid=299

      The implementation add 3 new query parameters (SolrParams):
      "collapse.field" to choose the field used to group results
      "collapse.type" normal (default value) or adjacent
      "collapse.max" to select how many continuous results are allowed before collapsing

      TODO (in progress):

      • More documentation (on source code)
      • Test cases

      Two patches:

      • "field_collapsing.patch" for current development version
      • "field_collapsing_1.1.0.patch" for Solr-1.1.0

      P.S.: Feedback and misspelling correction are welcome

      1. field_collapsing_1.1.0.patch
        12 kB
        Emmanuel Keller
      2. SOLR-236-FieldCollapsing.patch
        16 kB
        Ryan McKinley
      3. SOLR-236-FieldCollapsing.patch
        18 kB
        Ryan McKinley
      4. SOLR-236-FieldCollapsing.patch
        18 kB
        Emmanuel Keller
      5. field_collapsing_1.3.patch
        14 kB
        Emmanuel Keller
      6. field-collapsing-extended-592129.patch
        31 kB
        Karsten Sperling
      7. field_collapsing_dsteigerwald.diff
        25 kB
        Doug Steigerwald
      8. field_collapsing_dsteigerwald.diff
        25 kB
        Charles Hornberger
      9. field_collapsing_dsteigerwald.diff
        25 kB
        Oleg Gnatovskiy
      10. solr-236.patch
        24 kB
        Bojan Smid
      11. collapsing-patch-to-1.3.0-ivan.patch
        24 kB
        Iván de Prado
      12. collapsing-patch-to-1.3.0-ivan_2.patch
        24 kB
        Iván de Prado
      13. collapsing-patch-to-1.3.0-ivan_3.patch
        24 kB
        Iván de Prado
      14. collapsing-patch-to-1.3.0-dieter.patch
        26 kB
        dieter grad
      15. SOLR-236_collapsing.patch
        26 kB
        Dmitry Lihachev
      16. SOLR-236_collapsing.patch
        25 kB
        Thomas Traeger
      17. field-collapse-solr-236.patch
        49 kB
        Martijn van Groningen
      18. field-collapse-solr-236-2.patch
        52 kB
        Martijn van Groningen
      19. field-collapse-3.patch
        52 kB
        Martijn van Groningen
      20. field-collapse-4-with-solrj.patch
        66 kB
        Martijn van Groningen
      21. field-collapse-5.patch
        122 kB
        Martijn van Groningen
      22. field-collapse-5.patch
        133 kB
        Martijn van Groningen
      23. field-collapse-5.patch
        134 kB
        Martijn van Groningen
      24. field-collapse-5.patch
        134 kB
        Martijn van Groningen
      25. field-collapse-5.patch
        136 kB
        Martijn van Groningen
      26. field-collapse-5.patch
        146 kB
        Martijn van Groningen
      27. field-collapse-5.patch
        144 kB
        Martijn van Groningen
      28. field-collapse-5.patch
        216 kB
        Martijn van Groningen
      29. field-collapse-5.patch
        218 kB
        Martijn van Groningen
      30. quasidistributed.additional.patch
        1 kB
        Michael Gundlach
      31. field-collapse-5.patch
        218 kB
        Martijn van Groningen
      32. field-collapse-5.patch
        239 kB
        Martijn van Groningen
      33. field-collapse-5.patch
        244 kB
        Martijn van Groningen
      34. field-collapse-5.patch
        251 kB
        Martijn van Groningen
      35. field-collapse-5.patch
        253 kB
        Martijn van Groningen
      36. field-collapse-5.patch
        254 kB
        Martijn van Groningen
      37. SOLR-236.patch
        253 kB
        Shalin Shekhar Mangar
      38. SOLR-236.patch
        245 kB
        Martijn van Groningen
      39. SOLR-236.patch
        257 kB
        Shalin Shekhar Mangar
      40. SOLR-236.patch
        251 kB
        Martijn van Groningen
      41. SOLR-236.patch
        252 kB
        Shalin Shekhar Mangar
      42. SOLR-236.patch
        244 kB
        Martijn van Groningen
      43. SOLR-236.patch
        245 kB
        Martijn van Groningen
      44. DocSetScoreCollector.java
        5 kB
        Peter Karich
      45. NonAdjacentDocumentCollapser.java
        21 kB
        Peter Karich
      46. NonAdjacentDocumentCollapserTest.java
        9 kB
        Peter Karich
      47. SOLR-236-trunk.patch
        236 kB
        Martijn van Groningen
      48. SOLR-236-trunk.patch
        247 kB
        Martijn van Groningen
      49. SOLR-236-trunk.patch
        250 kB
        Martijn van Groningen
      50. SOLR-236-trunk.patch
        256 kB
        Martijn van Groningen
      51. SOLR-236-trunk.patch
        259 kB
        Martijn van Groningen
      52. SOLR-236-1_4_1.patch
        264 kB
        Martijn van Groningen
      53. SOLR-236.patch
        27 kB
        Yonik Seeley
      54. SOLR-236-1_4_1-paging-totals-working.patch
        264 kB
        Stephen Weiss
      55. SOLR-236-distinctFacet.patch
        2 kB
        Bill Bell
      56. SOLR-236-1_4_1-NPEfix.patch
        0.7 kB
        Cameron
      57. SOLR-236-branch_3x.patch
        258 kB
        Doug Steigerwald

        Issue Links

          Activity

          Emmanuel Keller created issue -
          Emmanuel Keller made changes -
          Field Original Value New Value
          Attachment collapse_field.patch [ 12357145 ]
          Emmanuel Keller made changes -
          Attachment collapse_field.patch [ 12357149 ]
          Emmanuel Keller made changes -
          Link This issue is related to SOLR-237 [ SOLR-237 ]
          Emmanuel Keller made changes -
          Attachment field_collapsing.patch [ 12357195 ]
          Emmanuel Keller made changes -
          Attachment field_collapsing.patch [ 12357238 ]
          Emmanuel Keller made changes -
          Description This patch include a new feature called "Field collapsing".

          "Used in order to collapse a group of results with similar value for a given field to a single entry in the result set. Site collapsing is a special case of this, where all results for a given web site is collapsed into one or two entries in the result set, typically with an associated "more documents from this site" link. See also Duplicate detection."
          http://www.fastsearch.com/glossary.aspx?m=48&amid=299

          The implementation add 3 new query parameters (SolrParams):
          "collapse" set to true to enable collapsing.
          "collapse.field" to choose the field used to group results
          "collapse.max" to select how many continuous results are allowed before collapsing

          TODO (in progress):
          - More documentation (on source code)
          - Test cases
          This patch include a new feature called "Field collapsing".

          "Used in order to collapse a group of results with similar value for a given field to a single entry in the result set. Site collapsing is a special case of this, where all results for a given web site is collapsed into one or two entries in the result set, typically with an associated "more documents from this site" link. See also Duplicate detection."
          http://www.fastsearch.com/glossary.aspx?m=48&amid=299

          The implementation add 4 new query parameters (SolrParams):
          "collapse" set to true to enable collapsing.
          "collapse.field" to choose the field used to group results
          "collapse.type" normal (default value) or adjacent
          "collapse.max" to select how many continuous results are allowed before collapsing

          TODO (in progress):
          - More documentation (on source code)
          - Test cases
          Emmanuel Keller made changes -
          Attachment field_collapsing.patch [ 12357680 ]
          Emmanuel Keller made changes -
          Attachment field_collapsing_1.1.0.patch [ 12357681 ]
          Emmanuel Keller made changes -
          Description This patch include a new feature called "Field collapsing".

          "Used in order to collapse a group of results with similar value for a given field to a single entry in the result set. Site collapsing is a special case of this, where all results for a given web site is collapsed into one or two entries in the result set, typically with an associated "more documents from this site" link. See also Duplicate detection."
          http://www.fastsearch.com/glossary.aspx?m=48&amid=299

          The implementation add 4 new query parameters (SolrParams):
          "collapse" set to true to enable collapsing.
          "collapse.field" to choose the field used to group results
          "collapse.type" normal (default value) or adjacent
          "collapse.max" to select how many continuous results are allowed before collapsing

          TODO (in progress):
          - More documentation (on source code)
          - Test cases
          This patch include a new feature called "Field collapsing".

          "Used in order to collapse a group of results with similar value for a given field to a single entry in the result set. Site collapsing is a special case of this, where all results for a given web site is collapsed into one or two entries in the result set, typically with an associated "more documents from this site" link. See also Duplicate detection."
          http://www.fastsearch.com/glossary.aspx?m=48&amid=299

          The implementation add 3 new query parameters (SolrParams):
          "collapse.field" to choose the field used to group results
          "collapse.type" normal (default value) or adjacent
          "collapse.max" to select how many continuous results are allowed before collapsing

          TODO (in progress):
          - More documentation (on source code)
          - Test cases

          Two patches:
          - "field_collapsing.patch" for current development version (1.2)
          - "field_collapsing_1.1.0.patch" for Solr-1.1.0


          P.S.: Feedback and misspelling correction are welcome ;-)
          Ryan McKinley made changes -
          Attachment SOLR-236-FieldCollapsing.patch [ 12358794 ]
          Emmanuel Keller made changes -
          Attachment SOLR-236-FieldCollapsing.patch [ 12358906 ]
          Emmanuel Keller made changes -
          Attachment SOLR-236-FieldCollapsing.patch [ 12358942 ]
          Emmanuel Keller made changes -
          Attachment collapse_field.patch [ 12357149 ]
          Emmanuel Keller made changes -
          Attachment collapse_field.patch [ 12357145 ]
          Emmanuel Keller made changes -
          Attachment field_collapsing.patch [ 12357680 ]
          Emmanuel Keller made changes -
          Attachment field_collapsing.patch [ 12357238 ]
          Emmanuel Keller made changes -
          Attachment field_collapsing.patch [ 12357195 ]
          Emmanuel Keller made changes -
          Attachment SOLR-236-FieldCollapsing.patch [ 12358906 ]
          Emmanuel Keller made changes -
          Attachment SOLR-236-FieldCollapsing.patch [ 12359403 ]
          Emmanuel Keller made changes -
          Attachment SOLR-236-FieldCollapsing.patch [ 12358942 ]
          Emmanuel Keller made changes -
          Affects Version/s 1.3 [ 12312486 ]
          Affects Version/s 1.2 [ 12312235 ]
          Description This patch include a new feature called "Field collapsing".

          "Used in order to collapse a group of results with similar value for a given field to a single entry in the result set. Site collapsing is a special case of this, where all results for a given web site is collapsed into one or two entries in the result set, typically with an associated "more documents from this site" link. See also Duplicate detection."
          http://www.fastsearch.com/glossary.aspx?m=48&amid=299

          The implementation add 3 new query parameters (SolrParams):
          "collapse.field" to choose the field used to group results
          "collapse.type" normal (default value) or adjacent
          "collapse.max" to select how many continuous results are allowed before collapsing

          TODO (in progress):
          - More documentation (on source code)
          - Test cases

          Two patches:
          - "field_collapsing.patch" for current development version (1.2)
          - "field_collapsing_1.1.0.patch" for Solr-1.1.0


          P.S.: Feedback and misspelling correction are welcome ;-)
          This patch include a new feature called "Field collapsing".

          "Used in order to collapse a group of results with similar value for a given field to a single entry in the result set. Site collapsing is a special case of this, where all results for a given web site is collapsed into one or two entries in the result set, typically with an associated "more documents from this site" link. See also Duplicate detection."
          http://www.fastsearch.com/glossary.aspx?m=48&amid=299

          The implementation add 3 new query parameters (SolrParams):
          "collapse.field" to choose the field used to group results
          "collapse.type" normal (default value) or adjacent
          "collapse.max" to select how many continuous results are allowed before collapsing

          TODO (in progress):
          - More documentation (on source code)
          - Test cases

          Two patches:
          - "field_collapsing.patch" for current development version
          - "field_collapsing_1.1.0.patch" for Solr-1.1.0


          P.S.: Feedback and misspelling correction are welcome ;-)
          Ryan McKinley made changes -
          Attachment SOLR-236-FieldCollapsing.patch [ 12359902 ]
          Emmanuel Keller made changes -
          Attachment SOLR-236-FieldCollapsing.patch [ 12359403 ]
          Emmanuel Keller made changes -
          Attachment SOLR-236-FieldCollapsing.patch [ 12360676 ]
          Emmanuel Keller made changes -
          Attachment field_collapsing_1.3.patch [ 12368569 ]
          Emmanuel Keller made changes -
          Attachment field_collapsing_1.3.patch [ 12368570 ]
          Emmanuel Keller made changes -
          Attachment field_collapsing_1.3.patch [ 12368569 ]
          Karsten Sperling made changes -
          Attachment field-collapsing-extended-592129.patch [ 12369053 ]
          Ryan McKinley made changes -
          Link This issue depends on SOLR-281 [ SOLR-281 ]
          Doug Steigerwald made changes -
          Attachment field_collapsing_dsteigerwald.diff [ 12372522 ]
          Charles Hornberger made changes -
          Attachment field_collapsing_dsteigerwald.diff [ 12372861 ]
          Oleg Gnatovskiy made changes -
          Attachment field_collapsing_dsteigerwald.diff [ 12375643 ]
          Otis Gospodnetic made changes -
          Assignee Otis Gospodnetic [ otis ]
          Otis Gospodnetic made changes -
          Comment [ Hi / Hallo,

          Thanks for your mail. Unfortunately, I won't be able to answer it
          soon. I'm on vacation till June 2nd without access to my mails.

          ~~~~

          Vielen Dank für die Email. Leider werde ich nicht sofort antworten.
          Ich bin bis 2. Juni im Urlaub ohne Zugriff auf mein Postfach.

          -Gunnar

          --
          Gunnar Wagenknecht
          gunnar@wagenknecht.org
          http://wagenknecht.org/
          ]
          Bojan Smid made changes -
          Attachment solr-236.patch [ 12383622 ]
          muddassirhasan made changes -
          Comment [ I tried to use this patch but i could make it work for me. I compiled solr with patch applied and added following to my solrconf : <searchComponent name="collapse" class="org.apache.solr.handler.component.CollapseComponent" /> and
          <requestHandler name="/search" class="org.apache.solr.handler.component.SearchHandler">
              <arr name="components">
                <str>collapse</str>
              </arr>
          </requestHandler>

          It started perfectly but i could not find any collapse on using
          collapse.field=key_string11&collapse.type=normal&collapse.max=1&collapse=true

          If i m missing out something. plz let me know my mistake. ]
          Shalin Shekhar Mangar made changes -
          Fix Version/s 1.4 [ 12313351 ]
          Otis Gospodnetic made changes -
          Link This issue is related to LUCENE-1421 [ LUCENE-1421 ]
          Otis Gospodnetic made changes -
          Assignee Otis Gospodnetic [ otis ]
          Iván de Prado made changes -
          Attachment collapsing-patch-to-1.3.0-ivan.patch [ 12393877 ]
          Iván de Prado made changes -
          Attachment collapsing-patch-to-1.3.0-ivan_2.patch [ 12395742 ]
          Iván de Prado made changes -
          Attachment collapsing-patch-to-1.3.0-ivan_3.patch [ 12396300 ]
          dieter grad made changes -
          Attachment collapsing-patch-to-1.3.0-dieter.patch [ 12399009 ]
          Shalin Shekhar Mangar made changes -
          Fix Version/s 1.4 [ 12313351 ]
          Fix Version/s 1.5 [ 12313566 ]
          Dmitry Lihachev made changes -
          Attachment SOLR-236_collapsing.patch [ 12403589 ]
          Dmitry Lihachev made changes -
          Attachment SOLR-236_collapsing.patch [ 12403589 ]
          Dmitry Lihachev made changes -
          Attachment SOLR-236_collapsing.patch [ 12403590 ]
          Domingo Gómez García made changes -
          Comment [ The results of collapse_counts are not what i have expected. It losses many categories, only showing a few . I tried incrementing the collapse.max parameter:

          max=1 results

          <lst name="doc">
          <int name="2008/LICOBLE-00023">109</int>
          <int name="2008/LICOBLE-3">5</int>
          <int name="2009/LICOBLE-00036">4</int>
          <int name="2009/LICOBLE-00095">1</int>
          </lst>

          <lst name="count">
          <int name="12740">109</int>
          <int name="12741">5</int>
          <int name="13282">4</int>
          <int>1</int>
          </lst>


          max=2 results

          <lst name="doc">
          <int name="2009/LICOBLE-00008">108</int>
          <int name="2007/LICOBLE-1">4</int>
          </lst>

          <lst name="count">
          <int name="12740">108</int>
          <int name="12741">4</int>
          </lst>


          max=3 results

          <lst name="doc">
          <int name="2008/LICOBLE-00020">107</int>
          <int name="2008/LICOBLE-00021">3</int>
          </lst>

          <lst name="count">
          <int name="12740">107</int>
          <int name="12741">3</int>
          </lst>


          max=4

          <lst name="doc">
          <int name="2009/LICOBLE-00060">106</int>
          </lst>

          <lst name="count">
          <int name="12740">106</int>
          </lst>

          How is possible to get less results each time? There are like 70 categories, do I have any way to obtain all those counts? Am I mising any collapsing concept?
          Thanks. ]
          Thomas Traeger made changes -
          Attachment SOLR-236_collapsing.patch [ 12407410 ]
          Martijn van Groningen made changes -
          Attachment field-collapse-solr-236.patch [ 12409377 ]
          Martijn van Groningen made changes -
          Attachment field-collapse-solr-236-2.patch [ 12409459 ]
          Martijn van Groningen made changes -
          Attachment field-collapse-3.patch [ 12414513 ]
          Hoss Man made changes -
          Link This issue is related to SOLR-1311 [ SOLR-1311 ]
          Martijn van Groningen made changes -
          Attachment field-collapse-4-with-solrj.patch [ 12416108 ]
          Martijn van Groningen made changes -
          Attachment field-collapse-5.patch [ 12417524 ]
          Martijn van Groningen made changes -
          Attachment field-collapse-5.patch [ 12419237 ]
          Martijn van Groningen made changes -
          Attachment field-collapse-5.patch [ 12419374 ]
          Martijn van Groningen made changes -
          Attachment field-collapse-5.patch [ 12419386 ]
          Martijn van Groningen made changes -
          Attachment field-collapse-5.patch [ 12419560 ]
          Martijn van Groningen made changes -
          Attachment field-collapse-5.patch [ 12420627 ]
          Martijn van Groningen made changes -
          Attachment field-collapse-5.patch [ 12422142 ]
          Martijn van Groningen made changes -
          Attachment field-collapse-5.patch [ 12423156 ]
          Martijn van Groningen made changes -
          Attachment field-collapse-5.patch [ 12423331 ]
          Michael Gundlach made changes -
          Attachment quasidistributed.additional.patch [ 12424470 ]
          Martijn van Groningen made changes -
          Attachment field-collapse-5.patch [ 12424567 ]
          Martijn van Groningen made changes -
          Attachment field-collapse-5.patch [ 12425030 ]
          Martijn van Groningen made changes -
          Attachment field-collapse-5.patch [ 12425775 ]
          Martijn van Groningen made changes -
          Attachment field-collapse-5.patch [ 12426370 ]
          Martijn van Groningen made changes -
          Attachment field-collapse-5.patch [ 12427386 ]
          Martijn van Groningen made changes -
          Attachment field-collapse-5.patch [ 12427828 ]
          Shalin Shekhar Mangar made changes -
          Assignee Shalin Shekhar Mangar [ shalinmangar ]
          Shalin Shekhar Mangar made changes -
          Attachment SOLR-236.patch [ 12428295 ]
          Martijn van Groningen made changes -
          Attachment SOLR-236.patch [ 12428365 ]
          Shalin Shekhar Mangar made changes -
          Attachment SOLR-236.patch [ 12428420 ]
          Noble Paul made changes -
          Comment [ hi,experts,
           thanks for the great work!
           now i download solr1.4 from http://apache.freelamp.com/lucene/solr/1.4.0/apache-solr-1.4.0.zip
          and i path this patch: SOLR-236.patch 2009-12-18 10:16 AM Shalin Shekhar Mangar
          like this:
          G:\doc\apache-solr-1.4.0>patch.exe -p0 < SOLR-236.patch

          it will show some error,and this patch( SOLR-236.patch 2009-12-18 10:16 AM )don't support solr1.4 ?


          and the result is:
          patching file src/test/test-files/solr/conf/solrconfig-fieldcollapse.xml
          patching file src/test/test-files/solr/conf/schema-fieldcollapse.xml
          patching file src/test/test-files/solr/conf/solrconfig.xml
          patching file src/test/test-files/fieldcollapse/testResponse.xml
          can't find file to patch at input line 787
          Perhaps you used the wrong -p or --strip option?
          The text leading up to this was:
          --------------------------
          |
          |Property changes on: src/test/test-files/fieldcollapse/testResponse.xml
          |___________________________________________________________________
          |Added: svn:keywords
          | + Date Author Id Revision HeadURL
          |Added: svn:eol-style
          | + native
          |
          |Index: src/test/org/apache/solr/BaseDistributedSearchTestCase.java
          |===================================================================
          |--- src/test/org/apache/solr/BaseDistributedSearchTestCase.java(revision 891214)
          |+++ src/test/org/apache/solr/BaseDistributedSearchTestCase.java(working copy)
          --------------------------
          File to patch: SOLR-236.patch
          S: No such file or directory
          Skip this patch? [y] y
          Skipping patch.
          2 out of 2 hunks ignored
          patching file src/test/org/apache/solr/search/fieldcollapse/FieldCollapsingIntegrationTest.java
          patching file src/test/org/apache/solr/search/fieldcollapse/DistributedFieldCollapsingIntegrationTest.java
          patching file src/test/org/apache/solr/search/fieldcollapse/NonAdjacentDocumentCollapserTest.java
          patching file src/test/org/apache/solr/search/fieldcollapse/AdjacentCollapserTest.java
          patching file src/test/org/apache/solr/handler/component/CollapseComponentTest.java
          patching file src/test/org/apache/solr/client/solrj/response/FieldCollapseResponseTest.java
          patching file src/java/org/apache/solr/search/DocSetAwareCollector.java
          patching file src/java/org/apache/solr/search/fieldcollapse/CollapseGroup.java
          patching file src/java/org/apache/solr/search/fieldcollapse/DocumentCollapseResult.java
          patching file src/java/org/apache/solr/search/fieldcollapse/DocumentCollapser.java
          patching file src/java/org/apache/solr/search/fieldcollapse/collector/CollapseCollectorFactory.java
          patching file src/java/org/apache/solr/search/fieldcollapse/collector/DocumentGroupCountCollapseCollectorFactory.java
          patching file src/java/org/apache/solr/search/fieldcollapse/collector/aggregate/AverageFunction.java
          patching file src/java/org/apache/solr/search/fieldcollapse/collector/aggregate/MinFunction.java
          patching file src/java/org/apache/solr/search/fieldcollapse/collector/aggregate/SumFunction.java
          patching file src/java/org/apache/solr/search/fieldcollapse/collector/aggregate/MaxFunction.java
          patching file src/java/org/apache/solr/search/fieldcollapse/collector/aggregate/AggregateFunction.java
          patching file src/java/org/apache/solr/search/fieldcollapse/collector/CollapseContext.java
          patching file src/java/org/apache/solr/search/fieldcollapse/collector/DocumentFieldsCollapseCollectorFactory.java
          patching file src/java/org/apache/solr/search/fieldcollapse/collector/AggregateCollapseCollectorFactory.java
          patching file src/java/org/apache/solr/search/fieldcollapse/collector/CollapseCollector.java
          patching file src/java/org/apache/solr/search/fieldcollapse/collector/FieldValueCountCollapseCollectorFactory.java
          patching file src/java/org/apache/solr/search/fieldcollapse/collector/AbstractCollapseCollector.java
          patching file src/java/org/apache/solr/search/fieldcollapse/AbstractDocumentCollapser.java
          patching file src/java/org/apache/solr/search/fieldcollapse/NonAdjacentDocumentCollapser.java
          patching file src/java/org/apache/solr/search/fieldcollapse/AdjacentDocumentCollapser.java
          patching file src/java/org/apache/solr/search/fieldcollapse/util/Counter.java
          patching file src/java/org/apache/solr/search/SolrIndexSearcher.java
          patching file src/java/org/apache/solr/search/DocSetHitCollector.java
          patching file src/java/org/apache/solr/handler/component/CollapseComponent.java
          patching file src/java/org/apache/solr/handler/component/QueryComponent.java
          Hunk #5 succeeded at 521 with fuzz 2.
          Hunk #6 succeeded at 562 (offset -5 lines).
          patching file src/java/org/apache/solr/util/DocSetScoreCollector.java
          patching file src/common/org/apache/solr/common/params/CollapseParams.java
          patching file src/solrj/org/apache/solr/client/solrj/SolrQuery.java
          Hunk #1 FAILED at 17.
          Hunk #2 FAILED at 50.
          Hunk #3 FAILED at 76.
          Hunk #4 FAILED at 148.
          Hunk #5 FAILED at 197.
          Hunk #6 succeeded at 510 (offset -155 lines).
          Hunk #7 succeeded at 566 (offset -155 lines).
          5 out of 7 hunks FAILED -- saving rejects to file src/solrj/org/apache/solr/client/solrj/SolrQuery.java.rej
          patching file src/solrj/org/apache/solr/client/solrj/response/QueryResponse.java
          Hunk #1 FAILED at 47.
          Hunk #2 FAILED at 63.
          Hunk #3 succeeded at 122 with fuzz 2 (offset -8 lines).
          Hunk #4 succeeded at 320 with fuzz 2 (offset 17 lines).
          2 out of 4 hunks FAILED -- saving rejects to file src/solrj/org/apache/solr/client/solrj/response/QueryResponse.java.rej
          patching file src/solrj/org/apache/solr/client/solrj/response/FieldCollapseResponse.java

          and in src/solrj/org/apache/solr/client/solrj/SolrQuery.java.rej

          ***************
          *** 17,28 ****
            
            package org.apache.solr.client.solrj;
            
          - import org.apache.solr.common.params.CommonParams;
          - import org.apache.solr.common.params.FacetParams;
          - import org.apache.solr.common.params.HighlightParams;
          - import org.apache.solr.common.params.ModifiableSolrParams;
          - import org.apache.solr.common.params.StatsParams;
          - import org.apache.solr.common.params.TermsParams;
            
            import java.util.regex.Pattern;
            
          --- 17,23 ----
            
            package org.apache.solr.client.solrj;
            
          + import org.apache.solr.common.params.*;
            
            import java.util.regex.Pattern;
            
          ***************
          *** 55,62 ****
                this.set(CommonParams.Q, q);
              }
            
          - /** enable/disable terms.
          - *
               * @param b flag to indicate terms should be enabled. <br /> if b==false, removes all other terms parameters
               * @return Current reference (<i>this</i>)
               */
          --- 50,57 ----
                this.set(CommonParams.Q, q);
              }
            
          + /** enable/disable terms.
          + *
               * @param b flag to indicate terms should be enabled. <br /> if b==false, removes all other terms parameters
               * @return Current reference (<i>this</i>)
               */
          ***************
          *** 81,150 ****
                }
                return this;
              }
          -
              public boolean getTerms() {
                return this.getBool(TermsParams.TERMS, false);
              }
          -
              public SolrQuery addTermsField(String field) {
                this.add(TermsParams.TERMS_FIELD, field);
                return this;
              }
          -
              public String[] getTermsFields() {
                return this.getParams(TermsParams.TERMS_FIELD);
              }
          -
              public SolrQuery setTermsLower(String lower) {
                this.set(TermsParams.TERMS_LOWER, lower);
                return this;
              }
          -
              public String getTermsLower() {
                return this.get(TermsParams.TERMS_LOWER, "");
              }
          -
              public SolrQuery setTermsUpper(String upper) {
                this.set(TermsParams.TERMS_UPPER, upper);
                return this;
              }
          -
              public String getTermsUpper() {
                return this.get(TermsParams.TERMS_UPPER, "");
              }
          -
              public SolrQuery setTermsUpperInclusive(boolean b) {
                this.set(TermsParams.TERMS_UPPER_INCLUSIVE, b);
                return this;
              }
          -
              public boolean getTermsUpperInclusive() {
                return this.getBool(TermsParams.TERMS_UPPER_INCLUSIVE, false);
              }
          -
              public SolrQuery setTermsLowerInclusive(boolean b) {
                this.set(TermsParams.TERMS_LOWER_INCLUSIVE, b);
                return this;
              }
          -
              public boolean getTermsLowerInclusive() {
                return this.getBool(TermsParams.TERMS_LOWER_INCLUSIVE, true);
              }
          -
              public SolrQuery setTermsLimit(int limit) {
                this.set(TermsParams.TERMS_LIMIT, limit);
                return this;
              }
          -
              public int getTermsLimit() {
                return this.getInt(TermsParams.TERMS_LIMIT, 10);
              }
          -
              public SolrQuery setTermsMinCount(int cnt) {
                this.set(TermsParams.TERMS_MINCOUNT, cnt);
                return this;
              }
          -
              public int getTermsMinCount() {
                return this.getInt(TermsParams.TERMS_MINCOUNT, 1);
              }
          --- 76,145 ----
                }
                return this;
              }
          +
              public boolean getTerms() {
                return this.getBool(TermsParams.TERMS, false);
              }
          +
              public SolrQuery addTermsField(String field) {
                this.add(TermsParams.TERMS_FIELD, field);
                return this;
              }
          +
              public String[] getTermsFields() {
                return this.getParams(TermsParams.TERMS_FIELD);
              }
          +
              public SolrQuery setTermsLower(String lower) {
                this.set(TermsParams.TERMS_LOWER, lower);
                return this;
              }
          +
              public String getTermsLower() {
                return this.get(TermsParams.TERMS_LOWER, "");
              }
          +
              public SolrQuery setTermsUpper(String upper) {
                this.set(TermsParams.TERMS_UPPER, upper);
                return this;
              }
          +
              public String getTermsUpper() {
                return this.get(TermsParams.TERMS_UPPER, "");
              }
          +
              public SolrQuery setTermsUpperInclusive(boolean b) {
                this.set(TermsParams.TERMS_UPPER_INCLUSIVE, b);
                return this;
              }
          +
              public boolean getTermsUpperInclusive() {
                return this.getBool(TermsParams.TERMS_UPPER_INCLUSIVE, false);
              }
          +
              public SolrQuery setTermsLowerInclusive(boolean b) {
                this.set(TermsParams.TERMS_LOWER_INCLUSIVE, b);
                return this;
              }
          +
              public boolean getTermsLowerInclusive() {
                return this.getBool(TermsParams.TERMS_LOWER_INCLUSIVE, true);
              }
          +
              public SolrQuery setTermsLimit(int limit) {
                this.set(TermsParams.TERMS_LIMIT, limit);
                return this;
              }
          +
              public int getTermsLimit() {
                return this.getInt(TermsParams.TERMS_LIMIT, 10);
              }
          +
              public SolrQuery setTermsMinCount(int cnt) {
                this.set(TermsParams.TERMS_MINCOUNT, cnt);
                return this;
              }
          +
              public int getTermsMinCount() {
                return this.getInt(TermsParams.TERMS_MINCOUNT, 1);
              }
          ***************
          *** 153,186 ****
                this.set(TermsParams.TERMS_MAXCOUNT, cnt);
                return this;
              }
          -
              public int getTermsMaxCount() {
                return this.getInt(TermsParams.TERMS_MAXCOUNT, -1);
              }
          -
              public SolrQuery setTermsPrefix(String prefix) {
                this.set(TermsParams.TERMS_PREFIX_STR, prefix);
                return this;
              }
          -
              public String getTermsPrefix() {
                return this.get(TermsParams.TERMS_PREFIX_STR, "");
              }
          -
              public SolrQuery setTermsRaw(boolean b) {
                this.set(TermsParams.TERMS_RAW, b);
                return this;
              }
          -
              public boolean getTermsRaw() {
                return this.getBool(TermsParams.TERMS_RAW, false);
              }
          -
              public SolrQuery setTermsSortString(String type) {
                this.set(TermsParams.TERMS_SORT, type);
                return this;
              }
          -
              public String getTermsSortString() {
                return this.get(TermsParams.TERMS_SORT, TermsParams.TERMS_SORT_COUNT);
              }
          --- 148,181 ----
                this.set(TermsParams.TERMS_MAXCOUNT, cnt);
                return this;
              }
          +
              public int getTermsMaxCount() {
                return this.getInt(TermsParams.TERMS_MAXCOUNT, -1);
              }
          +
              public SolrQuery setTermsPrefix(String prefix) {
                this.set(TermsParams.TERMS_PREFIX_STR, prefix);
                return this;
              }
          +
              public String getTermsPrefix() {
                return this.get(TermsParams.TERMS_PREFIX_STR, "");
              }
          +
              public SolrQuery setTermsRaw(boolean b) {
                this.set(TermsParams.TERMS_RAW, b);
                return this;
              }
          +
              public boolean getTermsRaw() {
                return this.getBool(TermsParams.TERMS_RAW, false);
              }
          +
              public SolrQuery setTermsSortString(String type) {
                this.set(TermsParams.TERMS_SORT, type);
                return this;
              }
          +
              public String getTermsSortString() {
                return this.get(TermsParams.TERMS_SORT, TermsParams.TERMS_SORT_COUNT);
              }
          ***************
          *** 202,208 ****
              public String[] getTermsRegexFlags() {
                return this.getParams(TermsParams.TERMS_REGEXP_FLAG);
              }
          -
              /** Add field(s) for facet computation.
               *
               * @param fields Array of field names from the IndexSchema
          --- 197,203 ----
              public String[] getTermsRegexFlags() {
                return this.getParams(TermsParams.TERMS_REGEXP_FLAG);
              }
          +
              /** Add field(s) for facet computation.
               *
               * @param fields Array of field names from the IndexSchema



          in src/solrj/org/apache/solr/client/solrj/response/QueryResponse.java.rej:

          ***************
          *** 47,52 ****
              private NamedList<Object> _spellInfo = null;
              private NamedList<Object> _statsInfo = null;
              private NamedList<Object> _termsInfo = null;
            
              // Facet stuff
              private Map<String,Integer> _facetQuery = null;
          --- 47,53 ----
              private NamedList<Object> _spellInfo = null;
              private NamedList<Object> _statsInfo = null;
              private NamedList<Object> _termsInfo = null;
          + private NamedList<Object> _collapseInfo = null;
            
              // Facet stuff
              private Map<String,Integer> _facetQuery = null;
          ***************
          *** 62,68 ****
            
              // Terms Response
              private TermsResponse _termsResponse = null;
          -
              // Field stats Response
              private Map<String,FieldStatsInfo> _fieldStatsInfo = null;
              
          --- 63,72 ----
            
              // Terms Response
              private TermsResponse _termsResponse = null;
          +
          + // Field collapse response
          + private FieldCollapseResponse _fieldCollapseResponse = null;
          +
              // Field stats Response
              private Map<String,FieldStatsInfo> _fieldStatsInfo = null;
              

          ]
          Martijn van Groningen made changes -
          Attachment SOLR-236.patch [ 12428818 ]
          Shalin Shekhar Mangar made changes -
          Attachment SOLR-236.patch [ 12428902 ]
          Martijn van Groningen made changes -
          Attachment SOLR-236.patch [ 12430926 ]
          Martijn van Groningen made changes -
          Attachment SOLR-236.patch [ 12434435 ]
          Otis Gospodnetic made changes -
          Link This issue is related to SOLR-1682 [ SOLR-1682 ]
          Otis Gospodnetic made changes -
          Link This issue is related to SOLR-1773 [ SOLR-1773 ]
          steevensz made changes -
          Comment [ I applied this patch to the nightlybuild of feb 22 and this compiles without any problem.

          I can start Solr and it runs fine. But when i add the Field Collapse in the solrconfig.xml i cannot start Solr anymore.

          After adding this line to my solrconfig.xml:

          <searchComponent name="query"
                    class="org.apache.solr.handler.component.CollapseComponent" />


          I get this error when i run Solr:

          2010-02-22 22:24:30.722::WARN: Failed startup of context org.mortbay.jetty.webapp.WebAppContext@7f5580{/solr,jar:file:/opt/apache-solr-1.5-dev/example/webapps/solr.war!/}
          java.lang.NullPointerException
                  at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:593)
                  at org.mortbay.jetty.servlet.Context.startContext(Context.java:139)
                  at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1218)
                  at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:500)
                  at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)
                  at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
                  at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:147)
                  at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:161)
                  at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
                  at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:147)
                  at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
                  at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
                  at org.mortbay.jetty.Server.doStart(Server.java:210)
                  at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
                  at org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:929)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                  at java.lang.reflect.Method.invoke(Unknown Source)
                  at org.mortbay.start.Main.invokeMain(Main.java:183)
                  at org.mortbay.start.Main.start(Main.java:497)
                  at org.mortbay.start.Main.main(Main.java:115)

          (I am using Centos with Java 1.6.0_13)

          Any help is greatly appreciated!!
          ]
          Peter Karich made changes -
          Attachment DocSetScoreCollector.java [ 12437980 ]
          Attachment NonAdjacentDocumentCollapser.java [ 12437981 ]
          Attachment NonAdjacentDocumentCollapserTest.java [ 12437982 ]
          Martijn van Groningen made changes -
          Attachment SOLR-236-trunk.patch [ 12440022 ]
          Martijn van Groningen made changes -
          Attachment SOLR-236-trunk.patch [ 12440108 ]
          Martijn van Groningen made changes -
          Attachment SOLR-236-trunk.patch [ 12444531 ]
          Martijn van Groningen made changes -
          Attachment SOLR-236-trunk.patch [ 12444611 ]
          Hoss Man made changes -
          Fix Version/s Next [ 12315093 ]
          Fix Version/s 1.5 [ 12313566 ]
          Martijn van Groningen made changes -
          Attachment SOLR-236-trunk.patch [ 12447374 ]
          Martijn van Groningen made changes -
          Attachment SOLR-236-1_4_1.patch [ 12448216 ]
          Yonik Seeley made changes -
          Attachment SOLR-236.patch [ 12458675 ]
          Stephen Weiss made changes -
          Bill Bell made changes -
          Attachment SOLR-236-distinctFacet.patch [ 12459815 ]
          Bill Bell made changes -
          Link This issue is related to SOLR-2242 [ SOLR-2242 ]
          Bill Bell made changes -
          Link This issue depends on SOLR-2246 [ SOLR-2246 ]
          Cameron made changes -
          Attachment SOLR-236-1_4_1-NPEfix.patch [ 12470202 ]
          Doug Steigerwald made changes -
          Attachment SOLR-236-branch_3x.patch [ 12471418 ]
          motto made changes -
          Comment [ Am I right that trunk is 4.0? What is the newest patch that works on that code? All patches I tried so far failed for me.
          Also, would someone we able to share a solr.WAR file that is already patched and fairly up-to-date?

          Thanks ]
          Hoss Man made changes -
          Fix Version/s 3.2 [ 12316172 ]
          Fix Version/s Next [ 12315093 ]
          Robert Muir made changes -
          Fix Version/s 3.3 [ 12316471 ]
          Fix Version/s 3.2 [ 12316172 ]
          Michael McCandless made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Duplicate [ 3 ]
          Robert Muir made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Gavin made changes -
          Link This issue depends on SOLR-281 [ SOLR-281 ]
          Gavin made changes -
          Link This issue depends upon SOLR-281 [ SOLR-281 ]
          Gavin made changes -
          Link This issue depends on SOLR-2246 [ SOLR-2246 ]
          Gavin made changes -
          Link This issue depends upon SOLR-2246 [ SOLR-2246 ]

            People

            • Assignee:
              Shalin Shekhar Mangar
              Reporter:
              Emmanuel Keller
            • Votes:
              76 Vote for this issue
              Watchers:
              77 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development