SOLR-951 -- Fixed bug in FacetComponent's refinement query generation for local params

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@733656 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shalin Shekhar Mangar 2009-01-12 09:09:20 +00:00
parent ea3fc08edb
commit fd7db7e72e
3 changed files with 13 additions and 2 deletions

View File

@ -106,7 +106,7 @@ public class FacetComponent extends SearchComponent
// add terms into the original facet.field command
// do it via parameter reference to avoid another layer of encoding.
if (dff.localParams != null) {
facetCommand = commandPrefix+termsKey+dff.facetStr.substring(2);
facetCommand = commandPrefix+termsKey + " " + dff.facetStr.substring(2);
} else {
facetCommand = commandPrefix+termsKey+'}'+dff.field;
}

View File

@ -480,6 +480,14 @@ public class TestDistributedSearch extends TestCase {
index(id,12, i1, 379 ,t1,"Great works are performed, not by strength, but by perseverance.");
index(id,13, i1, 232 ,t1,"no eggs on wall, lesson learned", oddField, "odd man out");
index(id, 14, "SubjectTerms_mfacet", new String[] {"mathematical models", "mathematical analysis"});
index(id, 15, "SubjectTerms_mfacet", new String[] {"test 1", "test 2", "test3"});
index(id, 16, "SubjectTerms_mfacet", new String[] {"test 1", "test 2", "test3"});
String[] vals = new String[100];
for (int i=0; i<100; i++) {
vals[i] = "test " + i;
}
index(id, 17, "SubjectTerms_mfacet", vals);
commit();
handle.clear();
@ -551,6 +559,7 @@ public class TestDistributedSearch extends TestCase {
,"facet.field",t1
,"fq","{!tag=a}id:[1 TO 7]", "fq","{!tag=b}id:[3 TO 9]"
);
query("q", "*:*", "facet", "true", "facet.field", "{!ex=t1}SubjectTerms_mfacet", "fq", "{!tag=t1}SubjectTerms_mfacet:(test 1)", "facet.limit", "10", "facet.mincount", "1");
// test field that is valid in schema but missing in all shards
query("q","*:*", "rows",100, "facet","true", "facet.field",missingField, "facet.mincount",2);

View File

@ -455,7 +455,7 @@
<dynamicField name="t_*" type="text" indexed="true" stored="true"/>
<dynamicField name="tv_*" type="text" indexed="true" stored="true"
termVectors="true" termPositions="true" termOffsets="true"/>
<dynamicField name="tv_mv_*" type="text" indexed="true" stored="true" multivalued="true"
<dynamicField name="tv_mv_*" type="text" indexed="true" stored="true" multiValued="true"
termVectors="true" termPositions="true" termOffsets="true"/>
<!-- special fields for dynamic copyField test -->
@ -469,6 +469,8 @@
<!-- ignored becuase not stored or indexed -->
<dynamicField name="*_ignored" type="text" indexed="false" stored="false"/>
<dynamicField name="*_mfacet" type="string" indexed="true" stored="false" multiValued="true" />
</fields>
<defaultSearchField>text</defaultSearchField>