如何在mysql中同时使用全文索引和普通索引

vaj7vani  于 2021-06-20  发布在  Mysql
关注(0)|答案(0)|浏览(466)

我在mysql数据库中有一个非常大的表,我第一次查询这么大的表。附言:大约200万排,40克大小。
这是一个新闻表,所以我在字段上有一个全文索引 content ,但我还需要按日期和其他条件排序结果。
我试着在这个领域建立正常的索引 date 但失败了。我在谷歌上搜索过,不能同时使用普通索引和全文索引。
假设我有一张这样的table

  1. mysql> select * from test;
  2. +----+--------+------+------------+------------------+
  3. | id | title | tag | date | content |
  4. +----+--------+------+------------+------------------+
  5. | 38 | title1 | a | 1514521364 | looooong content |
  6. | 39 | title2 | a | 1514521364 | looooong content |
  7. | 40 | title3 | b | 1514521364 | looooong content |
  8. | 41 | title4 | c | 1514521364 | looooong content |
  9. | 42 | title5 | NULL | 1514521364 | looooong content |
  10. +----+--------+------+------------+------------------+
  11. 5 rows in set (0.00 sec)

现在它有了全文索引 content ,上的正常索引 title , tag 以及 date . 我怎么能做到呢。太多了。这个问题已经困扰我好几天了。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题