Yes, that is good. That is what I meant by the code needs work because it is
fetching the objects one at a time instead of using whereIn()

It would be very awesome if you could write a cookbook tutorial for the
Doctrine website describing what you did to integrate Doctrine and sphinx
together. If you send a first rough draft I can finish it and publish it
with props to you.

- Jon

On Thu, Sep 25, 2008 at 10:32 AM, Jeremy Benoist
<[EMAIL PROTECTED]>wrote:

> Well, good point of view using Collection.
> Actually we get results from Sphinx already "paged", I mean we give him
> number of result we want. Then we `use ->whereIn(..., ids)` where  ids are
> an array of all id returned by Sphinx query :
>
> $options = array(
>   'limit'   => 10,  'offset'  => ($this->page - 1) * 10,
>   'weights' => array(100, 1),
>   'sort'    => sfSphinxClient::SPH_SORT_EXTENDED,
>   'sortby'  => '@weight DESC',
> );
>
> $sphinx = new sfSphinxClient($options);
>
> $res = $sphinx->Query($this->getRequestParameter('q'));
>
> .....
>
> foreach ($res['matches'] as $docinfo) {
>   $ids[] = $docinfo['id'];
> }
>
> .....
>
> $this->pager = new sfDoctrinePager('ProductGroup', 20);
>
> $this->pager->getQuery()->whereIn('ProductGroup.id', $ids);
>
>
> On Thu, Sep 25, 2008 at 16:34, Jonathan Wage <[EMAIL PROTECTED]> wrote:
>
>> As well, someone has tried integrating sphinx with Doctrine.
>>
>>
>> http://groups.google.com/group/doctrine-user/browse_thread/thread/9b974b93999ad0da
>>
>> The code needs work but it shows you an idea of how it can be integrated.
>>
>> - Jon
>>
>>
>>
>> On Thu, Sep 25, 2008 at 2:43 AM, Jeremy Benoist <[EMAIL PROTECTED]
>> > wrote:
>>
>>>
>>> Hi Bernhard,
>>>
>>> Thanks for the reply, I didn't know that Doctrine had a such behavior.
>>> But finaly we decided to choose Sphinx as search engine. It is ORM
>>> independent and sfSphinxPlugin is easy to use.
>>>
>>> Jeremy
>>>
>>> On 23 sep, 08:06, "Bernhard Schussek" <[EMAIL PROTECTED]> wrote:
>>> > Hi Jeremy,
>>> >
>>> > I cannot answer your question, since I too am waiting for the new
>>> > search plugin. Maybe you can use the Searchable behaviour in Doctrine
>>> > though to build your own search.
>>> >
>>> > http://www.doctrine-project.org/documentation/manual/1_0/en?chapter=b.
>>> ..
>>> >
>>> > Bernhard
>>> >
>>> > On Mon, Sep 22, 2008 at 5:17 PM, Jeremy Benoist
>>> >
>>> > <[EMAIL PROTECTED]> wrote:
>>> >
>>> > > Hello,
>>> >
>>> > > I always used Doctrine for all my symfony project.
>>> > > But before symfony 1.1, it were easy to find a great search engine
>>> > > plugin : I used the 1.0-Doctrine branche of sfLucenePlugin (even if
>>> > > Carl and/or Jonathan tells that this version isn't stable). And it
>>> > > works pretty good.
>>> >
>>> > > But today, I'm working on symfony 1.1.
>>> > > When I take a look to sfLucenePlugin page I don't see a compatible
>>> > > version for sf1.1 and Doctrine.
>>> >
>>> > > Then I take a look to sfSearchPlugin, but it seems that it's not yet
>>> > > compatible with Doctrine since doctrine folder is empty.
>>> >
>>> > > Is the 1.0-Doctrine branche will work under sf1.1 with sfCompat10
>>> > > enable ? Should I wait for a doctrine compatibility of
>>> > > sfSearchPlugin ?
>>> > > Or do I have to try and modify 1.0-Doctrine branche, then suggest a
>>> > > new branche for Lucene : 1.1-Doctrine ?
>>>
>>>
>>
>>
>> --
>> Jonathan H. Wage
>> Open Source Software Developer & Evangelist
>> http://www.jwage.com
>>
>>
>>
>
> >
>


-- 
Jonathan H. Wage
Open Source Software Developer & Evangelist
http://www.jwage.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to