Solr and internationalization
Hi, I am working on a plugin for Solr, and in this project, a QueryNodeException [1] is thrown in the case of an error while parsing the query. However, I receive the following exception in such a case: HTTP Status 500 - Can't find bundle for base name org.apache.lucene.queryParser.core.messages.QueryParserMessages, locale en_IE java.util.MissingResourceException: Can't find bundle for base name org.apache.lucene.queryParser.core.messages.QueryParserMessages, locale en_IE at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1427) . It seems that this is because my solr app cannot find a ressource bundle while writing the exception message. Lucene supports internationalization in query's exception messages thanks to the NLS [2] class. It should search for terms in the default property file *org/apache/lucene/queryParser/core/messages/QueryParserMessages.properties*, which is set in [1], in the case of the property file in the current locale missing, in my case en_IE. Creating the file with the current local, i.e., org/apache/lucene/queryParser/core/messages/QueryParserMessages*_en_IE*.properties, and putting it into a jar placed in the lib folder of my solr app changed nothing. Would you know why the default property file is not seen ? What would be the required steps to add internationalization support in Solr ? Or, at least, to remove the bundle exception ? Regards, [1] http://lucene.apache.org/java/3_1_0/api/contrib-queryparser/org/apache/lucene/queryParser/core/QueryNodeException.html [2] http://lucene.apache.org/java/3_1_0/api/core/org/apache/lucene/messages/NLS.html -- Campinas Stéphane
Re: SIREn with Solr
On 17/08/11 11:53, marotosg wrote: Anyone has any experience with this plugin?. -- View this message in context: http://lucene.472066.n3.nabble.com/SIREn-with-Solr-tp3261260p3261260.html Sent from the Solr - User mailing list archive at Nabble.com. Hi, What would you like to know ? I am working on it with the main developer, Renaud Delbru [1] Best, [1] renaud.del...@deri.org -- Campinas Stéphane
custom velocity tool
Hi, I am working with the velocity response writer, and I want to develop a custom velocity tool. To do so, I have written a JAVA class that looks like that: @DefaultKey(mytool) public class MyCustomTool { public MyCustomTool() { } public String doit(Object arg) { // Do something return something; } } Then in order to register my custom tool, I create the property file: tools.toolbox = application tools.application.mytool = org.my.custom.MyCustomTool By default, this file is named velocity.properties and is located within the conf folder, according to [1]. This is set by the velocity response writer in the v.properties parameter. After copying the jar file into the lib folder of my solr application, I use my custom tool in my template by calling: $mytool.doit($var) However, this doesn't do anything: no exception, no processing of the $var variable. It seems that the custom tool is not loaded. Would you know what I am doing wrong ? Thanks ps: By the way, I am using the 2.0-beta3 of the velocity tools. [1] http://java.dzone.com/news/quick-look-%E2%80%93-solritas-and-gui?utm_source=feedburnerutm_medium=feedutm_campaign=Feed%253A+javalobby%252Ffrontpage+%28Javalobby+%252F+Java+Zone%29 http://java.dzone.com/news/quick-look-%E2%80%93-solritas-and-gui?utm_source=feedburnerutm_medium=feedutm_campaign=Feed%253A+javalobby%252Ffrontpage+%28Javalobby+%252F+Java+Zone%29 -- Campinas Stéphane