Juergen Posted June 5, 2021 Share Posted June 5, 2021 Hello at all, I have created a new fieldtype with multiple fields (database columns) in it. More precisely it holds various company data (fe. company name, street, phone,...) - each in 1 database column. I want to make these values searchable in the site search, but it always shows me that the selector '~=' is not implement. It accepts '=' as a selector but not '~='. How can I implement this specific selector inside a fieldtype, so it does not throw me an error all the times, if I run a query with this selector. Thank you PS: My fieldtype class extends from Fieldtype Link to comment Share on other sites More sharing options...
Juergen Posted June 6, 2021 Author Share Posted June 6, 2021 Ok, I got it: Updating my Fieldtype file with this method solved my problem. I found this method inside the FieltypeText.module file. /** * Update a query to match the text with a fulltext index * * @param PageFinderDatabaseQuerySelect $query * @param string $table * @param string $subfield * @param string $operator * @param int|string $value * @return DatabaseQuerySelect * */ public function getMatchQuery($query, $table, $subfield, $operator, $value) { $ft = new DatabaseQuerySelectFulltext($query); $ft->match($table, $subfield, $operator, $value); return $query; } Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now