> > <result name="response" numFound="2" start="0">
> > 
> >     <doc>
> >         <str
> name="apt_type_en">One Bedroom Apartment</str>
> >     </doc>
> > 
> >     <doc>
> >         <str
> name="apt_type_en">One Bedroom Apartment</str>
> >     </doc>
> > </result>
> > 
> > <lst name="facet_counts">
> >     <lst name="facet_queries" />
> > 
> >     <lst name="facet_fields">
> > 
> >         <lst
> name="apt_type_en">
> >        
>     <int name="One Bedroom
> Apartment">2</int>
> >         </lst>
> >     </lst>
> >     <lst name="facet_dates" />
> > </lst>
> > 


I think you are populating apt_type_en, apt_type_fr and apt_type_it fields from 
apt_type via copyField decleration in schema.xml. Maybe in your case it is more 
convenient to populate those field in an UpdateRequestProcessor and remove 
copyField declerations. type="string" will be enough for those fields. No more 
synonym entries. By doing this both facets and response results will return 
language specific strings (not integer values). But note that you cannot query 
apt_type_en:100 anymore. It is the same as posting/adding "One Bedroom 
Apartment" value for field apt_type_en when apt_type=100.


http://wiki.apache.org/solr/UpdateRequestProcessor

public void processAdd(AddUpdateCommand cmd) throws IOException {
    SolrInputDocument doc = cmd.getSolrInputDocument();
    
    Object v = doc.getFieldValue( "apt_type" );
    if( v != null ) {
      int apt_type= Integer.parseInt( v.toString() );
      if( pop == 100 ) {
        doc.addField( "apt_type_en", "One Bedroom Apartment" );
        doc.addField( "apt_type_fr", "...." );
        doc.addField( "apt_type_it", "...." );
      }else if( pop == 200 ) {
        doc.addField( "apt_type_en", "...." );
        doc.addField( "apt_type_fr", "...." );
        doc.addField( "apt_type_it", "...." );
      }
    }
    
    // pass it up the chain
    super.processAdd(cmd);
  }



Reply via email to