Re: Customizing results
revas schrieb: What is GNU gettext and how this can be used in a multilanguage scenario? It'a an internationalization technology, so it is well suited to the tasks of internationalizing and localizing applications. http://www.gnu.org/software/gettext/manual/ http://www.gnu.org/software/gettext/manual/html_node/Why.html In your case, it might mean that the client is equipped with the language packages it needs and uses the name returned by Solr (likely the English term) to look up the translation by means of Gettext. But it certainly depends very much on your particular setup. It might be overkill for your particular situation. Michael Ludwig
Re: Customizing results
Manepalli, Kalyan schrieb: Hi, I am trying to customize the response that I receive from Solr. In the index I have multiple fields that contain the same data in different language. At the query time client specifies the language. Based on this param, I want to return the value, copied into a different field. Eg: str name=location_da_dkLubang, Filippinerne/str str name=location_de_deLubang, Philippinen/str str name=location_en_usLubang, Philippines/str str name=location_es_esLubang, Filipinas/str If the user specifies language as de_de, then I want to return the result as str name=locationLubang, Philippinen/str If you control how the client works, you could also consider using an internationalization technology such as GNU Gettext for this purpose. May or may not make sense in your particular situation. Michael Ludwig
Re: Customizing results
Hi Michael, What is GNU gettext and how this can be used in a multilanguage scenario? Regards Revas On Wed, Jun 10, 2009 at 8:10 PM, Michael Ludwig m...@as-guides.com wrote: Manepalli, Kalyan schrieb: Hi, I am trying to customize the response that I receive from Solr. In the index I have multiple fields that contain the same data in different language. At the query time client specifies the language. Based on this param, I want to return the value, copied into a different field. Eg: str name=location_da_dkLubang, Filippinerne/str str name=location_de_deLubang, Philippinen/str str name=location_en_usLubang, Philippines/str str name=location_es_esLubang, Filipinas/str If the user specifies language as de_de, then I want to return the result as str name=locationLubang, Philippinen/str If you control how the client works, you could also consider using an internationalization technology such as GNU Gettext for this purpose. May or may not make sense in your particular situation. Michael Ludwig
Re: Customizing results
On Sat, Jun 6, 2009 at 2:35 AM, Manepalli, Kalyankalyan.manepa...@orbitz.com wrote: Otis, I like the idea of using the as field parameter. As per your earlier comments, I implemented this by modifying the JsonResponseWriter by substituting the actual fieldname by the alias passed as part of request Parameter. The stored fields come into picture only in the response writer . So that is the place where we can implement this I think the actual implementation would be at a much higher level than the response writer. Thanks, Kalyan Manepalli -Original Message- From: Otis Gospodnetic [mailto:otis_gospodne...@yahoo.com] Sent: Friday, June 05, 2009 9:11 AM To: solr-user@lucene.apache.org Subject: Re: Customizing results Funny, I was just thinking about field aliases the other day. I personally never needed then, but I can see how they could be handy for both searching and writing out the response. On the other hand, isn't this fairly easy to implement with a field2field mapping in the search app itself? Otis -- Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch - Original Message From: Fergus McMenemie fer...@twig.me.uk To: solr-user@lucene.apache.org Sent: Friday, June 5, 2009 2:53:38 AM Subject: Re: Customizing results Generally a good idea, but be prepared to entertain requests that should also ask you to be able to perform the query using those aliases. I mean when you talk about something similar to aliases in SQL, those aliases can be used in SQL scripts in the where clause too. Cheers Avlesh I am using shards to provide access to several underlying indexes which have drastically different schema. Each different shard has its own dedicated search application built around it. However I also want to implement a global search that performs a more limited but general purpose search across all shards. I find I am doing lots of copyfields to get a set of fields that can be used for the general purpose search, I feel sure that this is redundant and that an aliasfields feature would be very useful. For example one index has a title field another has a subject field a third has a placename field. My general purpose or global search treats these as as title. An aliasfields feature would be more efficient and cleaner than using copyfields. Fergus. 2009/6/5 Noble Paul ?? 青�ヒウヒ Hi Otis, is it a good idea to provide as aliasing feature for Solr similar to the SQL 'as' in SQL we can do select location_da_dk as location Solr may have fl.alias=location_da_dk:location --Noble On Fri, Jun 5, 2009 at 3:10 AM, Otis Gospodnetic wrote: Aha, so you really want to rename the field at response time? I wonder if this is something that could be done with (or should be added to) response writers. That's where I'd go look first. Otis -- Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch - Original Message From: Manepalli, Kalyan To: solr-user@lucene.apache.org Sent: Thursday, June 4, 2009 5:30:40 PM Subject: RE: Customizing results Otis, With that solution, the client has to accept all type location fields (location_de_de, location_it_it). I want to copy the result into location field, so that client can just accept location. Thanks, Kalyan Manepalli -Original Message- From: Otis Gospodnetic [mailto:otis_gospodne...@yahoo.com] Sent: Thursday, June 04, 2009 4:16 PM To: solr-user@lucene.apache.org Subject: Re: Customizing results Hello, If you know what language the user specified (or is associated with), then you just have to ensure the fl URL parameter contain that field (and any other fields you want returned). So if the language/locale is de_de, then make sure the request has fl=location_de_de,another_field,another_field, and not, for example location_it_it Otis -- Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch - Original Message From: Manepalli, Kalyan To: solr-user@lucene.apache.org Sent: Thursday, June 4, 2009 12:36:30 PM Subject: Customizing results Hi, I am trying to customize the response that I receive from Solr. In the index I have multiple fields that contain the same data in different language. At the query time client specifies the language. Based on this param, I want to return the value, copied into a different field. Eg: Lubang, Filippinerne Lubang, Philippinen Lubang, Philippines Lubang, Filipinas If the user specifies language as de_de, then I want to return the result as Lubang, Philippinen What is the most optimal way of doing this? Any suggestions on this will be helpful Thanks, Kalyan Manepalli
Re: Customizing results
Generally a good idea, but be prepared to entertain requests that should also ask you to be able to perform the query using those aliases. I mean when you talk about something similar to aliases in SQL, those aliases can be used in SQL scripts in the where clause too. Cheers Avlesh I am using shards to provide access to several underlying indexes which have drastically different schema. Each different shard has its own dedicated search application built around it. However I also want to implement a global search that performs a more limited but general purpose search across all shards. I find I am doing lots of copyfields to get a set of fields that can be used for the general purpose search, I feel sure that this is redundant and that an aliasfields feature would be very useful. For example one index has a title field another has a subject field a third has a placename field. My general purpose or global search treats these as as title. An aliasfields feature would be more efficient and cleaner than using copyfields. Fergus. 2009/6/5 Noble Paul ?? Â Ë³Ë noble.p...@corp.aol.com Hi Otis, is it a good idea to provide as aliasing feature for Solr similar to the SQL 'as' in SQL we can do select location_da_dk as location Solr may have fl.alias=location_da_dk:location --Noble On Fri, Jun 5, 2009 at 3:10 AM, Otis Gospodnetic otis_gospodne...@yahoo.com wrote: Aha, so you really want to rename the field at response time? I wonder if this is something that could be done with (or should be added to) response writers. That's where I'd go look first. Otis -- Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch - Original Message From: Manepalli, Kalyan kalyan.manepa...@orbitz.com To: solr-user@lucene.apache.org solr-user@lucene.apache.org Sent: Thursday, June 4, 2009 5:30:40 PM Subject: RE: Customizing results Otis, With that solution, the client has to accept all type location fields (location_de_de, location_it_it). I want to copy the result into location field, so that client can just accept location. Thanks, Kalyan Manepalli -Original Message- From: Otis Gospodnetic [mailto:otis_gospodne...@yahoo.com] Sent: Thursday, June 04, 2009 4:16 PM To: solr-user@lucene.apache.org Subject: Re: Customizing results Hello, If you know what language the user specified (or is associated with), then you just have to ensure the fl URL parameter contain that field (and any other fields you want returned). So if the language/locale is de_de, then make sure the request has fl=location_de_de,another_field,another_field, and not, for example location_it_it Otis -- Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch - Original Message From: Manepalli, Kalyan To: solr-user@lucene.apache.org Sent: Thursday, June 4, 2009 12:36:30 PM Subject: Customizing results Hi, I am trying to customize the response that I receive from Solr. In the index I have multiple fields that contain the same data in different language. At the query time client specifies the language. Based on this param, I want to return the value, copied into a different field. Eg: Lubang, Filippinerne Lubang, Philippinen Lubang, Philippines Lubang, Filipinas If the user specifies language as de_de, then I want to return the result as Lubang, Philippinen What is the most optimal way of doing this? Any suggestions on this will be helpful Thanks, Kalyan Manepalli -- - Noble Paul | Principal Engineer| AOL | http://aol.com
Re: Customizing results
I have opened an issue https://issues.apache.org/jira/browse/SOLR-1205 On Fri, Jun 5, 2009 at 12:23 PM, Fergus McMenemie fer...@twig.me.uk wrote: Generally a good idea, but be prepared to entertain requests that should also ask you to be able to perform the query using those aliases. I mean when you talk about something similar to aliases in SQL, those aliases can be used in SQL scripts in the where clause too. Cheers Avlesh I am using shards to provide access to several underlying indexes which have drastically different schema. Each different shard has its own dedicated search application built around it. However I also want to implement a global search that performs a more limited but general purpose search across all shards. I find I am doing lots of copyfields to get a set of fields that can be used for the general purpose search, I feel sure that this is redundant and that an aliasfields feature would be very useful. For example one index has a title field another has a subject field a third has a placename field. My general purpose or global search treats these as as title. An aliasfields feature would be more efficient and cleaner than using copyfields. Fergus. 2009/6/5 Noble Paul ?? Â Ë³Ë noble.p...@corp.aol.com Hi Otis, is it a good idea to provide as aliasing feature for Solr similar to the SQL 'as' in SQL we can do select location_da_dk as location Solr may have fl.alias=location_da_dk:location --Noble On Fri, Jun 5, 2009 at 3:10 AM, Otis Gospodnetic otis_gospodne...@yahoo.com wrote: Aha, so you really want to rename the field at response time? I wonder if this is something that could be done with (or should be added to) response writers. That's where I'd go look first. Otis -- Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch - Original Message From: Manepalli, Kalyan kalyan.manepa...@orbitz.com To: solr-user@lucene.apache.org solr-user@lucene.apache.org Sent: Thursday, June 4, 2009 5:30:40 PM Subject: RE: Customizing results Otis, With that solution, the client has to accept all type location fields (location_de_de, location_it_it). I want to copy the result into location field, so that client can just accept location. Thanks, Kalyan Manepalli -Original Message- From: Otis Gospodnetic [mailto:otis_gospodne...@yahoo.com] Sent: Thursday, June 04, 2009 4:16 PM To: solr-user@lucene.apache.org Subject: Re: Customizing results Hello, If you know what language the user specified (or is associated with), then you just have to ensure the fl URL parameter contain that field (and any other fields you want returned). So if the language/locale is de_de, then make sure the request has fl=location_de_de,another_field,another_field, and not, for example location_it_it Otis -- Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch - Original Message From: Manepalli, Kalyan To: solr-user@lucene.apache.org Sent: Thursday, June 4, 2009 12:36:30 PM Subject: Customizing results Hi, I am trying to customize the response that I receive from Solr. In the index I have multiple fields that contain the same data in different language. At the query time client specifies the language. Based on this param, I want to return the value, copied into a different field. Eg: Lubang, Filippinerne Lubang, Philippinen Lubang, Philippines Lubang, Filipinas If the user specifies language as de_de, then I want to return the result as Lubang, Philippinen What is the most optimal way of doing this? Any suggestions on this will be helpful Thanks, Kalyan Manepalli -- - Noble Paul | Principal Engineer| AOL | http://aol.com -- - Noble Paul | Principal Engineer| AOL | http://aol.com
Re: Customizing results
Funny, I was just thinking about field aliases the other day. I personally never needed then, but I can see how they could be handy for both searching and writing out the response. On the other hand, isn't this fairly easy to implement with a field2field mapping in the search app itself? Otis -- Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch - Original Message From: Fergus McMenemie fer...@twig.me.uk To: solr-user@lucene.apache.org Sent: Friday, June 5, 2009 2:53:38 AM Subject: Re: Customizing results Generally a good idea, but be prepared to entertain requests that should also ask you to be able to perform the query using those aliases. I mean when you talk about something similar to aliases in SQL, those aliases can be used in SQL scripts in the where clause too. Cheers Avlesh I am using shards to provide access to several underlying indexes which have drastically different schema. Each different shard has its own dedicated search application built around it. However I also want to implement a global search that performs a more limited but general purpose search across all shards. I find I am doing lots of copyfields to get a set of fields that can be used for the general purpose search, I feel sure that this is redundant and that an aliasfields feature would be very useful. For example one index has a title field another has a subject field a third has a placename field. My general purpose or global search treats these as as title. An aliasfields feature would be more efficient and cleaner than using copyfields. Fergus. 2009/6/5 Noble Paul ?? 青�ヒウヒ Hi Otis, is it a good idea to provide as aliasing feature for Solr similar to the SQL 'as' in SQL we can do select location_da_dk as location Solr may have fl.alias=location_da_dk:location --Noble On Fri, Jun 5, 2009 at 3:10 AM, Otis Gospodnetic wrote: Aha, so you really want to rename the field at response time? I wonder if this is something that could be done with (or should be added to) response writers. That's where I'd go look first. Otis -- Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch - Original Message From: Manepalli, Kalyan To: solr-user@lucene.apache.org Sent: Thursday, June 4, 2009 5:30:40 PM Subject: RE: Customizing results Otis, With that solution, the client has to accept all type location fields (location_de_de, location_it_it). I want to copy the result into location field, so that client can just accept location. Thanks, Kalyan Manepalli -Original Message- From: Otis Gospodnetic [mailto:otis_gospodne...@yahoo.com] Sent: Thursday, June 04, 2009 4:16 PM To: solr-user@lucene.apache.org Subject: Re: Customizing results Hello, If you know what language the user specified (or is associated with), then you just have to ensure the fl URL parameter contain that field (and any other fields you want returned). So if the language/locale is de_de, then make sure the request has fl=location_de_de,another_field,another_field, and not, for example location_it_it Otis -- Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch - Original Message From: Manepalli, Kalyan To: solr-user@lucene.apache.org Sent: Thursday, June 4, 2009 12:36:30 PM Subject: Customizing results Hi, I am trying to customize the response that I receive from Solr. In the index I have multiple fields that contain the same data in different language. At the query time client specifies the language. Based on this param, I want to return the value, copied into a different field. Eg: Lubang, Filippinerne Lubang, Philippinen Lubang, Philippines Lubang, Filipinas If the user specifies language as de_de, then I want to return the result as Lubang, Philippinen What is the most optimal way of doing this? Any suggestions on this will be helpful Thanks, Kalyan Manepalli -- - Noble Paul | Principal Engineer| AOL | http://aol.com
RE: Customizing results
Otis, I like the idea of using the as field parameter. As per your earlier comments, I implemented this by modifying the JsonResponseWriter by substituting the actual fieldname by the alias passed as part of request Parameter. I think the actual implementation would be at a much higher level than the response writer. Thanks, Kalyan Manepalli -Original Message- From: Otis Gospodnetic [mailto:otis_gospodne...@yahoo.com] Sent: Friday, June 05, 2009 9:11 AM To: solr-user@lucene.apache.org Subject: Re: Customizing results Funny, I was just thinking about field aliases the other day. I personally never needed then, but I can see how they could be handy for both searching and writing out the response. On the other hand, isn't this fairly easy to implement with a field2field mapping in the search app itself? Otis -- Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch - Original Message From: Fergus McMenemie fer...@twig.me.uk To: solr-user@lucene.apache.org Sent: Friday, June 5, 2009 2:53:38 AM Subject: Re: Customizing results Generally a good idea, but be prepared to entertain requests that should also ask you to be able to perform the query using those aliases. I mean when you talk about something similar to aliases in SQL, those aliases can be used in SQL scripts in the where clause too. Cheers Avlesh I am using shards to provide access to several underlying indexes which have drastically different schema. Each different shard has its own dedicated search application built around it. However I also want to implement a global search that performs a more limited but general purpose search across all shards. I find I am doing lots of copyfields to get a set of fields that can be used for the general purpose search, I feel sure that this is redundant and that an aliasfields feature would be very useful. For example one index has a title field another has a subject field a third has a placename field. My general purpose or global search treats these as as title. An aliasfields feature would be more efficient and cleaner than using copyfields. Fergus. 2009/6/5 Noble Paul ?? 青�ヒウヒ Hi Otis, is it a good idea to provide as aliasing feature for Solr similar to the SQL 'as' in SQL we can do select location_da_dk as location Solr may have fl.alias=location_da_dk:location --Noble On Fri, Jun 5, 2009 at 3:10 AM, Otis Gospodnetic wrote: Aha, so you really want to rename the field at response time? I wonder if this is something that could be done with (or should be added to) response writers. That's where I'd go look first. Otis -- Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch - Original Message From: Manepalli, Kalyan To: solr-user@lucene.apache.org Sent: Thursday, June 4, 2009 5:30:40 PM Subject: RE: Customizing results Otis, With that solution, the client has to accept all type location fields (location_de_de, location_it_it). I want to copy the result into location field, so that client can just accept location. Thanks, Kalyan Manepalli -Original Message- From: Otis Gospodnetic [mailto:otis_gospodne...@yahoo.com] Sent: Thursday, June 04, 2009 4:16 PM To: solr-user@lucene.apache.org Subject: Re: Customizing results Hello, If you know what language the user specified (or is associated with), then you just have to ensure the fl URL parameter contain that field (and any other fields you want returned). So if the language/locale is de_de, then make sure the request has fl=location_de_de,another_field,another_field, and not, for example location_it_it Otis -- Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch - Original Message From: Manepalli, Kalyan To: solr-user@lucene.apache.org Sent: Thursday, June 4, 2009 12:36:30 PM Subject: Customizing results Hi, I am trying to customize the response that I receive from Solr. In the index I have multiple fields that contain the same data in different language. At the query time client specifies the language. Based on this param, I want to return the value, copied into a different field. Eg: Lubang, Filippinerne Lubang, Philippinen Lubang, Philippines Lubang, Filipinas If the user specifies language as de_de, then I want to return the result as Lubang, Philippinen What is the most optimal way of doing this? Any suggestions on this will be helpful Thanks, Kalyan Manepalli -- - Noble Paul | Principal Engineer| AOL | http://aol.com
Re: Customizing results
Hello, If you know what language the user specified (or is associated with), then you just have to ensure the fl URL parameter contain that field (and any other fields you want returned). So if the language/locale is de_de, then make sure the request has fl=location_de_de,another_field,another_field, and not, for example location_it_it Otis -- Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch - Original Message From: Manepalli, Kalyan kalyan.manepa...@orbitz.com To: solr-user@lucene.apache.org solr-user@lucene.apache.org Sent: Thursday, June 4, 2009 12:36:30 PM Subject: Customizing results Hi, I am trying to customize the response that I receive from Solr. In the index I have multiple fields that contain the same data in different language. At the query time client specifies the language. Based on this param, I want to return the value, copied into a different field. Eg: Lubang, Filippinerne Lubang, Philippinen Lubang, Philippines Lubang, Filipinas If the user specifies language as de_de, then I want to return the result as Lubang, Philippinen What is the most optimal way of doing this? Any suggestions on this will be helpful Thanks, Kalyan Manepalli
Re: Customizing results
Aha, so you really want to rename the field at response time? I wonder if this is something that could be done with (or should be added to) response writers. That's where I'd go look first. Otis -- Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch - Original Message From: Manepalli, Kalyan kalyan.manepa...@orbitz.com To: solr-user@lucene.apache.org solr-user@lucene.apache.org Sent: Thursday, June 4, 2009 5:30:40 PM Subject: RE: Customizing results Otis, With that solution, the client has to accept all type location fields (location_de_de, location_it_it). I want to copy the result into location field, so that client can just accept location. Thanks, Kalyan Manepalli -Original Message- From: Otis Gospodnetic [mailto:otis_gospodne...@yahoo.com] Sent: Thursday, June 04, 2009 4:16 PM To: solr-user@lucene.apache.org Subject: Re: Customizing results Hello, If you know what language the user specified (or is associated with), then you just have to ensure the fl URL parameter contain that field (and any other fields you want returned). So if the language/locale is de_de, then make sure the request has fl=location_de_de,another_field,another_field, and not, for example location_it_it Otis -- Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch - Original Message From: Manepalli, Kalyan To: solr-user@lucene.apache.org Sent: Thursday, June 4, 2009 12:36:30 PM Subject: Customizing results Hi, I am trying to customize the response that I receive from Solr. In the index I have multiple fields that contain the same data in different language. At the query time client specifies the language. Based on this param, I want to return the value, copied into a different field. Eg: Lubang, Filippinerne Lubang, Philippinen Lubang, Philippines Lubang, Filipinas If the user specifies language as de_de, then I want to return the result as Lubang, Philippinen What is the most optimal way of doing this? Any suggestions on this will be helpful Thanks, Kalyan Manepalli
Re: Customizing results
How are you accessing Solr? SolrJ? does this help? https://issues.apache.org/jira/browse/SOLR-1129 On Fri, Jun 5, 2009 at 3:00 AM, Manepalli, Kalyan kalyan.manepa...@orbitz.com wrote: Otis, With that solution, the client has to accept all type location fields (location_de_de, location_it_it). I want to copy the result into location field, so that client can just accept location. Thanks, Kalyan Manepalli -Original Message- From: Otis Gospodnetic [mailto:otis_gospodne...@yahoo.com] Sent: Thursday, June 04, 2009 4:16 PM To: solr-user@lucene.apache.org Subject: Re: Customizing results Hello, If you know what language the user specified (or is associated with), then you just have to ensure the fl URL parameter contain that field (and any other fields you want returned). So if the language/locale is de_de, then make sure the request has fl=location_de_de,another_field,another_field, and not, for example location_it_it Otis -- Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch - Original Message From: Manepalli, Kalyan kalyan.manepa...@orbitz.com To: solr-user@lucene.apache.org solr-user@lucene.apache.org Sent: Thursday, June 4, 2009 12:36:30 PM Subject: Customizing results Hi, I am trying to customize the response that I receive from Solr. In the index I have multiple fields that contain the same data in different language. At the query time client specifies the language. Based on this param, I want to return the value, copied into a different field. Eg: Lubang, Filippinerne Lubang, Philippinen Lubang, Philippines Lubang, Filipinas If the user specifies language as de_de, then I want to return the result as Lubang, Philippinen What is the most optimal way of doing this? Any suggestions on this will be helpful Thanks, Kalyan Manepalli -- - Noble Paul | Principal Engineer| AOL | http://aol.com
Re: Customizing results
Nice suggestion Noble! If you are using SolrJ, then this particular binding can be an answer to your question. Cheers Avlesh 2009/6/5 Noble Paul നോബിള് नोब्ळ् noble.p...@corp.aol.com How are you accessing Solr? SolrJ? does this help? https://issues.apache.org/jira/browse/SOLR-1129 On Fri, Jun 5, 2009 at 3:00 AM, Manepalli, Kalyan kalyan.manepa...@orbitz.com wrote: Otis, With that solution, the client has to accept all type location fields (location_de_de, location_it_it). I want to copy the result into location field, so that client can just accept location. Thanks, Kalyan Manepalli -Original Message- From: Otis Gospodnetic [mailto:otis_gospodne...@yahoo.com] Sent: Thursday, June 04, 2009 4:16 PM To: solr-user@lucene.apache.org Subject: Re: Customizing results Hello, If you know what language the user specified (or is associated with), then you just have to ensure the fl URL parameter contain that field (and any other fields you want returned). So if the language/locale is de_de, then make sure the request has fl=location_de_de,another_field,another_field, and not, for example location_it_it Otis -- Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch - Original Message From: Manepalli, Kalyan kalyan.manepa...@orbitz.com To: solr-user@lucene.apache.org solr-user@lucene.apache.org Sent: Thursday, June 4, 2009 12:36:30 PM Subject: Customizing results Hi, I am trying to customize the response that I receive from Solr. In the index I have multiple fields that contain the same data in different language. At the query time client specifies the language. Based on this param, I want to return the value, copied into a different field. Eg: Lubang, Filippinerne Lubang, Philippinen Lubang, Philippines Lubang, Filipinas If the user specifies language as de_de, then I want to return the result as Lubang, Philippinen What is the most optimal way of doing this? Any suggestions on this will be helpful Thanks, Kalyan Manepalli -- - Noble Paul | Principal Engineer| AOL | http://aol.com
Re: Customizing results
Hi Otis, is it a good idea to provide as aliasing feature for Solr similar to the SQL 'as' in SQL we can do select location_da_dk as location Solr may have fl.alias=location_da_dk:location --Noble On Fri, Jun 5, 2009 at 3:10 AM, Otis Gospodnetic otis_gospodne...@yahoo.com wrote: Aha, so you really want to rename the field at response time? I wonder if this is something that could be done with (or should be added to) response writers. That's where I'd go look first. Otis -- Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch - Original Message From: Manepalli, Kalyan kalyan.manepa...@orbitz.com To: solr-user@lucene.apache.org solr-user@lucene.apache.org Sent: Thursday, June 4, 2009 5:30:40 PM Subject: RE: Customizing results Otis, With that solution, the client has to accept all type location fields (location_de_de, location_it_it). I want to copy the result into location field, so that client can just accept location. Thanks, Kalyan Manepalli -Original Message- From: Otis Gospodnetic [mailto:otis_gospodne...@yahoo.com] Sent: Thursday, June 04, 2009 4:16 PM To: solr-user@lucene.apache.org Subject: Re: Customizing results Hello, If you know what language the user specified (or is associated with), then you just have to ensure the fl URL parameter contain that field (and any other fields you want returned). So if the language/locale is de_de, then make sure the request has fl=location_de_de,another_field,another_field, and not, for example location_it_it Otis -- Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch - Original Message From: Manepalli, Kalyan To: solr-user@lucene.apache.org Sent: Thursday, June 4, 2009 12:36:30 PM Subject: Customizing results Hi, I am trying to customize the response that I receive from Solr. In the index I have multiple fields that contain the same data in different language. At the query time client specifies the language. Based on this param, I want to return the value, copied into a different field. Eg: Lubang, Filippinerne Lubang, Philippinen Lubang, Philippines Lubang, Filipinas If the user specifies language as de_de, then I want to return the result as Lubang, Philippinen What is the most optimal way of doing this? Any suggestions on this will be helpful Thanks, Kalyan Manepalli -- - Noble Paul | Principal Engineer| AOL | http://aol.com
Re: Customizing results
Generally a good idea, but be prepared to entertain requests that should also ask you to be able to perform the query using those aliases. I mean when you talk about something similar to aliases in SQL, those aliases can be used in SQL scripts in the where clause too. Cheers Avlesh 2009/6/5 Noble Paul നോബിള് नोब्ळ् noble.p...@corp.aol.com Hi Otis, is it a good idea to provide as aliasing feature for Solr similar to the SQL 'as' in SQL we can do select location_da_dk as location Solr may have fl.alias=location_da_dk:location --Noble On Fri, Jun 5, 2009 at 3:10 AM, Otis Gospodnetic otis_gospodne...@yahoo.com wrote: Aha, so you really want to rename the field at response time? I wonder if this is something that could be done with (or should be added to) response writers. That's where I'd go look first. Otis -- Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch - Original Message From: Manepalli, Kalyan kalyan.manepa...@orbitz.com To: solr-user@lucene.apache.org solr-user@lucene.apache.org Sent: Thursday, June 4, 2009 5:30:40 PM Subject: RE: Customizing results Otis, With that solution, the client has to accept all type location fields (location_de_de, location_it_it). I want to copy the result into location field, so that client can just accept location. Thanks, Kalyan Manepalli -Original Message- From: Otis Gospodnetic [mailto:otis_gospodne...@yahoo.com] Sent: Thursday, June 04, 2009 4:16 PM To: solr-user@lucene.apache.org Subject: Re: Customizing results Hello, If you know what language the user specified (or is associated with), then you just have to ensure the fl URL parameter contain that field (and any other fields you want returned). So if the language/locale is de_de, then make sure the request has fl=location_de_de,another_field,another_field, and not, for example location_it_it Otis -- Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch - Original Message From: Manepalli, Kalyan To: solr-user@lucene.apache.org Sent: Thursday, June 4, 2009 12:36:30 PM Subject: Customizing results Hi, I am trying to customize the response that I receive from Solr. In the index I have multiple fields that contain the same data in different language. At the query time client specifies the language. Based on this param, I want to return the value, copied into a different field. Eg: Lubang, Filippinerne Lubang, Philippinen Lubang, Philippines Lubang, Filipinas If the user specifies language as de_de, then I want to return the result as Lubang, Philippinen What is the most optimal way of doing this? Any suggestions on this will be helpful Thanks, Kalyan Manepalli -- - Noble Paul | Principal Engineer| AOL | http://aol.com
Re: Customizing results
On Fri, Jun 5, 2009 at 10:20 AM, Avlesh Singh avl...@gmail.com wrote: Generally a good idea, but be prepared to entertain requests that should also ask you to be able to perform the query using those aliases. I mean when you talk about something similar to aliases in SQL, those aliases can be used in SQL scripts in the where clause too. I guess that can be a separate issue. But this can be implemented as a post processing step. At the ResponseWriter level. The current problem is that there are too many response writers and we will have to change and test them all Cheers Avlesh 2009/6/5 Noble Paul നോബിള് नोब्ळ् noble.p...@corp.aol.com Hi Otis, is it a good idea to provide as aliasing feature for Solr similar to the SQL 'as' in SQL we can do select location_da_dk as location Solr may have fl.alias=location_da_dk:location --Noble On Fri, Jun 5, 2009 at 3:10 AM, Otis Gospodnetic otis_gospodne...@yahoo.com wrote: Aha, so you really want to rename the field at response time? I wonder if this is something that could be done with (or should be added to) response writers. That's where I'd go look first. Otis -- Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch - Original Message From: Manepalli, Kalyan kalyan.manepa...@orbitz.com To: solr-user@lucene.apache.org solr-user@lucene.apache.org Sent: Thursday, June 4, 2009 5:30:40 PM Subject: RE: Customizing results Otis, With that solution, the client has to accept all type location fields (location_de_de, location_it_it). I want to copy the result into location field, so that client can just accept location. Thanks, Kalyan Manepalli -Original Message- From: Otis Gospodnetic [mailto:otis_gospodne...@yahoo.com] Sent: Thursday, June 04, 2009 4:16 PM To: solr-user@lucene.apache.org Subject: Re: Customizing results Hello, If you know what language the user specified (or is associated with), then you just have to ensure the fl URL parameter contain that field (and any other fields you want returned). So if the language/locale is de_de, then make sure the request has fl=location_de_de,another_field,another_field, and not, for example location_it_it Otis -- Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch - Original Message From: Manepalli, Kalyan To: solr-user@lucene.apache.org Sent: Thursday, June 4, 2009 12:36:30 PM Subject: Customizing results Hi, I am trying to customize the response that I receive from Solr. In the index I have multiple fields that contain the same data in different language. At the query time client specifies the language. Based on this param, I want to return the value, copied into a different field. Eg: Lubang, Filippinerne Lubang, Philippinen Lubang, Philippines Lubang, Filipinas If the user specifies language as de_de, then I want to return the result as Lubang, Philippinen What is the most optimal way of doing this? Any suggestions on this will be helpful Thanks, Kalyan Manepalli -- - Noble Paul | Principal Engineer| AOL | http://aol.com -- - Noble Paul | Principal Engineer| AOL | http://aol.com
Re: customizing results in StandardQueryHandler
: Subject: customizing results in StandardQueryHandler : In-Reply-To: [EMAIL PROTECTED] http://people.apache.org/~hossman/#threadhijack Thread Hijacking on Mailing Lists When starting a new discussion on a mailing list, please do not reply to an existing message, instead start a fresh email. Even if you change the subject line of your email, other mail headers still track which thread you replied to and your question is hidden in that thread and gets less attention. It makes following discussions in the mailing list archives particularly difficult. See Also: http://en.wikipedia.org/wiki/Thread_hijacking -Hoss
customizing results in StandardQueryHandler
Hi, In my usecase, I query a set of fields. Then based on the results, I want to output a customized set of fields. Can I do this without using a search component? E:g. I query for fields f1, f2, f3, f4. Now based on some conditions, I want to output just f1, f3, f4 (the list of final fields may vary). How do I rewrite the resultant xml optimally? Any thoughts on this will be helpful Thanks, Kalyan
Re: customizing results in StandardQueryHandler
isn't this just: fl=f1,f3,f4 etc or am I missing something? On Oct 24, 2008, at 12:26 PM, Manepalli, Kalyan wrote: Hi, In my usecase, I query a set of fields. Then based on the results, I want to output a customized set of fields. Can I do this without using a search component? E:g. I query for fields f1, f2, f3, f4. Now based on some conditions, I want to output just f1, f3, f4 (the list of final fields may vary). How do I rewrite the resultant xml optimally? Any thoughts on this will be helpful Thanks, Kalyan
RE: customizing results in StandardQueryHandler
Ryan, Actually, what I need is: I always query for a set of fields say (f1, f2, f3 .. f6). Now once I get the results, based on some logic, I need to generate the XML which is customized and contains only fields say (f2, f3, and some new data). So the fl will always be (f1 ... f6) Thanks, Kalyan Manepalli -Original Message- From: Ryan McKinley [mailto:[EMAIL PROTECTED] Sent: Friday, October 24, 2008 1:25 PM To: solr-user@lucene.apache.org Subject: Re: customizing results in StandardQueryHandler isn't this just: fl=f1,f3,f4 etc or am I missing something? On Oct 24, 2008, at 12:26 PM, Manepalli, Kalyan wrote: Hi, In my usecase, I query a set of fields. Then based on the results, I want to output a customized set of fields. Can I do this without using a search component? E:g. I query for fields f1, f2, f3, f4. Now based on some conditions, I want to output just f1, f3, f4 (the list of final fields may vary). How do I rewrite the resultant xml optimally? Any thoughts on this will be helpful Thanks, Kalyan
RE: customizing results in StandardQueryHandler
Ah! This will let you post-process result sets with an XSL script: http://wiki.apache.org/solr/XsltResponseWriter -Original Message- From: Manepalli, Kalyan [mailto:[EMAIL PROTECTED] Sent: Friday, October 24, 2008 11:44 AM To: solr-user@lucene.apache.org Subject: RE: customizing results in StandardQueryHandler Ryan, Actually, what I need is: I always query for a set of fields say (f1, f2, f3 .. f6). Now once I get the results, based on some logic, I need to generate the XML which is customized and contains only fields say (f2, f3, and some new data). So the fl will always be (f1 ... f6) Thanks, Kalyan Manepalli -Original Message- From: Ryan McKinley [mailto:[EMAIL PROTECTED] Sent: Friday, October 24, 2008 1:25 PM To: solr-user@lucene.apache.org Subject: Re: customizing results in StandardQueryHandler isn't this just: fl=f1,f3,f4 etc or am I missing something? On Oct 24, 2008, at 12:26 PM, Manepalli, Kalyan wrote: Hi, In my usecase, I query a set of fields. Then based on the results, I want to output a customized set of fields. Can I do this without using a search component? E:g. I query for fields f1, f2, f3, f4. Now based on some conditions, I want to output just f1, f3, f4 (the list of final fields may vary). How do I rewrite the resultant xml optimally? Any thoughts on this will be helpful Thanks, Kalyan
Re: customizing results in StandardQueryHandler
I'm still not following... Does the logic depend on the result? That is, are you asking for doc A to have f1,f2 and doc B to have f1,f4? If that is your question, then no -- as is, the ResponseWriter will write the same fields for every document. When you say (f2, f3, and some new data) -- where does the new data come from? Are you trying to augment the results of a document with something else? If so, take a look at the local solr patch in: https://issues.apache.org/jira/browse/LUCENE-1387 that adds a distance calculation to each matched document. On Oct 24, 2008, at 2:43 PM, Manepalli, Kalyan wrote: Ryan, Actually, what I need is: I always query for a set of fields say (f1, f2, f3 .. f6). Now once I get the results, based on some logic, I need to generate the XML which is customized and contains only fields say (f2, f3, and some new data). So the fl will always be (f1 ... f6) Thanks, Kalyan Manepalli -Original Message- From: Ryan McKinley [mailto:[EMAIL PROTECTED] Sent: Friday, October 24, 2008 1:25 PM To: solr-user@lucene.apache.org Subject: Re: customizing results in StandardQueryHandler isn't this just: fl=f1,f3,f4 etc or am I missing something? On Oct 24, 2008, at 12:26 PM, Manepalli, Kalyan wrote: Hi, In my usecase, I query a set of fields. Then based on the results, I want to output a customized set of fields. Can I do this without using a search component? E:g. I query for fields f1, f2, f3, f4. Now based on some conditions, I want to output just f1, f3, f4 (the list of final fields may vary). How do I rewrite the resultant xml optimally? Any thoughts on this will be helpful Thanks, Kalyan
RE: customizing results in StandardQueryHandler
Populating the field at the index time is a good option. Is there any other way to do it in search time Thanks, Kalyan Manepalli -Original Message- From: Ryan McKinley [mailto:[EMAIL PROTECTED] Sent: Friday, October 24, 2008 2:14 PM To: solr-user@lucene.apache.org Subject: Re: customizing results in StandardQueryHandler I'm still not following... Does the logic depend on the result? That is, are you asking for doc A to have f1,f2 and doc B to have f1,f4? If that is your question, then no -- as is, the ResponseWriter will write the same fields for every document. When you say (f2, f3, and some new data) -- where does the new data come from? Are you trying to augment the results of a document with something else? If so, take a look at the local solr patch in: https://issues.apache.org/jira/browse/LUCENE-1387 that adds a distance calculation to each matched document. On Oct 24, 2008, at 2:43 PM, Manepalli, Kalyan wrote: Ryan, Actually, what I need is: I always query for a set of fields say (f1, f2, f3 .. f6). Now once I get the results, based on some logic, I need to generate the XML which is customized and contains only fields say (f2, f3, and some new data). So the fl will always be (f1 ... f6) Thanks, Kalyan Manepalli -Original Message- From: Ryan McKinley [mailto:[EMAIL PROTECTED] Sent: Friday, October 24, 2008 1:25 PM To: solr-user@lucene.apache.org Subject: Re: customizing results in StandardQueryHandler isn't this just: fl=f1,f3,f4 etc or am I missing something? On Oct 24, 2008, at 12:26 PM, Manepalli, Kalyan wrote: Hi, In my usecase, I query a set of fields. Then based on the results, I want to output a customized set of fields. Can I do this without using a search component? E:g. I query for fields f1, f2, f3, f4. Now based on some conditions, I want to output just f1, f3, f4 (the list of final fields may vary). How do I rewrite the resultant xml optimally? Any thoughts on this will be helpful Thanks, Kalyan