lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zhang, Lisheng" <Lisheng.Zh...@BroadVision.com>
Subject RE: Solr language-dependent sort
Date Mon, 08 Apr 2013 20:36:27 GMT
Hi,

Thanks very much for quick help!

In our case we mainly need to sort a field based on language defined at run time,
but I understood that the principle is the same.

Thanks and best regards, Lisheng

-----Original Message-----
From: Sujit Pal [mailto:sujitatgtalk@gmail.com]On Behalf Of SUJIT PAL
Sent: Monday, April 08, 2013 1:27 PM
To: solr-user@lucene.apache.org
Subject: Re: Solr language-dependent sort


Hi Lisheng,

We did something similar in Solr using a custom handler (but I think you could just build
a custom QeryParser to do this), but you could do this in your application as well, ie, get
the language and then rewrite your query to use the language specific fields. Come to think
of it, the QueryParser would probably be sufficiently general to qualify as a patch for custom
functionality.

-sujit

On Apr 8, 2013, at 12:28 PM, Zhang, Lisheng wrote:

> 
> Hi,
> 
> I found that in solr we need to define a special fieldType for each
> language (http://wiki.apache.org/solr/UnicodeCollation), then point
> a field to this type.
> 
> But in our application one field (like 'title') can be used by various
> users for their languages (user1 used for English, user2 used it for
> Japanese ..), so it is even difficult for us to use dynamical field,
> we would prefer to pass in a parameter like 
> 
> language = 'en'
> 
> at run time, then solr API may use this parameter to call lucene API
> to sort a field. This approach would be much more flexible (we programmed
> this way when using lucene directly)?
> 
> Thanks very much for helps, Lisheng


Mime
View raw message