lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan McKinley <ryan...@gmail.com>
Subject Re: SolrQuery.getStart(), SolrQuery.getRows(), always return null
Date Wed, 12 Mar 2008 20:47:19 GMT
I just committed a change to SolrQuery so that getRows and getStart use 
"getInt()" rather then "getFieldInt()"

Thanks for pointing this out!


Thijs wrote:
> I'm running into a problem where the calls to SolrQuery.getStart(), 
> SolrQuery.getRows() always return null
> I'm using trunk of 1.3
> I think I also found the problem.
> 
> If I use SolrQuery.setRows(20), the value is set in the LinkedHashMap 
> with the key-values {"rows", {"20"}} in method set() (line 66 in 
> ModifiableSolrParams)
> However when I use  SolrQuery.getRows(), the values are retrieved 
> through SolrParams.getIntField("rows", null) --> 
> SolrParams.getFieldParam. This method first calls method fpname("rows", 
> null) which returns "f.rows.null" and that value is used as key in 
> ModifiableSolrParams to get the value from the LinkedHashMap. This of 
> course will return nothing because that key is not in the hashmap.
> So if I change methode fpname in SolrParams to
> 
> protected String fpname(String field, String param) {
>    return "field+(param==null?"":param);
> //    return "f."+field+'.'+param;
>  }
> 
> it works and getStart en  getRows returns the values previously set.
> 
> I'm not sure this is the correct solution, could someone have a look and 
> if ok, commit it to the codebase?
> 
> Thanks
> 
> Thijs
> 
> 
> 


Mime
View raw message