> It currently works something like this:
>
> from django.db import models
> from djangosearch import ModelIndex
>
> class Article(models.Model):
>     title = models.CharField(max_length=255)
>     date = models.DateField()
>
>     index = ModelIndex(fields=['title', 'date'])
>
>     def __unicode__(self):
>         return self.title
>
> results = Article.index.search("search query")
>
> Quite simple and clear I think, what are your thoughts?

Looks nice, except one (probably most common) use case -- search over
all indexed fields in all models that have them.

E.g. the following is both cumbersome and ineffective:

class Foo(models.Model):
  x = models.CharField(max_length=255)
  index = ModelIndex()

class Bar(models.Model):
  y = models.CharField(max_length=255)
  index = ModelIndex()

results1 = Foo.index.search("query")
results2 = Bar.index.search("query")

That's why I proposed search_all(query). For that a common registry is
required where search_all can look up the indexed fields in all models
(and that's why I proposed search.register).

Perhaps that has been dealt with somehow in djangosearch, feel free to
illuminate me :)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to