e commerce - Facet query will give wrong output on dynamicfield in solr -
i have dynamicfield 'pa_mydynamicfieldname' in solr 4.0
i have store value in field :
i have indexed data encoding using system.web.httputility.urlencode(pa_mydynamicfieldname) such : 2.2+ghz+intel+pentium+dual-core+e2200
when apply facet query result output :
<lst name="facet_fields"> <lst name="pa_mydynamicfieldname"> <int name="2.2">1</int> <int name="2.5">1</int> <int name="core">1</int> <int name="dual">1</int> <int name="e2200">1</int> <int name="ghz">1</int> <int name="intel">1</int> <int name="pentium">1</int> </lst>
instead of want output :
<lst name="facet_fields"> <lst name="pa_mydynamicfieldname"> <int name="2.2+ghz+intel+pentium+dual-core+e2200">1</int> </lst>
how can in solr while applying facet query ?
updated on 15-may-13
from schema, text field defined as:
<fieldtype name="text" class="solr.textfield" positionincrementgap="100">
and dynamic field defined as:
<dynamicfield name="pa_*" type="text" indexed="true" stored="true" multivalued="true" required="false" />
we need multi-valued field, because document may have multiple value defined each product.
please me.
thanks
in order accomplish behavior desiring, need change fieldtype dynamic field in schema.xml. currently, pa_mydyanmicfieldname
defined type="text_general"
, multivalued="true"
. field value being split tokens , these tokens being stored multiple values. producing behavior show multiple words/tokens being returned facet values.
since want store original value submit it, please change fieldtype plain old string , not multivalued:
<dynamicfield name="*_mydynamicfeldname" type="string" indexed="true" stored="true"/>
or can alternately take advantage of predefined string based dynamic field defined in example schema.xml:
<dynamicfield name="*_s" type="string" indexed="true" stored="true" />
you need reindex data after making change schema.xml new field types stored , reflected in search results.
Comments
Post a Comment