rahuldave / appsem

js server and ui for semflow
4 stars 1 forks source link

History (back/forward) of searches doesn't work #7

Open DougBurke opened 13 years ago

DougBurke commented 13 years ago

On my local machine I tried doing some searches, then deleting filters, then using the back and forward history mechanism of the browser. In doing so the URL's were correct - ie you could see that they contained the desired filters - but the "Current Selection" area of the page was blank.

DougBurke commented 13 years ago

Aha, it seems that somehow I'd managed to use a URL without a / after publications. The interface still seems to work, but you then get odd behavior with the search history (which makes sense). So with

http://localhost:3000/semantic2/alpha/explorer/publications/#fq=keywords_s%3Aabsorption&q=*%3A*

the history seems to work but

http://localhost:3000/semantic2/alpha/explorer/publications#fq=keywords_s%3Aabsorption&q=*%3A*

it does not. However I'm still not sure as I'm not seeing this consistently; perhaps my laptop is just confused and needs a re-boot. We should check the instance on boom to see what is happening (I assume boom has been updated to the latest appsem).

DougBurke commented 13 years ago

I believe this happens when you select a constraint that contains a comma - so either an author name or PI name. Try

http://labs.adsabs.harvard.edu/semantic2/alpha/explorer/publications#fq=author_s%3A%22Burke%2C%20D%22&q=*%3A*

then open the Developer/Javascript Console and force a reload of the page. You'll see an error message about an Uncaught TypeError because Object author_s:"Burke, D" has no method split (with the error coming from line 23 of CurrentSearchWidget - aka

https://github.com/rahuldave/appsem/commit/8a6b02233b5414ef3fa83bbdd681854673fff54c#L108R23

If you enter, in the javascript console,

Manager.store.values('fq')

I would expect an array with 1 element, the string author_s:"Burke, D" (which is what you get if you had tried this line before forcing the page reload). Instead, the return value is a 1-element array, but the element is itself an array of 2 elements, author_s:"Burke and D".

DougBurke commented 13 years ago

I believe the problem is in ajax-solr itself, which the above patch works around, but I am not 100% convinced that this is the correct solution.