Hi,

I am using Search API Database search in my site.
I created search page using views and added fulltext search in the filters.
When I tried to search for 'All' Keyword in the FullText search, instead of pulling the nodes having 'All' in the content of the nodes it is listing all the nodes .
But the same is not happening when I search with keyword 'all'.

Did anyone face similar issues in your sites?
If yes, can you please let me know the solution for this problem?

Thanks,
Krishna.

Comments

krishna savithraj created an issue. See original summary.

krishna savithraj’s picture

I think this issue is with the Views module. The base Views filter handler has the below code which is causing this issue.

if ($this->operator != 'empty' && $this->operator != 'not empty') {
          if ($value == 'All' || $value === array()) {
            return FALSE;
          }
        }

anyone has idea to override this condition in a better way.

Thanks,
Krishna.

drunken monkey’s picture

Project: Search API Database Search » Search API
Version: 7.x-1.4 » 7.x-1.x-dev
Component: Code » Views integration
Status: Active » Needs review
StatusFileSize
new1.91 KB

Oh, wow, you're right! Thanks for reporting, that's really stupid …
Also great that you already found the culprit. Unfortunately, it seems there is no simple way of changing this behavior, we have to override the complete method. Patch attached, please test/review!

krishna savithraj’s picture

I have tested this and it works fine with the change.

Thanks for the patch!

drunken monkey’s picture

Status: Needs review » Fixed

Thanks for testing, glad to hear it works.
Committed.

  • drunken monkey committed d0cedab on 7.x-1.x
    Issue #2603500 by drunken monkey, krishna savithraj: Fixed Views...

Status: Fixed » Closed (fixed)

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