MySQL FULLTEXT with custom parser (e.g. ngram) fails to reflect
See original GitHub issueMigrated issue, originally created by LiQuan (@loveiset)
My existing table created with following sql
CREATE TABLE `fx_orders_items` (
.....
FULLTEXT KEY `ix_fulltext_oi_g_name` (`oi_g_name`) /*!50100 WITH PARSER `ngram` */
) ENGINE=InnoDB AUTO_INCREMENT=100018857 DEFAULT CHARSET=utf8 COMMENT=''
when I use autoload like this
Table("fx_orders_items", metadata, autoload=True)
it throws error
C:\Python27\lib\site-packages\sqlalchemy\dialects\mysql\reflection.py:57: SAWarning: Unknown schema content: u' FULLTEXT KEY `ix_fulltext_oi_g_name` (`oi_g_name`) /*!50100 WITH PARSER `ngram` */ '
util.warn("Unknown schema content: %r" % line)
I just debug it and found the line
FULLTEXT KEY `ix_fulltext_oi_g_name` (`oi_g_name`) /*!50100 WITH PARSER `ngram` */
didn’t go into any of this and return None
def _parse_constraints(self, line):
"""Parse a KEY or CONSTRAINT line.
:param line: A line of SHOW CREATE TABLE output
"""
m = self._re_key.match(line)
m = self._re_fk_constraint.match(line)
m = self._re_ck_constraint.match(line)
m = self._re_partition.match(line)
# No match.
return (None, line)
Issue Analytics
- State:
- Created 6 years ago
- Comments:12
Top Results From Across the Web
MySQL 5.7 Reference Manual :: 12.10.8 ngram Full-Text Parser
To create a FULLTEXT index that uses the ngram parser, specify WITH PARSER ngram with CREATE TABLE , ALTER TABLE , or CREATE...
Read more >MySQL - How to search a single character with fulltext index
Yes, it is possible to use full-text search with a single character. You should set ngram_token_size to 1. However, there are some problems...
Read more >Planning to support Full-text index with Ngram parser? - Help
Hi, When will MemSQL's full-text search (FTS) support parsers like MySQL's ngram? Creating a full-text index using the ngram parser for ...
Read more >MySQL and MariaDB — SQLAlchemy 2.0 Documentation
MySQL / MariaDB Unique Constraints and Reflection ... CREATE FULLTEXT INDEX in MySQL also supports a “WITH PARSER” option.
Read more >nGram full text search (by 이성욱) - SlideShare
(https://bugs.mysql.com/bug.php?id=85875) Stopword handling for ngram parser is a little bit weird. Ngram fulltext parser does not index all ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Michael Bayer (@zzzeek) wrote:
Render and reflect MySQL WITH PARSER index options
Support added for the “WITH PARSER” syntax of CREATE FULLTEXT INDEX in MySQL, using the
mysql_with_parser
keyword argument. Reflection is also supported, which accommodates MySQL’s special comment format for reporting on this option as well. Additionally, the “FULLTEXT” and “SPATIAL” index prefixes are now reflected back into themysql_prefix
index option.Change-Id: I0209291978125d8cee1bb5ed386d4f66578697a0 Fixes: #4219
→ 6c2a1e176086
Changes by Michael Bayer (@zzzeek):