Closed jonasanso closed 10 years ago
@jonasanso I will look into this issue. We could print out the API call url when each function call is made - I have done that in other packages. Good idea?
What is the URL you were trying with? Maybe I can see what might be going on, and debug that error you're getting.
I haven't played with the qt
parameter much, so I don't know much about what I should expect to see.
I am about to push a change so that the URL prints out for the call so you can see what url is generated.
Also, this seems to work for me, at least doesn't take off the fields requested when qt
is used
solr_group(q='*:*', group.field='journal', group.limit=1, group.sort='alm_twitterCount desc', sort='score asc', fl="id, score, alm_twitterCount, article_type, accepted_date", fq='alm_twitterCount:[5 TO 10]', qt='distributedSearch', url = url, key=key)
groupValue numFound start id alm_twitterCount accepted_date article_type score
1 none 4172 0 10.1371/journal.pone.0043099 10 2012-07-19T00:00:00Z Research Article 1
2 plos one 19009 0 10.1371/journal.pone.0082853 10 2013-10-29T00:00:00Z Research Article 1
3 plos genetics 1276 0 10.1371/journal.pgen.1003911/references 10 2013-09-08T00:00:00Z Research Article 1
4 plos biology 1139 0 10.1371/journal.pbio.1001765 10 2013-12-03T00:00:00Z Research Article 1
5 plos pathogens 1155 0 10.1371/journal.ppat.1003741 10 <NA> Pearls 1
6 plos neglected tropical diseases 929 0 10.1371/journal.pntd.0001132 10 <NA> Editorial 1
7 plos computational biology 991 0 10.1371/journal.pcbi.1002860 10 2012-11-09T00:00:00Z Research Article 1
8 plos medicine 776 0 10.1371/journal.pmed.1001261 10 <NA> Health in Action 1
Also note that the URL is decoded so it is easier to read, but should still work when you paste into the browser, or do a curl call
Thanks Scott
I will check it tomorrow.
Jonás El 24/01/2014 20:58, "Scott Chamberlain" notifications@github.com escribió:
Also note that the URL is decoded so it is easier to read, but should still work when you paste into the browser, or do a curl call
— Reply to this email directly or view it on GitHubhttps://github.com/ropensci/solr/issues/20#issuecomment-33255328 .
Found the rare behaviour.
http://solr-prod:7070/solr/select?group.field=accoid&q=_:_&start=0&sort=price asc&fq=transport:VL&fl=touroperator&fl= rating&fl= price&wt=json&group.limit=1&group.sort=price asc&group.sort=price asc&group=true&qt=distributedSearch
The Solr url generated contains many fl and the request handler we are using does not support that.
I could change the handler to support it, but the the definition for the attribute fl does not indicate it should be a multiple attribute. The parameter should contain the field names separated by commas or spaces http://wiki.apache.org/solr/CommonQueryParameters#fl
The request works http://solr-prod:7070/solr/select? ... &fl=touroperator, rating, price ... &qt=distributedSearch
If there is no special reason to split the fl param into multiple url parameters I would propose to send only one parameter fl with the user specified fields.
I have found very useful printing the solr url to debug this issue, maybe we can leave it until we have tested more or we can add a new param SHOW_URL=false to the functions so the url is shown only when SHOW_URL is true.
Let me know if that fixes your problem with a new install
Thanks. It is working.
I can not reproduce it in PLOS.
Normal query with 3 attributes in field list. I get a warning
Same query with raw true
When I add qt='distributedSearch' in the response the last 2 attributes are missing
In the raw response they are also missing
I don't know how to get url sent to Solr to check if the url was built correctly.