Hello,

I use a fulltext field to filter results by specific words.
It's working. But, when I want to change the operator with a negative operator (not contains these words), I get no results.

Is there a bug in the views query ?

In several posts we can see that we must alter the views query to create a negation on words. Do I create a custom code to filter results by negative words?

Thanks.

Comments

kumkum29 created an issue. See original summary.

drunken monkey’s picture

Status: Active » Postponed (maintainer needs more info)

This works fine for me. Please provide more details.

kumkum29’s picture

Hi Thomas,

I have tested a new view with only 1 field and 1 filter.
In my nodes, I have a field called 'field_place'. This field is populated with different words, e.g. : place1, place2, place3...

1- If I use a filter from a Content datasource (my field field_place), I can't saving the view and I get the described error in this post:
https://www.drupal.org/project/search_api/issues/3003115

2- I tried to use 1 another filter with a fulltextField. With this filter I can to save my view, and I get no errors.
In the filter settings, If I define a specific 'word' in the field value and choose 'contains any words' as operator, it's OK. I get nodes with the desired word from the field_place.
But, If I inverse this operator, 'not contains any words', I get no results...

I use in 'parse mode' the 'multiple words' option and I choose my field in the select list of fields.
In the search API settings, my field (field_place) is defined with a 'text' type. The index is active.
In the processors page, these options are checked : entity status, ignore case, access to content.

Thanks for your help.

P.S. I have making a new test with a Content datasource as filter, it's ok with the 2 cases, contain / and not contains words...but I can't to save my view and I get the described error above.
We see an identical bug in several posts, e.g. : https://www.drupal.org/project/webform_views/issues/2901616

drunken monkey’s picture

Which server backend are you using? If you’re not using the “Database” backend, please try whether it works with that one.

drunken monkey’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)