The module is used to exclude a node (or entity) based on the value of a specific serach_api_exclude_entity field. This feature is useful to mark as a no-index content manually.
However it has some limitations:
-> Entities without bundles cannot be filtered because cannot contain the field.
-> The content have to be excluded manually.
I have another complementary approach to resolve the problem, excluding a entity which a field has an specific value (and it's a first version, I want to make it more flexible).
I though about create a new module (because the behavior is different) but I think that is not the best idea to have several modules to exclude things in search api, and maybe we can merge our code (furthermore, the module is still very light).
can you take a look? If you like the behavior I can refine the feature and improve it (creating, for example, a combo box to select the operator between '<', '>' '=','NOT IN', 'IN', '!=', etc. and maybe create a multivalue form in place of list all fiedls.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 0001-Issue-3055325-Exclude-entity-based-on-a-field-value.patch | 5.15 KB | estoyausente |
Issue fork search_api_exclude_entity-3055325
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
Comment #2
estoyausenteComment #3
smustgrave commentedAs of today helping co-maintain this module.
Took a look at the patch and seems like it could lead to a lot of confusion, seems like a great feature at the field level and could be related to https://www.drupal.org/project/search_api_exclude_entity/issues/3264229
What if I wanted to auto exclude on Articles if tagged as foobar but other content types with that value are fine. Won't this exclude all because it's at the processor level.
Also if we are auto excluding but leaving the field could be confusing to an end user.
For me it's a no go for the main module with the confusion it could leave for editor but that being said maybe as a submodule? With a detailed README for the use case and how to use. That way most users of this module won't have to deal with it but the option is there.
Comment #4
smustgrave commentedSo we do have #3264229: Exclude based on noindex from metatag which seems more inline for this module.
This feature still feels like it could be a submodule or it's own.
Thoughts?
Comment #5
anybodyYeah still makes sense as submodule. It would be helpful in cases where you want a separate option and can't reuse noindex or sitemap-exclusion for any reasons.
As written in #3264229: Exclude based on noindex from metatag the code should be quite similar in all of these? Just the boolean source is different. This might still be an easier one.
Comment #7
smustgrave commentedComment #8
smustgrave commentedComment #9
anybodyNice, planned for review by our team! :)
Comment #10
estoyausentewow, happy to see this. Currently I'm not using the module and I don't remenber the context where I created it, but thanks for incluiding!
Comment #11
smustgrave commentedStill need to see how it works with non text fields like entity references. Or we limit the fields settings to just text fields for now
Comment #12
smustgrave commentedThink it needs a little work around non text fields. Or we exclude non text fields from the form.
Comment #14
smustgrave commentedLets take a risk and go ahead and include this.