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

Release Advanced Search as stand alone Drupal module #1851

Open
Natkeeran opened this issue Jun 17, 2021 · 9 comments
Open

Release Advanced Search as stand alone Drupal module #1851

Natkeeran opened this issue Jun 17, 2021 · 9 comments
Labels
Subject: Drupal related specifically to Drupal, usually pointing somewhere on drupal.org

Comments

@Natkeeran
Copy link
Contributor

Islandora Advanced Search supports Boolean search for Solr indexed fields. Currently, it does require facets and Apache Solr; however, there are tickets (#1819, #1822) to explore if it can be setup without facets and possibly Solr.

One can assume that even with Solr, there would be many other Drupal users who would like to have this functionality. Thus, releasing this as stand alone Drupal module may provide additional visibility and use outside of Islandora as well.

It does use node_has_term from Islandora in the islandora_advanced_search_form_block_form_alter. If that can be moved to configuration or documentation, this module can be made into a separate Drupal module.

Current installation should be able to uninstall the submodule and install this module, then setup the block again!

@MarcusBarnes MarcusBarnes changed the title Release Advance Search as stand alone Drupa module Release Advance Search as stand alone Drupal module Jun 17, 2021
@MarcusBarnes MarcusBarnes changed the title Release Advance Search as stand alone Drupal module Release Advanced Search as stand alone Drupal module Jun 17, 2021
@kylehuynh205
Copy link

Just note which I mentioned during our Tech call today, the two things which I found Advanced Search sub-module requires components from Islandora Core module are:

@kylehuynh205
Copy link

kylehuynh205 commented Sep 17, 2021

We split the submodule from Islandora module to have it work as a stand-alone Drupal module https://github.com/digitalutsc/advanced_search

We also developed a couple of new features (in islandora_lite branch) when we implemented Advanced Search for our Islandora Lite stack:

  • Added Lucene Search capability (commit), and it can be turned on/off.
  • Added Simple Search block which is associated with Advanced Search Results View Page (commit).

@kylehuynh205
Copy link

@nigelgbanks, please kindly review. Thanks.

@nigelgbanks
Copy link
Member

@kylehuynh205 cheers for pinging me, I've been on a long break from work and haven't been following along with developments for some time. I'll do a review on Monday.

@kstapelfeldt kstapelfeldt added Subject: Drupal related specifically to Drupal, usually pointing somewhere on drupal.org and removed drupal labels Sep 25, 2021
@nigelgbanks
Copy link
Member

Sorry took me a while to get around to this.

For references the differences from what's currently in the main branch of islandora digitalutsc/advanced_search@8.x-1.x...islandora_lite

To test the islandora_lite branch I just removed the existing module from the isle-dc demo setup and did a git clone and switched branches before installing the module.

N.B Had some super weird glitch with the default search view that I don't think is related to this at all (in that it wouldn't display results). When building a new search page manually though everything was fine so I suspect there is something odd in the yaml configuration that is used to setup the isle-dc demo. So for those looking to replicate my steps be aware.

I tested with search_api_solr version 4.2.0 which should use Lucene as the default query processor but I didn't see the All option in the advanced search form when testing as was mentioned in the README. Maybe additional steps are required? Ah seems there is some additional settings for the module configuration which controls this feature. Enabling that feature did get it to show up, but then using that as a search field didn't seem to give any results at all maybe more configuration is required?

For the Simple search block I also had the same issue in that it didn't seem to filter the results. Not sure what is going on there yet.

As a side note I've used the built-in form for the view to do similar behaviour to simple search block using the filter criteria Fulltext search and exposing the view form as a block. Though that doesn't integrate with the advance search block as this one does by populating the All option on submission. Though it does work with Ajax.

I guess it depends on if the intention is to have something similar to how the view filter criteria form block works, for example the search for calico would generate a Solr search query like:

(tm_X3b_en_field_description:("calico")^1 tm_X3b_und_field_description:("calico")^1 tm_X3b_en_field_edited_text:("calico")^1 tm_X3b_und_field_edited_text:("calico")^1 tm_X3b_en_rendered_item:("calico")^1 tm_X3b_und_rendered_item:("calico")^1 tm_X3b_en_title:("calico")^8 tm_X3b_und_title:("calico")^8)

The above depends on your sites configuration.

Where as with the All field I get a query like:

{!boost b=boost_document} "calico"

In reviewing the standard query processor aka lucene query processor in this case calico should be searched across the default field which is typically id by default hence why I get no results.

This check seems to remove the ability to limit the block to display only on particular content models which I've and potentially others have used for collection only searches. I'm not sure the intention for adding it?

I very much like the idea of having a field in the advanced search block that allows one to "search all fields", though I think we need to define those fields in a way that is similar to the existing functionality in Solr Search API module. We could use the same existing configuration most likely.

@nigelgbanks
Copy link
Member

As for releasing the module completely separate from islandora, I'm not sure its worth the burden to support for the wider Drupal community. I don't have the bandwidth to fix non-islandora related issues from others use cases and it would expand the scope of the module in some ways, making maintenance harder. I wouldn't appose the decision though, but I'm also unlikely to do much work to support non-islandora use cases.

@kylehuynh205
Copy link

My apology for the super late response, @nigelgbanks. Thank you for you feedbacks. I'll take a closer look on your feedback and get back to you soon. Thanks.

@kylehuynh205
Copy link

Sorry, @nigelgbanks about taking long time to get back to this issue. I found that {!boost b=boost_document} is the reason which cause the no search results. I comment it out in this commit and Lucene seach is working as expect.

I am wondering if this line is needed for a specific use case ? I comment it out in the original branch 8.x-1.x and everything still works. Thanks.

@nigelgbanks
Copy link
Member

@kylehuynh205 there is a solr field boost_document that is used to change the order of results this document has a pretty good overview. This particular field is used by search_api_solr to what extent is this important to users I do not know. Though what I can glean from the solr documentation is that it's only valid for eDismax queries, so it makes sense that it messes with the lucence query.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Subject: Drupal related specifically to Drupal, usually pointing somewhere on drupal.org
Projects
Status: No status
Development

No branches or pull requests

4 participants