Re: Custom sorting
Hi Dan, It seems that you want a SearchComponent[1], something like the QueryElevationComponent[2]. Take a look how at him and I think you can build your custom solution. [1]- http://lucene.apache.org/solr/api/org/apache/solr/handler/component/SearchComponent.html [2]- http://wiki.apache.org/solr/QueryElevationComponent Cheers, -- Daniel Cassiano http://dcassiano.wordpress.com On Wed, May 19, 2010 at 6:46 AM, dan sutton danbsut...@gmail.com wrote: Hi, I have a requirement to do the following: For up to the first 10 results (i.e. only on the first page) show sponsored category ads, in order of bid, but no more than 2 / category, and only if all sponsored cat' ads are more that min% of the highest score. e.g. If I had the following: min% =1 doc score bid cat_id sponsored 1 100 x x 0 255x x 0 3502 2 1 4202 2 1 5052 2 1 6801 1 1 7701 1 1 8601 1 1 x = dont care sorted order would be: 3 4 6 7 1 8 2 5 I'm not sure if this can be implemented with a custom comparator as I need access to the final score to enforce min%, I'm thinking I'm probably going to have to implement a subclass of QParserPlugin with a custom sort. but was wondering if there were alternatives ? Many thanks in advance. Dan
Problem with ResponseBuilder
Hi folks, I'm writing some search component to Solr and I'm having some troubles with the ResponseBuilder. I'd like to add to response, eg: only 5 documents of a search. My problem is when I try to add these docs to the ResponseBuilder. A snipet of the code: [...] QParser parser = QParser.getParser(rb.getQueryString(), defType, req); rb.setQuery( parser.getQuery() ); rb.setSortSpec( parser.getSort(true) ); rb.setQparser(parser); DocListAndSet results = new DocListAndSet(); Hits h = searcher.search(rb.getQuery()); for (int i=0;i5;i++) { results.docList.add(h.id(i)); } rb.setResults(results); [...] The expected result is a response with only 5 documents. Is this the correct way to obtain the docs? I'm receiving a null java.lang.NullPointerException with this code. Sorry but I didn' t found the solution anywhere and I'm a noob with Solr. Thanks in advance. -- Daniel Cassiano _ http://www.apontador.com.br/ http://www.maplink.com.br/
Error with UpdateRequestProcessorFactory
Hi folks, I'm having some problem with a custom handler on my Solr. All the application works fine, but when I do a new checkout from svn and generate a jar file with my handler, I got: SEVERE: java.lang.NoSuchMethodError: org.apache.solr.core.SolrCore.getUpdateProcessorFactory(Ljava/lang/String;)Lorg/apache/solr/update/processor/UpdateRequestProcessorFactory; I checked versions of my libs and they're ok. I'm using Solr 1.3 and the environment is the same that works previously. Does anyone have an idea of what could be? Thanks! Cheers, -- Daniel Cassiano _ http://www.apontador.com.br/ http://www.maplink.com.br/
Re: Error with UpdateRequestProcessorFactory
Hi Shalin, On Tue, Aug 4, 2009 at 12:43 PM, Shalin Shekhar Mangarshalinman...@gmail.com wrote: I'm having some problem with a custom handler on my Solr. All the application works fine, but when I do a new checkout from svn and generate a jar file with my handler, I got: SEVERE: java.lang.NoSuchMethodError: org.apache.solr.core.SolrCore.getUpdateProcessorFactory(Ljava/lang/String;)Lorg/apache/solr/update/processor/UpdateRequestProcessorFactory; I checked versions of my libs and they're ok. I'm using Solr 1.3 and the environment is the same that works previously. Are you using the released Solr 1.3 or some intermediate nightly build? The 1.3 release has SolrCore.getUpdateProcessorChain(String) method. You are ritght. I was using some nightly build. I changed to the released 1.3 and it works. Thanks! -- Daniel Cassiano _ Page: http://danielcassiano.net/ http://www.umitproject.org/
Re: LocalSolr - order of fields on xml response
Hi Ryan, Thanks for the information. Is this expected to be implemented? Regards, -- Daniel Cassiano _ http://www.apontador.com.br/ http://www.maplink.com.br/ On Wed, Jul 22, 2009 at 10:08 PM, Ryan McKinley ryan...@gmail.com wrote: ya... 'expected', but perhaps not ideal. As is, LocalSolr munges the document on its way out the door to add the distance. When LocalSolr makes it into the source, it will likely use a method like: https://issues.apache.org/jira/browse/SOLR-705 to augment each document with the calculated distance. This will at least have consistent behavior. On Jul 22, 2009, at 10:47 AM, Daniel Cassiano wrote: Hi folks, When I do some query with LocalSolr to get the geo_distance, the order of xml fields is different of a standard query. It's a simple query, like this: http://myhost.com:8088/solr/core/select?qt=geox=-46.01y=-23.01radius=15sort=geo_distanceascq=*:* Is this an expected behavior of LocalSolr? Thanks! -- Daniel Cassiano _ http://www.apontador.com.br/ http://www.maplink.com.br/
LocalSolr - order of fields on xml response
Hi folks, When I do some query with LocalSolr to get the geo_distance, the order of xml fields is different of a standard query. It's a simple query, like this: http://myhost.com:8088/solr/core/select?qt=geox=-46.01y=-23.01radius=15sort=geo_distanceascq=*:* Is this an expected behavior of LocalSolr? Thanks! -- Daniel Cassiano _ http://www.apontador.com.br/ http://www.maplink.com.br/