The shs module is currently not compatible with search_api. The attached patch should provide it.

Issue fork shs-3029808

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jienckebd created an issue. See original summary.

nwom’s picture

Status: Active » Needs review
akram zairig’s picture

Title: Search API Support » Search API Support , Duplicates

Hello,
I've just tried using this patch, it adds SHS widget to search api views but i've got duplicate filters (default Dropdown + SHS).
Thank you,

nwom’s picture

Title: Search API Support , Duplicates » Search API Support
Status: Needs review » Needs work

Needs work based on the above comment.

chike’s picture

This patch worked for me and there are no duplicate filters as said in #3.

Thank you.

chike’s picture

One issue: trying to set the filter as required throws errors, yesterday it was giving error "An illegal choice has been detected." (if I remember the exact words) and now it says "No valid values found on filter: Content datasource: Business type." So not able to set the filter as required.

chike’s picture

Another issue: the first level shows the default option, (in my case) "-Any-" but when you make a selection and the second level loads, the default option is not displayed and to see the options you have to click and then you will see "-Any-" and the other options. Just a UX detail otherwise the filters work.

I just checked a colleague's screen and this issue is not there, but with different browsers I have the issue.

stborchert’s picture

Version: 8.x-1.x-dev » 2.0.x-dev

Moving to 2.0.x ...

MattDanger made their first commit to this issue’s fork.

Dylan Donkersgoed made their first commit to this issue’s fork.

nsalves’s picture

It seems the merge request was not yet approved so here's the patch rerolled for the rc3 release

chike’s picture

Using Drupal 10, patch #12 gives me duplicate filters when viewed as admin, one with SHS and the other a regular dropdown. Viewing as anonymous one only sees the regular dropdown and doesn't see the one with SHS.

chike’s picture

The issue I reported at #13 is not related to patch #12. I removed the patch and added a filter on a regular view (not using Search API) and the issue persisted. I opened a new issue about it.

tyler-durden’s picture

The patch in #12 looks like it will not work with the latest RC4 release, is that correct? I need this to work with D10, and I can't get the patch to apply to RC4.

tyler-durden’s picture

I was able to get patch #12 to apply to 10.0.7 with no issues, but when adding a taxonomy filter to a Search Index view, it does not go the the next settings screen and I have this error in my records.

Drupal\Component\Plugin\Exception\PluginException: Plugin (search_api_term) instance class "SearchApiShsTaxonomyIndexTid" does not exist. in Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass() (line 97 of web/core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php).

I cleared cache but that does not help, any other suggestions? Thanks!

wombatbuddy’s picture

The patch #12 did the job on Drupal 10.2.6.

heikkiy’s picture

Tested this patch also and it seems to work fine. One small issue I did notice is that in the normal dropdown widgets the All / Any option is first option in the select list. But in the SHS widget the Any option is last in the select list.

So basically the select list code looks like this:

<select>
<option value="1">Term 1</option>
<option value="2">Term 2</option>
<option value="All">- Any -</option>
</select>

If I have several exposed filters in the same view, it's a bit weird UX that in some of them the All option is first and in some it's the last.

anish.a’s picture

Any pointers to fix the issue where -Any- appears last?

anish.a’s picture

Status: Needs work » Reviewed & tested by the community
Related issues: +#3269746: "- Select a value -" appears at bottom of lists

The issue raised by heikkiy is already addressed by issue #3269746. This works fine and can be merged.

heikkiy’s picture

Thank you @anisha. I failed to find that issue when searching for the issue list and it does indeed fix the issue.

lus’s picture

What about the "ShsTaxonomyIndexTidDepth" would it need some more work to be able to use it with a Search API ?

  • joseph.olstad committed ff9f27f2 on 3.0.x
    [#3029808] feat: Search API Support
    
    By: jienckebd
    By: nwom
    By: chike
    By...

  • joseph.olstad committed 6a1a339b on 2.0.x
    [#3029808] feat: Search API Support
    
    By: jienckebd
    By: nwom
    By: chike
    By...
joseph.olstad’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.