﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
22489	Missing as_sql() implementation for __search lookup	Jakub Roztočil	nobody	"The (MySQL-only) __search full-text lookup isn't properly implemented using the new ORM lookup system. It's use results to a runtime exception:


{{{
>>> MyModel.objects.filter(field__search='hello world')
[...]
 return node.as_sql(self, self.connection)
  File ""/site-packages/django/db/models/sql/where.py"", line 106, in as_sql
    sql, params = qn.compile(child)
  File ""/site-packages/django/db/models/sql/compiler.py"", line 80, in compile
    return node.as_sql(self, self.connection)
  File ""/site-packages/django/db/models/sql/where.py"", line 106, in as_sql
    sql, params = qn.compile(child)
  File ""/site-packages/django/db/models/sql/compiler.py"", line 80, in compile
    return node.as_sql(self, self.connection)
  File ""/site-packages/django/db/models/lookups.py"", line 150, in as_sql
    rhs_sql = self.get_rhs_op(connection, rhs_sql)
  File ""/site-packages/django/db/models/lookups.py"", line 154, in get_rhs_op
    return connection.operators[self.lookup_name] % rhs
KeyError: 'search'
}}}


I've opened a pull request here:

https://github.com/django/django/pull/2597

"	Bug	closed	Database layer (models, ORM)	dev	Normal	fixed	mysql, search, full-text, __search, lookup		Accepted	1	0	1	0	0	0
