Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add configurable search parameters to search options and remove unused method (get_full_url) #1228

Merged
merged 1 commit into from May 1, 2018

Conversation

lmcglohon
Copy link
Contributor

Also removed commented out code

Copy link
Contributor

@lorawoodford lorawoodford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran several tests against the test db using test.archivesspace.org and local build from this branch. Great improvements noted for:

  • keyword search for 'MS Am'

Collections with identifiers starting 'MS Am' pulled to top.

  • keyword search for 'additional papers'

Results containing just 'papers' now lower than previously.

  • keyword search for 'Company D'

Result containing full phrase ranked highest.

@lorawoodford lorawoodford merged commit 504d89d into master May 1, 2018
@lorawoodford lorawoodford deleted the solr_params branch May 1, 2018 20:06
@fordmadox
Copy link
Contributor

fordmadox commented May 3, 2018

@lorawoodford @lmcglohon I still cannot see evidence of the solr parameters set in the AppConfig file having any effect on the PUI. Can you test by simply adding "AND" as the default operator, and then performing a search with at least two terms?

For example, if you search for James Gunn in the test site, like this:

http://test.archivesspace.org/search?utf8=%E2%9C%93&op%5B%5D=&q%5B%5D=james+gunn&limit=&field%5B%5D=&from_year%5B%5D=&to_year%5B%5D=&commit=Search

818 results are returned right now. That's because the PUI is doing a search for James OR Gunn (at least, an equivalent search).

I cannot change anything locally to impact that result (although I can for the staff interface!).

And, as you'll see, adding AND to the search string does not have any impact, either:

http://test.archivesspace.org/search?utf8=%E2%9C%93&op%5B%5D=AND&q%5B%5D=james+gunn&limit=&field%5B%5D=&from_year%5B%5D=&to_year%5B%5D=&commit=Search

It's only when the solr op parameter is placed elsewhere, which is triggered by splitting the two terms on the homepage, that the AND parameter works here:

http://test.archivesspace.org/search?utf8=%E2%9C%93&op%5B%5D=&q%5B%5D=james&limit=&field%5B%5D=&from_year%5B%5D=&to_year%5B%5D=&op%5B%5D=AND&q%5B%5D=gunn&field%5B%5D=&from_year%5B%5D=&to_year%5B%5D=&commit=Search

All that said, it sounds like if the PUI search was harmonized with the SUI search, then things would work as expected here (although the SUI would need to be updated to be able to search for begin/end descriptive dates, since the PUI has that option as of 2.1).

I've also tested passing the "mm" parameter to the SUI (changing it from 1 to 2 and back again, for example), and that works perfectly. But just like trying to change the default operator in the PUI, it does not have any effect in the PUI right now even though the param is being picked up via this latest pull request.

@fordmadox
Copy link
Contributor

Also, I just performed the exact same search in the SUI and the PUI, and looked at the backend logs. Those are startling. I'll copy a bit of the SUI log here, which makes sense to me for the most part, and shows that the mm=2 value is not only passed but respected:

[java] May 03, 2018 5:25:08 PM org.apache.solr.core.SolrCore execute
[java] INFO: [collection1] webapp= path=/select params={mm=2&facet.field=primary_type&facet.field=creators&facet.field=subjects&csv.escape=&start=0&fq=repository:"/repositories/2"+OR+repository:global&fq=(-types:("pui_only")+AND+:)&fq=-exclude_by_default:true&sort=&rows=10&q=wedgwood+plates&facet.limit=100&defType=edismax&qf=four_part_id^3+title^2+finding_aid_filing_title^2+fullrecord&pf=four_part_id^4&csv.header=true&csv.encapsulator="&facet.mincount=0&wt=json&facet=true} hits=27 status=0 QTime=861

[java] D, [2018-05-03T17:25:08.454759 #5226] DEBUG -- : Thread-2010: Responded with [200, {"Content-Type"=>"application/json", "Cache-Control"=>"private, must-revalidate, max-age=0", "Content-Length"=>"216072"}, ["{"page_size":10,"first_page":1,"last_page":3,"this_page":1,"offset_first":1,"offset_last":10,"total_hits":27,"results":[{"id":"/repositories/2/resources/33","uri":"/repositories/2/resources/33","title":"Leighton (Clare) collection","primary_type":"resource","types":["resource","pui_collection","pui"],"json":"{\"lock_version\":2,\"ti... in 1434ms

@fordmadox
Copy link
Contributor

fordmadox commented May 3, 2018

And when I look at the logs for a PUI search, I'm quite confused because it seems to be repeating the repository OR searches over and over again. Anyhow, here's just a small bit that shows that the mm=2 param is passed but not utilized -- the number of search results, at 178, is because these two terms have been ORed together essentially, rather than both matching (as they both match in the SUI logs above); the number of results should actually be in the 20s, though, just like with the SUI:

[java] May 03, 2018 5:28:15 PM org.apache.solr.core.SolrCore execute
[java] INFO: [collection1] webapp= path=/select params={mm=2&q=(id:("/repositories/2")+OR+id:("/repositories/5")+OR+id:("/repositories/5")+OR+id:("/repositories/5")+OR+id:("/repositories/5")+OR+id:("/repositories/5")+OR+id:("/repositories/5")+OR+id:("/repositories/5")+OR+id:("/repositories/5")+OR+id:("/repositories/2")+OR+id:("/repositories/2")+OR+id:("/repositories/5")+OR+id:("/repositories/5")+OR+id:("/repositories/5")+OR+id:("/repositories/5")+OR+id:("/repositories/5")+OR+id:("/repositories/5")+OR+id:("/repositories/5")+OR+id:("/repositories/5")+OR+id:("/repositories/5"))&csv.escape=&csv.header=true&start=0&csv.encapsulator="&fq=-exclude_by_default:true&fq=suppressed:false&rows=500&wt=json&facet=true} hits=2 status=0 QTime=36
[java] D, [2018-05-03T17:28:15.193910 #5433] DEBUG -- : Thread-2016: Responded with [200, {"Content-Type"=>"application/json", "Cache-Control"=>"private, must-revalidate, max-age=0", "Content-Length"=>"778209"}, ["{"page_size":20,"first_page":1,"last_page":9,"this_page":1,"offset_first":1,"offset_last":20,"total_hits":178,"results":[{"id":"/repositories/2/resources/33","uri":"/repositories/2/resources/33","title":"Leighton (Clare) collection","primary_type":"resource","types":["resource","pui_collection","pui"],"json":"{\"lock_version\":2,\"t... in 2103ms

And I can also get the expected results by going to the solr console and performing the search directly there. So, something in the PUI code needs to be pared away it seems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants