Make the Advanced Search default for everything

Hello,

I have the Advanced Search installed. I’d like it to be the default search for everything happening on my site. For instance, with the Metadata Browse plugin, when I click on a link generated by that plugin (say, a field which shares the same values with others), I’d like to go to the /find page, i.e. the Advanced Search, and not the ?item= page. I think that is confusing for the users, and also in the latter I don’t have things like facets etc.

1 Like

Hello @luca.g

I have been wondering the same thing.
For now, I have used several strategies. I have hidden omeka’s advanced search buttons from the items and item sets browsing views as well as deleted the header search bar. I have replaced it with a solr advanced search bar (leading to my solr search page) and customized it through the css editor so it resembles a basic search bar. This way, visitors cannot access the omeka search page and are forced into the solr search page.
For the metadata browse redirection, there does not seem to be any compatibility at this hour. I have tested using the .htaccess redirect with these lines:

#Redirect from a Browse Metadata search to get to the advanced search page
RewriteCond %{REQUEST_URI} ^\/s\/site_name\/item$
RewriteCond %{QUERY_STRING}  ^.*=(.*[^$])$
RewriteRule  ^s/bibnum/item$ /s/site_name/search?q=%1 [NE,L,R=301]

However, the metadatabrowse search query also selects a specific metadata type in which to run the text query. Reducing it to a simple ?q=previous_query does not allow for the same precision. And so for each property you have in Metadata browse you would have to develop a specific redirection with the filter in the advanced search query, and I have not done that yet…

Another lead you could follow is the search.phtml file in your theme and how to modify it to the one corresponding to the solr advanced search but I have no clue how you would go about it.

I hope someone has other suggestions! And thanks in advance,

1 Like

Hello there,

For anyone interested, I have come up with a more precise RewriteRule for my .htaccess file. Basically, there is a rule for each type of metadata browse search I wanted linked to an advanced search query. Of course, these properties and their format must exist in the advanced search page filters you have designed. For my part, I took a “txt” approach (and I have Solr).

#Redirect from a Browse Metadata search to get to the advanced search page  by Creator
RewriteCond %{REQUEST_URI} ^\/s\/bibnum\/item$
RewriteCond %{QUERY_STRING}  ^.*property%5D=2&.*=(.*[^$])$
RewriteRule  ^s/bibnum/item$ /s/bibnum/search?filter[0][field]=dcterms_creator_txt&filter[0][type]=eq&filter[0][value]=%1 [NE,L,R=301]

#Redirect from a Browse Metadata search to get to the advanced search page  by Subject
RewriteCond %{REQUEST_URI} ^\/s\/bibnum\/item$
RewriteCond %{QUERY_STRING}  ^.*property%5D=3&.*=(.*[^$])$
RewriteRule  ^s/bibnum/item$ /s/bibnum/search?&filter[0][field]=dcterms_subject_txt&filter[0][type]=eq&filter[0][value]=%1 [NE,L,R=301]

#Redirect from a Browse Metadata search to get to the advanced search page  by Contributor
RewriteCond %{REQUEST_URI} ^\/s\/bibnum\/item$
RewriteCond %{QUERY_STRING}  ^.*property%5D=6&.*=(.*[^$])$
RewriteRule  ^s/bibnum/item$ /s/bibnum/search?&filter[0][field]=dcterms_contributor_txt&filter[0][type]=eq&filter[0][value]=%1 [NE,L,R=301]

#Redirect from a Browse Metadata search to get to the advanced search page  by Date
RewriteCond %{REQUEST_URI} ^\/s\/bibnum\/item$
RewriteCond %{QUERY_STRING}  ^.*property%5D=7&.*=(.*[^$])$
RewriteRule  ^s/bibnum/item$ /s/bibnum/search?&filter[0][field]=dcterms_date_txt&filter[0][type]=eq&filter[0][value]=%1 [NE,L,R=301]

#Redirect from a Browse Metadata search to get to the advanced search page  by Type
RewriteCond %{REQUEST_URI} ^\/s\/bibnum\/item$
RewriteCond %{QUERY_STRING}  ^.*property%5D=8&.*=(.*[^$])$
RewriteRule  ^s/bibnum/item$ /s/bibnum/search?&filter[0][field]=dcterms_type_txt&filter[0][type]=eq&filter[0][value]=%1 [NE,L,R=301]

#Redirect from a Browse Metadata search to get to the advanced search page  by Type
RewriteCond %{REQUEST_URI} ^\/s\/bibnum\/item$
RewriteCond %{QUERY_STRING}  ^.*property%5D=14&.*=(.*[^$])$
RewriteRule  ^s/bibnum/item$ /s/bibnum/search?&filter[0][field]=dcterms_coverage_txt&filter[0][type]=eq&filter[0][value]=%1 [NE,L,R=301]

I hope this helps some of you. I wish I had the ability to come up with an automatic or an admin way of dealing with the whole “convert to an advanced search”.