1

SQLAlchemy has a .match() function that helps to search full-text. However, the default search is in BOOLEAN MODE. How can I change the BOOLEAN MODE to NATURAL LANGUAGE MODE?

Reason for doing this is because I need to search for hyphenated text and periods. I know there is this source: MySQL Full Text Period However, I don't want to change any source file or configure my MySQL settings.

How to change .match() function to NATURAL LANGUAGE MODE?

Ilja Everilä
  • 50,538
  • 7
  • 126
  • 127
biancang
  • 43
  • 2
  • 10
  • Looks like you cannot: https://github.com/sqlalchemy/sqlalchemy/blob/master/lib/sqlalchemy/dialects/mysql/base.py#L1281. You'll likely have better luck using the generic `op()` or `text()`. – Ilja Everilä Oct 29 '19 at 07:15
  • @IljaEverilä can I put the hyphenated words into a list/array and use .like() for each value in the array? – biancang Oct 29 '19 at 08:46

0 Answers0