Re: searchcomponent howto ...
sorry. my 'tab' character is linked to 'send'. i meant to include this bit of source @Override public void process(ResponseBuilder rb) throws IOException { SolrQueryRequest request = rb.req; SolrParams params = request.getParams(); String qs = rb.getQueryString(); String defType = params.get(QueryParsing.DEFTYPE); defType = defType==null ? QParserPlugin.DEFAULT_QTYPE : defType; try { QParser parser = QParser.getParser(encoder.process(rb.getQueryString()), defType, request); rb.setQuery( parser.getQuery() ); rb.setQparser(parser); } catch (ParseException e) { throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, e); } } and then ask, - how can i set the value of query so that it is reflected in the 'q' node of the search results e.g. solr. the example 'process' method above works, but the original query is still written to the search results page. On Mon, Jun 8, 2009 at 9:08 AM, Grant Ingersoll wrote: > Is there a question here? > > > On Jun 7, 2009, at 2:50 PM, David Palaitis wrote: > > I'm trying to write a very simple SearchComponent that performs a simple >> operation on the query string before passing through to QueryComponent. >> >> The EncodingSearchComponent will perform something like the following >> Base64(MD5(querystring)) >> > > -- > Grant Ingersoll > http://www.lucidimagination.com/ > > Search the Lucene ecosystem (Lucene/Solr/Nutch/Mahout/Tika/Droids) using > Solr/Lucene: > http://www.lucidimagination.com/search > >
Re: Collapse Results
both CollapseComponent and QueryComponent execute searches and add results to the Response. To get only Collapse results, remove the QueryComponent from the requestHandler. In solrconfig.xml, I added: > >class="org.apache.solr.handler.component.CollapseComponent" /> > > > > > > explicit > > > >collapse > > On Mon, Jun 8, 2009 at 5:38 PM, Nirkhe, Chandra wrote: > Hi, > I am using Solr 1.3 with collapse patch. In the results it returns > standard response as well as collapse response. How do I get just > collapse response? > > Regards > Chandra > > "responseHeader":{ > "status":0, > "QTime":25, > "params":{ >"collapse":"true", >"wt":"json", >"collapse.field":"resource_id", >"indent":"on", >"fl":"resource_id", >"q":"George", >"qt":"provider", >"version":"2.2"}}, > "response":{"numFound":5364,"start":0,"docs":[ >{ > "resource_id":1001}, >{ > "resource_id":1001}, >{ > "resource_id":1001}, >{ > "resource_id":1001}, >{ > "resource_id":1001}, >{ > "resource_id":1001}, >{ > "resource_id":1001}, >{ > "resource_id":1001}, >{ > "resource_id":1001}, >{ > "resource_id":1001}] > }, > "spellcheck":{ > "suggestions":[]}, > "collapse_counts":[ > "field","resource_id", > "doc",[ >"10001",1628, >"64308",88, >"66931",148, >"79374",23, >"107152",621, >"135179",87, >"242091",154, >"254375",192, >"264802",143, >"388030",352], > "count",[ >"1001",1628, >"1060",88, >"1064",148, >"1084",23, >"1127",621, >"1141",87, >"1899",154, >"1913",192, >"1924",143, >"2024",352], > "debug",[ >"Docset type","HashDocSet(16)", >"Total collapsing time(ms)",10, >"Create uncollapsed docset(ms)",8, >"Collapsing normal time(ms)",1, >"Creating collapseinfo time(ms)",1, >"Convert to bitset time(ms)",0, >"Create collapsed docset time(ms)",0]], > "response":{"numFound":16,"start":0,"docs":[ >{ > "resource_id":1001}, >{ > "resource_id":1060}, >{ > "resource_id":1064}, >{ > "resource_id":1084}, >{ > "resource_id":1127}, >{ > "resource_id":1141}, >{ > "resource_id":1899}, >{ > "resource_id":1913}, >{ > "resource_id":1924}, >{ > "resource_id":2024}] > }} > > > >
Re: searchcomponent howto ...
thanks. that's what I was looking for. On Mon, Jun 22, 2009 at 4:15 PM, Chris Hostetter wrote: > : and then ask, > :- how can i set the value of query so that it is reflected in the 'q' > : node of the search results e.g. solr. > : the example 'process' method above works, but the original query is still > : written to the search results page. > > if you're talking about the param values that get written out in the > header section, those always contain the "original" params (either form > the URL, or from defaults in configs ... I don't think you can modify > those easily. > > your component can always add the your new "q" value to the response as a > new object (with whatever name you want), and your client code can get at > it that way. > > > -Hoss > >