105👍
Check out Haystack Search – a new model based search abstraction layer that currently supports Xapian, Solr and Whoosh. Looks like it’s well supported and documented.
19👍
Justin, I’d try djangosearch first: Jacob Kaplan-Moss (Django’s lead developer) is working on it.
Potential hazards:
- The home page warns the API might not be entirely stable
Potential benefits:
- “The long term goal is for this to become
django.contrib.search
.”
- [Django]-Django migrate –fake and –fake-initial explained
- [Django]-How to use MySQLdb with Python and Django in OSX 10.6?
- [Django]-What does error mean? : "Forbidden (Referer checking failed – no Referer.):"
18👍
I am searching for the same thing, as are a lot of other people. Let’s hope that django.contrib.search will be added soon.
In the meantime, this is what I found:
- http://code.google.com/p/djangosearch/
- http://code.google.com/p/django-sphinx/
- http://code.google.com/p/djapian/
- http://code.google.com/p/django-search-lucene/
- http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/
To me, most look quite complicated and, frankly, a little daunting to implement.
I’d be interested to learn what you think of these.
- [Django]-How to obtain and/or save the queryset criteria to the DB?
- [Django]-How to manage local vs production settings in Django?
- [Django]-Django CSRF Cookie Not Set
9👍
The google code page for djangosearch indicates that it is no longer under active development, and suggests haystack or solango.
- [Django]-Running Django with FastCGI or with mod_python
- [Django]-Django template includes slow?
- [Django]-Should I be adding the Django migration files in the .gitignore file?
8👍
I’d recommend Sphinx for full-text search and aggregation, and django-sphinx is good enough for production use. We found that Sphinx was the least resource-intensive and fastest way to index and search our documents and that django-sphinx was a nice wrapper on top of the sphinx client.
The group by aggregation is particularly nice, if for example you want to display how many documents with a certain tag or by a certain author (or both) matched a search. In memory attribute updates were convenient too, especially for removing deleted articles immediately.
- [Django]-How to set environment variables in PyCharm?
- [Django]-Create Django model or update if exists
- [Django]-How to force application version on AWS Elastic Beanstalk
6👍
Thanks Garth. I had seen that djangosearch wanted to become the official Django search, but I was hesitant to use it because I couldn’t find any documentation! Luckily, there’s a README in subversion that I hadn’t seen before, and it makes the API look very cool:
# set up the model
class Event(models.Model):
title = models.CharField(max_length=255)
date = models.DateField()
is_outdoors = models.BooleanField()
index = djangosearch.ModelIndex(text=['title'],
additional=['date', 'is_outdoors'])
# run a search
results = Event.index.search("django conference")
- [Django]-Django testing: Test the initial value of a form field
- [Django]-Django gives Bad Request (400) when DEBUG = False
- [Django]-How to define two fields "unique" as couple
6👍
I just needed a very quick solution that was no-fuss for an internal app.
I found the article Adding search to Django in a snap, and that worked splendid for me!
Obviously it lacks the speed, scalability and features of the real projects like Haystack, but this one is easier to set up, and I don’t really need anything else than keyword AND-search.
- [Django]-How to use regex in django query
- [Django]-Django model constraint for related objects
- [Django]-Multiple Database Config in Django 1.2
3👍
You might want to consider letting Yahoo do all the hard work with their Build your own Search Service (BOSS). Here is a great blog post that walks you through the process:
http://www.peterkrantz.com/2008/yahoo-search-in-django/
- [Django]-Django-tables2: How to use accessor to bring in foreign columns?
- [Django]-How do I filter query objects by date range in Django?
- [Django]-How to run a celery worker with Django app scalable by AWS Elastic Beanstalk?
2👍
It looks like everyone here missed django-xappy
After quick evaluation of all existing search addons for Django, I found this one as most flexible and easiest to use. It’s rough on the edges in few places, but it’s still the best way to use power of Xapian search engine inside Django projects.
- [Django]-Django: Fat models and skinny controllers?
- [Django]-How do I do a not equal in Django queryset filtering?
- [Django]-What's the difference between CharField and TextField in Django?
2👍
You might want to look at Django Solr search (aka “Solango”) which comes with some nice documentation to get you started…
- [Django]-Django models: default value for column
- [Django]-Error when using django.template
- [Django]-Choose test database?
1👍
If you have large amount of data to be indexed or you expect high traffic, I’d suggest using some external search engine, like Solr. This way, you’ll keep shared-nothing approach and be able to scale your site components independently.
- [Django]-Getting TypeError: __init__() missing 1 required positional argument: 'on_delete' when trying to add parent table after child table with entries
- [Django]-How to force application version on AWS Elastic Beanstalk
- [Django]-405 "Method POST is not allowed" in Django REST framework
1👍
I think I am going to have to give a shout out to Djapian.
It is rock-solid…just pull down a source distribution and peek inside. Top notch code, not very many comments tho..
It’s still a young software project, but I think the django community should throw it’s weight behind this one.
- [Django]-Django MEDIA_URL and MEDIA_ROOT
- [Django]-How does Django's nested Meta class work?
- [Django]-Remove pk field from django serialized objects
0👍
Thanks Joe,
We decided to go with Tsearch2 and a custom postgres adaptor. Tsearch2 does not need an extra process to run, which was convenient since we are on a WebFaction hosting with limited memory… It’s not completely done yet, but seems to be a good solution…
- [Django]-How to check if a user is logged in (how to properly use user.is_authenticated)?
- [Django]-How to implement followers/following in Django
- [Django]-Changing a project name in django
0👍
I found Djoosh which relies on the pure-python external search engine Whoosh to work well with my ‘Python’ brain.
- [Django]-Pytest.mark.parametrize with django.test.SimpleTestCase
- [Django]-How to change a django QueryDict to Python Dict?
- [Django]-Django auto_now and auto_now_add
0👍
If you are willing to use a 3rd party search engine I can recommend Yahoo BOSS and django-bosssearch.
Yahoo BOSS is a paid service, but it saves you setting up and maintaining other search software on your server.
- [Django]-How to write setup.py to include a Git repository as a dependency
- [Django]-Pagination in Django-Rest-Framework using API-View
- [Django]-Is there a way to loop over two lists simultaneously in django?