Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fluent breaks silverstripe's fulltext filter (not SearchForm!) #797

Open
sirtoobii opened this issue May 24, 2023 · 0 comments
Open

Fluent breaks silverstripe's fulltext filter (not SearchForm!) #797

sirtoobii opened this issue May 24, 2023 · 0 comments

Comments

@sirtoobii
Copy link

sirtoobii commented May 24, 2023

When using the Fulltext filter as documented here, Fluent augments the query with COALESCE which is not compatible with the MATCH, AGAINST syntax.

Steps to reproduce

  • Create a locale in the CMS backend
  • Add a Fulltext index for Content and Title:
SilverStripe\CMS\Model\SiteTree:
  indexes:
    FullTextSearch:
      type: fulltext
      columns: ['Title', 'Content']
  • Setup a dummy controller:
<?php

use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Control\Controller;

class TestController extends Controller
{
    public function index($request) {
        $query = $this->getRequest()->getVar('q');
        return SiteTree::get()->filter('FullTextSearch:Fulltext', $query)->first()->Title;
    }

}
  • Add route:
SilverStripe\Control\Director:
  rules:
    'search/': 'TestController'
  • Run a search query: http://localhost:8474/search?q=silverstripe

ENV

Silverstripe: 4.13.1
Fluent: 6.0.0
PHP: 7.4

@sirtoobii sirtoobii changed the title Fluent breaks silverstrip's fulltext filter (not SearchForm!) Fluent breaks silverstripe's fulltext filter (not SearchForm!) May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant