Ahmet Arslan wrote:
> 
> 
> 
> 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);
>   }
> 

This actually worked well. I may go down this path unless we find a solution
to the synonym issue.

Thanks!

-- 
View this message in context: 
http://old.nabble.com/Expanding-synonyms-for-both-facets-and-response-results-tp26912229p26919430.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to