(Attaching the patch from current MR)

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

Andras_Szilagyi created an issue. See original summary.

Julien Tekrane made their first commit to this issue’s fork.

julien tekrane’s picture

Issue summary: View changes
Status: Active » Needs review
vensires’s picture

Status: Needs review » Reviewed & tested by the community

It's been a year I am using the patch in various projects so - now that we have a stable release - it's time I set it as RTBC.

julien tekrane’s picture

Dear @vensires, thank you for your appreciation but my PR does not contain tests so the maintainers will not merge it. I don't have dedicated time to implement it, I leave the floor to whoever wants it

vensires’s picture

Issue tags: +Needs tests

Thank you for your effort nevertheless!
I will keep it as RTBC until the maintainers decide otherwise. For now, I just add the tag "Needs tests".

carolpettirossi’s picture

I'm using the MR code along with an Aggregate Fulltext field successfully
Thank you so much for contributing =D

vensires’s picture

For a website of ours, I use this fulltext facet filter to search for keywords. The client asked that whether user searches for "foo bar" or "bar foo" the returned result should be the same. I tried playing around tampering the query using proper Search API Events but instead fell back on changing the original patch from this issue's MR (attached) so that the 'LIKE' operator uses multiple conditions instead using AND.

I'm sharing this here too in case we would like a different approach for this or propose a different operator... Maybe...

if ($operator === 'LIKE') {
  $or_condition_group = $this->query->createConditionGroup('AND');
  $tokens = preg_split('/\s+/', trim($this->fulltext->getSearch()), -1, PREG_SPLIT_NO_EMPTY);
  foreach ($tokens as $token) {
    $or_condition_group->addCondition($this->facet->getFieldIdentifier(), $token);
   }
   $this->query->addConditionGroup($or_condition_group);
}
vensires’s picture

Issue summary: View changes
StatusFileSize
new13.96 KB
julien tekrane’s picture

Status: Reviewed & tested by the community » Needs review

Dear maintainers,

I implemented tests. Pipeline is red due to extra config of the project. Can you please approve and embed it in the next Release ?

andras_szilagyi’s picture

StatusFileSize
new73.06 KB

I'm adding a patch with the current state in case anybody is relying on the MR as a patch

andras_szilagyi’s picture

Status: Needs review » Needs work

Generally speaking looks good, just needs a fix and a few minor improvements.

andras_szilagyi’s picture

Also tests are red

willsstrong’s picture

Patch won't apply on v1.2.0. There seems to be a mismatch with the README.md file.

willsstrong’s picture

StatusFileSize
new37.54 KB

This patch works with v1.2.0. The only difference is that no changes are made to the README.md file.

julien tekrane’s picture

Status: Needs work » Needs review
andras_szilagyi’s picture

Status: Needs review » Reviewed & tested by the community

I had to fix the schema and added some testing. Regarding testing the "Like" operator was not working out of the box. I had to remove the Like for now as I was contacted with the urgency of this issue and want to move on, so @vensires please open up a follow up please.

andras_szilagyi’s picture

For anyone needing the "Like" till then, please see https://www.drupal.org/project/search_api/issues/3033665

andras_szilagyi’s picture

Status: Reviewed & tested by the community » Fixed

I merge, there was a pipeline error during the merge due to a HTTP 500 error
"Error: Server answered with HTTP 500 when performing the request to https://repo.yarnpkg.com/4.9.1/packages/yarnpkg-cli/bin/yarn.js"
seems unrelated so I'm closing this issue as Fixed

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

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

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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