系统运维

Postgres 的全文搜索已经足够好了

时间:2010-12-5 17:23:32  作者:IT科技类资讯   来源:IT科技类资讯  查看:  评论:0
内容摘要:复制CREATETABLEauthor( idSERIALPRIMARYKEY, nameTEXTNOTNULL); CREAT

Postgres 的全文搜索已经足够好了
复制CREATETABLE author(      id SERIAL PRIMARYKEY,文搜   name TEXT NOTNULL);   CREATETABLE post(      id SERIAL PRIMARYKEY,      title TEXT NOTNULL,      content TEXT NOTNULL,      author_id INTNOTNULLreferences author(id) );   CREATETABLE tag(      id SERIAL PRIMARYKEY,   name TEXT NOTNULL );   CREATETABLE posts_tags(      post_id INTNOTNULLreferences post(id),      tag_id INTNOTNULLreferences tag(id)    );   INSERTINTO author (id, name)    VALUES (1, Pete Graham),           (2, Rachid Belaid),           (3, Robert Berry);   INSERTINTO tag (id, name)    VALUES (1, scifi),           (2, politics),           (3, science);   INSERTINTO post (id, title, content, author_id)    VALUES (1, Endangered species, Pandas are an endangered species, 1 ),           (2, Freedom of Speech, Freedom of speech is a necessary right missing in many countries, 2),           (3, Star Wars vs Star Trek, Few words from a big fan, 3);   INSERTINTO posts_tags (post_id, tag_id)    VALUES (1, 3),           (2, 2),           (3, 1);  1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.30.31.32.33.34.
copyright © 2025 powered by 编程之道  滇ICP备2023006006号-34sitemap