A really simple search backend for your site based on a crawler that scanns all pages in sitemap.xml
Project description
=====
SIMPLESEARCH
=====
Simplesearch provides an easy and really simple way to offer search on your website.
it installs a Class that you can use to execute queries and a managment command you can use to update the indext pages based on a sitemap.xml
Quick start
-----------
1. Add "simplesearch" to your INSTALLED_APPS setting like this::
INSTALLED_APPS = (
...
'simplesearch',
)
2. edit settings.py file to include the location of the search index.
INDEX_DIR = os.path.join(BASE_DIR, 'index')
2. run the command ./manage.py update_search_index <the url of the sitemap>
3. access the search backen from your views with:
from simplesearch import SimpleSiteSearcher
searcher = SimpleSiteSearcher()
results = searcher.search('a query String')
This will return a list like this:
[
{
title:'some tiele',
text:'relevant part of the searched text with <b> on the important terms',
url:'the url to the page on your site where the text was found'
},
...
]
you may then use the list in your templates to display the search results.
SIMPLESEARCH
=====
Simplesearch provides an easy and really simple way to offer search on your website.
it installs a Class that you can use to execute queries and a managment command you can use to update the indext pages based on a sitemap.xml
Quick start
-----------
1. Add "simplesearch" to your INSTALLED_APPS setting like this::
INSTALLED_APPS = (
...
'simplesearch',
)
2. edit settings.py file to include the location of the search index.
INDEX_DIR = os.path.join(BASE_DIR, 'index')
2. run the command ./manage.py update_search_index <the url of the sitemap>
3. access the search backen from your views with:
from simplesearch import SimpleSiteSearcher
searcher = SimpleSiteSearcher()
results = searcher.search('a query String')
This will return a list like this:
[
{
title:'some tiele',
text:'relevant part of the searched text with <b> on the important terms',
url:'the url to the page on your site where the text was found'
},
...
]
you may then use the list in your templates to display the search results.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file great-sitemap-search-0.2.tar.gz.
File metadata
- Download URL: great-sitemap-search-0.2.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56972f2d35515b167b25879c2af00f4e34959833f49283ed9490ae16b506ff2c
|
|
| MD5 |
073ecc8c103333f449f52cab12032d17
|
|
| BLAKE2b-256 |
0e94031ac250852498f1b6becbdd61b5e840f9ae5d74bad92959e5fe2334a96b
|