首页IT科技django怎么读(Django and fulltext search)

django怎么读(Django and fulltext search)

时间2025-06-18 21:31:33分类IT科技浏览4921
导读:Django and full-text search...

Django and full-text search

Lately I’ve been searching for a simple solution for full-text Model search using Django. Every task up to this point just seemed so easy, so I was a bit surprised to discover there’s no quick, clean and preferred way to go about adding site search functionality in the framework.

So far, the information I read seems to suggest existing solutions are:

Based on a dedicated full-text search module djangosearch Supposed to become the official search contrib. Rather recent history (during 2008). It’s an framework over existing, dedicated full text indexing engines: Lucene (Java version) Solr (still Java, and also based on Lucene) Xapian (C++) HyperEstraier django-sphinx Wrapper around Sphinx full-text search engine Based on a database engine full-text capability (ie. you must create full text indexes with appropriate DB commands) For the MySQL backend, there’s already a “fieldname__search             ” syntax already supported in the framework, translating into a MATCH AGAINST query in SQL. Supports basic boolean operators Reference (look at the conclusion of the article) For PostgreSQL, depending on the version of the engine, there are solutions, but they seem complex, relative to the MySQL approach Most simple, but very inefficient: based on a simple LIKE %keyword% query Uses the “fieldname__icontains                    ” filter syntax That’s what I used temporarily for get the feature going in my prototype

Other approaches are mentioned in this thread on StackOverflow.

声明:本站所有文章             ,如无特殊说明或标注                    ,均为本站原创发布             。任何个人或组织       ,在未征得本站同意时             ,禁止复制             、盗用                    、采集       、发布本站内容到任何网站      、书籍等各类媒体平台                    。如若本站内容侵犯了原著者的合法权益                   ,可联系我们进行处理       。

创心域SEO版权声明:以上内容作者已申请原创保护,未经允许不得转载,侵权必究!授权事宜、对本内容有异议或投诉,敬请联系网站管理员,我们将尽快回复您,谢谢合作!

展开全文READ MORE
抖音星图任务可以投豆荚吗安全吗任务网发布哪些-抖音达人怎么投稿星图课堂?来看操作指南吧 android瀑布流布局(瀑布流使用虚拟列表性能优化)