On 5 May 2008, at 14:34, mrts wrote:
> 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 :)


For everything:

results = djangosearch.search("query")

or more specific:

results = djangosearch.search("query", models=[Foo, Bar])

Ben

--~--~---------~--~----~------------~-------~--~----~
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