Re: Django Sphinx Foreign key search

2010-06-18 Thread urukay
So, here is the solution that can help u. I will explain it using these models: class Model1(models.Model): text_field = model_2 = models.ForeignKey('Model2') class Model2(models.Model): model_3 = models.ForeignKey('Model3') class Model3(models.Model): Goa

Re: Django Sphinx Foreign key search

2010-06-18 Thread urukay
So, here is the solution that can help u. I will explain it using these models: class Model1(models.Model): text_field = model_2 = models.ForeignKey('Model2') class Model2(models.Model): model_3 = models.ForeignKey('Model3') class Model3(models.Model): Goal

Re: Django Sphinx Foreign key search

2010-05-22 Thread Allen Machary
search_string = req.REQUEST.get("search", "") query = Model1.objects if search_string == "": query = query.all() else: query = query.filter( Q(text_field__icontains=search_string) | Q(fek_field__text_field__icontains=search_string)) the query var

Re: Django Sphinx Foreign key search

2010-05-22 Thread Allen Machary
search_string = req.REQUEST.get("search", "") query = Model1.objects if search_string == "": query = query.all() else: query = query.filter( Q(text_field__icontains=search_string) | Q(fek_field__text_field__icontains=search_string)) the query var

Re: Django Sphinx Foreign key search

2010-05-22 Thread urukay
No that's not what i want..i want search model over another model. esatterwh...@wi.rr.com wrote: > > You probably want to use the indexer argument. It allows you to > specify which indexes you want sphinx to search over. Of course you > have to tell sphinx which indexes ( models ) you want it

Re: Django Sphinx Foreign key search

2010-05-22 Thread esatterwh...@wi.rr.com
You probably want to use the indexer argument. It allows you to specify which indexes you want sphinx to search over. Of course you have to tell sphinx which indexes ( models ) you want it to search in. http://www.sphinxsearch.com/docs/current.html#ref-indexer On May 21, 8:47 am, urukay wrote: >

Re: Django Sphinx Foreign key search

2010-05-21 Thread urukay
Well, still trying to solve it...maybe i found the right way to do it, but it's still in progress. If anything shows up, i'll keep you updated. Hopefully this during few days i'll solve it. Radovan yafeng wu wrote: > > Hi, > > I got the same problem when building my website. Have you solved i

Re: Django Sphinx Foreign key search

2010-05-21 Thread urukay
I need to search over Model1, but the query should "look" also in Model2 if there is a match aand if there is, it returns Model1 which has relation with Model2 which contains searched string. But i'll take look at Haystack, maybe it'll be better for my needs. Thanks a lot. David De La Harpe G

Re: Django Sphinx Foreign key search

2010-05-20 Thread David De La Harpe Golden
On 13/04/10 09:04, urukay wrote: Hi, I'm trying to create full text search on model, everything goes fine when searching TextFields but I have a problem with ForeignKey field. How can i do that? Can anyone point me to the right direction? Do you mean you want the results for Model2 searches

Re: Django Sphinx Foreign key search

2010-05-19 Thread yafeng wu
Hi, I got the same problem when building my website. Have you solved it? Please let me know. Thanks, On Apr 13, 4:04 am, urukay wrote: > Hi, > > I'm trying to create full text search on model, everything goes fine > when > searching TextFields but I have a problem with ForeignKey field. > > How