adsabs / adsrex

Collection of functional tests for ADS Api and Bumblebee
MIT License
0 stars 6 forks source link

test_005 #13

Open romanchyla opened 4 years ago

romanchyla commented 4 years ago

recent changes improved scoring, but i question the increase of parameters that are being returned

----------------------------------------------------------------------
Traceback (most recent call last):
  File "/dvt/workspace/adsrex/classic2die/test_urls.py", line 142, in url_005
    self.assertRedirected(user, r, '/search/q=bibcode%3D0803983468&sort=date%20desc%2C%20bibcode%20desc&rows=30&start=0&format=HTM&unprocessed_parameter=All%20object%20queries%20include%20SIMBAD%20and%20NED%20search%20results.&unprocessed_parameter=Please%20note%20Min%20Score%20is%20deprecated.&unprocessed_parameter=All%20object%20queries%20include%20SIMBAD%20and%20NED%20search%20results.&unprocessed_parameter=Use%20For%20Weighting&unprocessed_parameter=Relative%20Weights&unprocessed_parameter=Weighted%20Scoring&unprocessed_parameter=Synonym%20Replacement/', 302)
  File "/dvt/workspace/adsrex/classic2die/test_urls.py", line 30, in assertRedirected
    self.assertEquals(r.headers['Location'], expected)
AssertionError: 'https://ui.adsabs.harvard.edu/search/q=bibcode%3D0803983468&sort=score%20desc&rows=30&start=0&unprocessed_parameter=data_type&unprocessed_parameter=Use%20For%20Weighting&unprocessed_parameter=Relative%20Weights&unprocessed_parameter=Weighted%20Scoring&unprocessed_parameter=Synonym%20Replacement/' != 'https://ui.adsabs.harvard.edu/search/q=bibcode%3D0803983468&sort=date%20desc%2C%20bibcode%20desc&rows=30&start=0&format=HTM&unprocessed_parameter=All%20object%20queries%20include%20SIMBAD%20and%20NED%20search%20results.&unprocessed_parameter=Please%20note%20Min%20Score%20is%20deprecated.&unprocessed_parameter=All%20object%20queries%20include%20SIMBAD%20and%20NED%20search%20results.&unprocessed_parameter=Use%20For%20Weighting&unprocessed_parameter=Relative%20Weights&unprocessed_parameter=Weighted%20Scoring&unprocessed_parameter=Synonym%20Replacement/'

essentially, all these unprocessed_parameters were not even included in the original query, could we please not include them in the redirect? @golnazads can you take a look please?

golnazads commented 4 years ago

Checked and the only parameter coming from unfielded form is qsearch, nothing else. So this query did not originate from a form. I think only the fielded form has all these weight parameters. https://github.com/adsabs/tugboat/blob/master/tugboat/views.py#L1122 So they are ignored for now.

The way they work is 1- when the weight is selected by the user it is included in the parameters and has a value of Yes 2- when the weight is not selected by the user it is not included in the parameters and hence we know it has a value of No

so they are included in the unprocessed parameters if 1- when the weight that as default should have been selected and would have been included with value of Yes, was not included, and hence not selected 2- when the weight that as default should not have selected and should not have been included, was included, with a value of Yes, and hence selected

We agreed to only process the parameters that were included, but this morning with fresh head I think processing only the second case does not make sense. So all the weight parameters are ignored for now when coming from unfielded form.

would you please let me know if this is acceptable? Deployed to dev. thank you

golnazads commented 4 years ago

Actually I think a better approach is to instead of ignoring if the call did not come from fielded form for weights is to lump everything together and produce one message saying one or more weighted parameters was not processed. This way it is one message, and it would cover both cases. I am going to change it to that.