lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ttdi (JIRA)" <j...@apache.org>
Subject [jira] Commented: (SOLR-236) Field collapsing
Date Sat, 19 Dec 2009 07:09:18 GMT

    [ https://issues.apache.org/jira/browse/SOLR-236?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12792803#action_12792803
] 

ttdi commented on SOLR-236:
---------------------------

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;
    



> Field collapsing
> ----------------
>
>                 Key: SOLR-236
>                 URL: https://issues.apache.org/jira/browse/SOLR-236
>             Project: Solr
>          Issue Type: New Feature
>          Components: search
>    Affects Versions: 1.3
>            Reporter: Emmanuel Keller
>            Assignee: Shalin Shekhar Mangar
>             Fix For: 1.5
>
>         Attachments: collapsing-patch-to-1.3.0-dieter.patch, collapsing-patch-to-1.3.0-ivan.patch,
collapsing-patch-to-1.3.0-ivan_2.patch, collapsing-patch-to-1.3.0-ivan_3.patch, field-collapse-3.patch,
field-collapse-4-with-solrj.patch, field-collapse-5.patch, field-collapse-5.patch, field-collapse-5.patch,
field-collapse-5.patch, field-collapse-5.patch, field-collapse-5.patch, field-collapse-5.patch,
field-collapse-5.patch, field-collapse-5.patch, field-collapse-5.patch, field-collapse-5.patch,
field-collapse-5.patch, field-collapse-5.patch, field-collapse-5.patch, field-collapse-5.patch,
field-collapse-solr-236-2.patch, field-collapse-solr-236.patch, field-collapsing-extended-592129.patch,
field_collapsing_1.1.0.patch, field_collapsing_1.3.patch, field_collapsing_dsteigerwald.diff,
field_collapsing_dsteigerwald.diff, field_collapsing_dsteigerwald.diff, quasidistributed.additional.patch,
SOLR-236-FieldCollapsing.patch, SOLR-236-FieldCollapsing.patch, SOLR-236-FieldCollapsing.patch,
SOLR-236.patch, SOLR-236.patch, SOLR-236.patch, solr-236.patch, SOLR-236_collapsing.patch,
SOLR-236_collapsing.patch
>
>
> 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 ;-)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message