Changing search bar form from searching Titles of Works in..

62 views
Skip to first unread message

Scott Kushner

unread,
Jan 29, 2021, 7:02:55 PM1/29/21
to samvera-tech

Subcollection to searching KEYWORD full-text of this Collection...

It says here, in the documentation...


  • Presenters are not used for new/edit forms. Instead, Form objects are used. Form objects work similarly to Presenters, but include some additional features for dealing with forms, such as specifying which fields should be required.
Ok, where are these "form object" parameters defined?  i give up...

I want to tell the form to search by keyword in the Collection "Liberty State Park"...not by Title of the Subcollection. 

Any help is greatly  appreciated...

Thank you,


LibertyStatePark.jpg

jlha...@iu.edu

unread,
Feb 3, 2021, 1:35:13 PM2/3/21
to samvera-tech
Hi Scott - Can you provide some more information? 

This is what I am understanding but I don't know if this is correct:

It sounds like you have nested collections and the overall search right now is only returning results based on the title field of works in the subcollections. Is that correct? And you are interested in expanding that or changing that to return results based on full-text searching of all of the metadata fields for works across all of the collections (collections and subcollections) and not just the work title field?

Thanks for providing any further details possible.
Julie

Scott Kushner

unread,
Feb 3, 2021, 3:29:15 PM2/3/21
to samver...@googlegroups.com
Hi Julie: 


That's close, but not quite what I'm trying to accomplish....

I would like to change the search query from searching only Titles in the Collection, to searching keyword full-text WITHIN THIS COLLECTION..only!

I'm not sure where the Search Form is being told to "Search the Titles Within the Collection" in the Hyrax codebase.
I would like it to search the by keyword the full-text within this collection. 

Thanks for any help you can provide, and your reply. 

-Scott





--
You received this message because you are subscribed to a topic in the Google Groups "samvera-tech" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/samvera-tech/vcES6RHaoXc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to samvera-tech...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/samvera-tech/910d9257-38f3-4ba9-a8ff-9367c91da8d1n%40googlegroups.com.


--
Scott Kushner
Systems and Emerging Technologies Librarian

Saint Peter's University

The Jesuit University of New Jersey

Theresa & Edward O'Toole Library
99 Glenwood Ave.
Jersey City, New Jersey 07306

p: (201) 761-6456
f:  (201) 761-6451

Chris Colvard

unread,
Feb 3, 2021, 5:00:33 PM2/3/21
to samver...@googlegroups.com
I'm not entirely sure but I suspect that it should be searching by keyword already. 

The important bits here are the controller handling the search request is using the Collections::CollectionMemberService which uses Hyrax::CollectionMemberSearchBuilder.  This search builder is getting passed a `q` param (https://github.com/samvera/hyrax/blob/7878b18d02814f07df6276534a50c46faf5cb868/app/controllers/concerns/hyrax/collections_controller_behavior.rb#L110-L116) which should search over the same fields the CatalogController searches.  By default this includes `keyword_tesim` (https://github.com/samvera/hyrax/blob/7878b18d02814f07df6276534a50c46faf5cb868/lib/generators/hyrax/templates/catalog_controller.rb#L32) but maybe that's been customized within your application or doesn't match up with how your keyword is getting indexed.  Hopefully this is enough to go on.  Good luck!

-Chris

You received this message because you are subscribed to the Google Groups "samvera-tech" group.
To unsubscribe from this group and stop receiving emails from it, send an email to samvera-tech...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/samvera-tech/CAFWyUwCR5nW1qs0D2naO4eQv3toXJHAVNof-uae%3DwVo1tDPLXg%40mail.gmail.com.

Scott Kushner

unread,
Mar 14, 2021, 3:36:48 PM3/14/21
to samvera-tech
Thanks, Chris

But what the method [cq] is actually doing is searching the full-text of the Title field of the collection, and not the full-text of the indexed pdf documents in the Collection. 

I'm trying to limit the full-text search to the Collection, and not the whole Repository, but I'm not sure where or how to do that. 

Thanks for your help!


# You can override this method if you need to provide additional inputs to the search

# builder. For example:

# search_field: 'all_fields'

# @return <Hash> the inputs required for the collection member query service

def params_for_query

params.merge(q: params[:cq])

I think that I have to specify this somewhere in the search form for Collections, which is [cq], no? 

Chris Colvard

unread,
Mar 17, 2021, 12:27:16 PM3/17/21
to samver...@googlegroups.com
Scott,
Sorry I don't think I have any more time to help with this.  My last email is my best guess at where to start looking.  Good luck!
-Chris

Reply all
Reply to author
Forward
0 new messages