{ "info": { "author": "Alex Berezovskiy", "author_email": "letoosh@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: BSD License", "Topic :: Utilities" ], "description": "===========================\nDjango-Whoosh search engine\n===========================\n\nDjoosh is a very simple search engine for your Django projects.\n\nWARNING: This is currently under heavy development, so use at your work risk!\n\nInstallation\n============\n\n#. Install with pip:\n\n\t``pip install djoosh``\n\n#. Add `djoosh` to `INSTALLED_APPS` in your `settings.py`::\n\n\tINSTALLED_APPS = (\n\t\t'django.contrib.auth',\n\t\t'django.contrib.contenttypes',\n\t\t'django.contrib.sessions',\n\t\t'django.contrib.sites',\n\t\t...\n\t\t'djoosh',\n\t)\n\n#. In your `models.py` add::\n\n\tfrom djoosh import SearchMixin\n\t\n\t...\n\t\n\tclass BlogPost(models.Model, SearchMixin):\n\t\t...\n\t\t\n Note `SearchMixin` in the parents for `MyModel`. Just add it to any model\n that you want to search.\n \n\n#. When you're done, run `python manage.py search rebuild`\n\n#. That's it! You can now search your blog posts using\n ``BlogPost.search.query('some query')``,\n\n For example you can create a view like this::\n\n\tdef search(request):\n\t\n\t\tquery = request.GET.get('q', '')\n\t\t\n\t\tposts = BlogPost.search.query(query)\n\t\t\n\t\treturn render_to_response('search_posts.html',\n\t\t {'posts': posts, 'query': query})\n\n ... and your template can be::\n \n\t
\n\t\t\n\t\t\n\t
\n\t\n\t

Search Results

\n\t{% for post in posts %}\n\t\t

{{ post.title }}

\n\t\t

{{ post.content }}

\n\t{% endfor %}\n\nFine-Tuning\n===========\n\nComing soon...\n\nFor the impatient::\n\n\tblog/search.py:\n\n\tfrom blog import BlogPost\n\tfrom djoosh import site, SearchModel\n\t\n\tclass BlogPostSearch(SearchModel):\n\t\tmodel = BlogPost\n\t\tfields = ('title', 'tags')\n\t\tkeywords = ('tags',)\n\t\tpk = 'id'\n\t\t\n\tsite.register(BlogPost, BlogPostSearch)\n\t\nYou may also have a look at `djoosh.loading`, particularly `site` and `SearchModel`.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://packages.python.org/djoosh", "keywords": "django whoosh search models simple", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "djoosh", "package_url": "https://pypi.org/project/djoosh/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/djoosh/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://packages.python.org/djoosh" }, "release_url": "https://pypi.org/project/djoosh/0.1/", "requires_dist": null, "requires_python": null, "summary": "A super simple Django-whoosh search engine", "version": "0.1" }, "last_serial": 791211, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "a1d6498581854e7ee76e82f47349ee13", "sha256": "7f5e1edbd0cbab0f9788c6074a11d23707722e59341184efcc86cc458a1f45aa" }, "downloads": -1, "filename": "djoosh-0.1.tar.gz", "has_sig": false, "md5_digest": "a1d6498581854e7ee76e82f47349ee13", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4218, "upload_time": "2011-05-28T18:11:48", "url": "https://files.pythonhosted.org/packages/66/75/202745c62d0d42f522912f260ace523998281926f184ff99b6f4401814bb/djoosh-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a1d6498581854e7ee76e82f47349ee13", "sha256": "7f5e1edbd0cbab0f9788c6074a11d23707722e59341184efcc86cc458a1f45aa" }, "downloads": -1, "filename": "djoosh-0.1.tar.gz", "has_sig": false, "md5_digest": "a1d6498581854e7ee76e82f47349ee13", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4218, "upload_time": "2011-05-28T18:11:48", "url": "https://files.pythonhosted.org/packages/66/75/202745c62d0d42f522912f260ace523998281926f184ff99b6f4401814bb/djoosh-0.1.tar.gz" } ] }