<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Commentaires sur : Plugin de moteur de recherche multi-modèles</title>
	<atom:link href="http://www.formation-cakephp.com/269/plugin-moteur-recherche-interne-multi-modeles/feed" rel="self" type="application/rss+xml" />
	<link>http://www.formation-cakephp.com/269/plugin-moteur-recherche-interne-multi-modeles</link>
	<description>Le cadre de développement PHP et son utilisation au jour le jour.</description>
	<lastBuildDate>Sat, 13 Mar 2010 21:38:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Par : Alan Crevon</title>
		<link>http://www.formation-cakephp.com/269/plugin-moteur-recherche-interne-multi-modeles/comment-page-1#comment-4384</link>
		<dc:creator>Alan Crevon</dc:creator>
		<pubDate>Sun, 21 Feb 2010 13:29:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.formation-cakephp.com/?p=269#comment-4384</guid>
		<description>&lt;p&gt;Superbe plugin qui fonctionne magistralement. Un vrai bonheur, merci !&lt;/p&gt;

&lt;p&gt;Je me demandais simplement comment ajouter aux données indexées les données issue de modèles liés. &lt;/p&gt;

&lt;p&gt;Par exemple, j&#039;aimerais indexer mes Posts et les Tags auxquels les posts sont liés. De cette façon, une recherche porterait non seulement sur les titres et contenus des Posts, mais aussi sur les mots clés associés.&lt;/p&gt;

&lt;p&gt;Amicalement,
alan&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Superbe plugin qui fonctionne magistralement. Un vrai bonheur, merci !</p>

<p>Je me demandais simplement comment ajouter aux données indexées les données issue de modèles liés. </p>

<p>Par exemple, j&#8217;aimerais indexer mes Posts et les Tags auxquels les posts sont liés. De cette façon, une recherche porterait non seulement sur les titres et contenus des Posts, mais aussi sur les mots clés associés.</p>

<p>Amicalement,
alan</p>]]></content:encoded>
	</item>
	<item>
		<title>Par : Pierre-Emmanuel Fringant</title>
		<link>http://www.formation-cakephp.com/269/plugin-moteur-recherche-interne-multi-modeles/comment-page-1#comment-3525</link>
		<dc:creator>Pierre-Emmanuel Fringant</dc:creator>
		<pubDate>Wed, 14 Oct 2009 12:38:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.formation-cakephp.com/?p=269#comment-3525</guid>
		<description>&lt;p&gt;@dorio: Tout à fait juste, j&#039;ai oublié de le préciser. Il faut ajouter la clé de tableau &lt;code&gt;&#039;plugin&#039; =&gt; null&lt;/code&gt; dans tous les liens du layout, car si l&#039;on se trouve dans une des pages gérées par le plugin, le layout pense que tous les liens vont vers le plugin...
Exemple :
&lt;pre lang=&quot;php&quot;&gt;echo $html-&gt;link(&quot;Retour accueil&quot;, array(&#039;controller&#039; =&gt; &#039;pages&#039;, &#039;action&#039; =&gt; &#039;display&#039;, &#039;home&#039;));&lt;/pre&gt;
Devient :
&lt;pre lang=&quot;php&quot;&gt;echo $html-&gt;link(&quot;Retour accueil&quot;, array(&#039;plugin&#039; =&gt; null, &#039;controller&#039; =&gt; &#039;pages&#039;, &#039;action&#039; =&gt; &#039;display&#039;, &#039;home&#039;));&lt;/pre&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@dorio: Tout à fait juste, j&#8217;ai oublié de le préciser. Il faut ajouter la clé de tableau <code>'plugin' => null</code> dans tous les liens du layout, car si l&#8217;on se trouve dans une des pages gérées par le plugin, le layout pense que tous les liens vont vers le plugin&#8230;
Exemple :

</p>
<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #000088;">$html</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">link</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Retour accueil&quot;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'controller'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'pages'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'action'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'display'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'home'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>



Devient :


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #000088;">$html</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">link</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Retour accueil&quot;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'plugin'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'controller'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'pages'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'action'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'display'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'home'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>


]]></content:encoded>
	</item>
	<item>
		<title>Par : dorio</title>
		<link>http://www.formation-cakephp.com/269/plugin-moteur-recherche-interne-multi-modeles/comment-page-1#comment-3524</link>
		<dc:creator>dorio</dc:creator>
		<pubDate>Wed, 14 Oct 2009 11:48:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.formation-cakephp.com/?p=269#comment-3524</guid>
		<description>&lt;p&gt;Bjr,
j&#039;ai un petit pb d&#039;url avec le plugin due à mon inexpérience.
ma page est www.monsite.fr/articles. A prtir de cette page je lance une recherche.
Mais je me retrouve avec des Url du style 
www.monsite.fr/search/articles/
Toutes mes Url dans mon layout sont passées de monsite.fr/articles en monsite.fr/search/articles.
Comment faire pour éviter cela et garder mes Url ?
Merci&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Bjr,
j&#8217;ai un petit pb d&#8217;url avec le plugin due à mon inexpérience.
ma page est <a href="http://www.monsite.fr/articles" rel="nofollow">http://www.monsite.fr/articles</a>. A prtir de cette page je lance une recherche.
Mais je me retrouve avec des Url du style 
<a href="http://www.monsite.fr/search/articles/" rel="nofollow">http://www.monsite.fr/search/articles/</a>
Toutes mes Url dans mon layout sont passées de monsite.fr/articles en monsite.fr/search/articles.
Comment faire pour éviter cela et garder mes Url ?
Merci</p>]]></content:encoded>
	</item>
	<item>
		<title>Par : VERINAUD Nicolas</title>
		<link>http://www.formation-cakephp.com/269/plugin-moteur-recherche-interne-multi-modeles/comment-page-1#comment-3493</link>
		<dc:creator>VERINAUD Nicolas</dc:creator>
		<pubDate>Mon, 05 Oct 2009 13:36:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.formation-cakephp.com/?p=269#comment-3493</guid>
		<description>&lt;p&gt;Est-il possible d&#039;avoir un tuto pour implémenter l&#039;auto-completion ajax dans ce plugin de recherche ?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Est-il possible d&#8217;avoir un tuto pour implémenter l&#8217;auto-completion ajax dans ce plugin de recherche ?</p>]]></content:encoded>
	</item>
	<item>
		<title>Par : Fred</title>
		<link>http://www.formation-cakephp.com/269/plugin-moteur-recherche-interne-multi-modeles/comment-page-1#comment-3456</link>
		<dc:creator>Fred</dc:creator>
		<pubDate>Fri, 25 Sep 2009 12:11:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.formation-cakephp.com/?p=269#comment-3456</guid>
		<description>&lt;p&gt;J&#039;ai le même souci que Gabriel, à savoir la non population de la table search_index lors d&#039;une construction ou reconstruction d&#039;index.&lt;/p&gt;

&lt;p&gt;Je travaille sur une application existante et des tables déjà remplies.&lt;/p&gt;

&lt;p&gt;Merci d&#039;avance pour votre aide.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>J&#8217;ai le même souci que Gabriel, à savoir la non population de la table search_index lors d&#8217;une construction ou reconstruction d&#8217;index.</p>

<p>Je travaille sur une application existante et des tables déjà remplies.</p>

<p>Merci d&#8217;avance pour votre aide.</p>]]></content:encoded>
	</item>
	<item>
		<title>Par : Vincent</title>
		<link>http://www.formation-cakephp.com/269/plugin-moteur-recherche-interne-multi-modeles/comment-page-1#comment-3431</link>
		<dc:creator>Vincent</dc:creator>
		<pubDate>Thu, 17 Sep 2009 12:22:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.formation-cakephp.com/?p=269#comment-3431</guid>
		<description>&lt;p&gt;Ca marche ! Merci !&lt;/p&gt;

&lt;p&gt;Par contre une petite question : j&#039;ai besoin de rechercher mes données à partir de mots-clés (pour cela j&#039;utilise votre plugin), mais également à partir de dates, d&#039;id d&#039;utilisateurs et autres données non textuelles.&lt;/p&gt;

&lt;p&gt;Comment faire pour sélectionner d&#039;abord mes données d&#039;après les paramètres non textuels, et ensuite faire une recherche par mots-clés sur le résultat de la première sélection en utilisant votre plugin ?&lt;/p&gt;

&lt;p&gt;j&#039;espère avoir été compréhensible.&lt;/p&gt;

&lt;p&gt;Vincent&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Ca marche ! Merci !</p>

<p>Par contre une petite question : j&#8217;ai besoin de rechercher mes données à partir de mots-clés (pour cela j&#8217;utilise votre plugin), mais également à partir de dates, d&#8217;id d&#8217;utilisateurs et autres données non textuelles.</p>

<p>Comment faire pour sélectionner d&#8217;abord mes données d&#8217;après les paramètres non textuels, et ensuite faire une recherche par mots-clés sur le résultat de la première sélection en utilisant votre plugin ?</p>

<p>j&#8217;espère avoir été compréhensible.</p>

<p>Vincent</p>]]></content:encoded>
	</item>
	<item>
		<title>Par : unclezoot</title>
		<link>http://www.formation-cakephp.com/269/plugin-moteur-recherche-interne-multi-modeles/comment-page-1#comment-3398</link>
		<dc:creator>unclezoot</dc:creator>
		<pubDate>Fri, 04 Sep 2009 00:35:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.formation-cakephp.com/?p=269#comment-3398</guid>
		<description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;Thanks for making this plugin - I wish I saw it 3 hours ago!&lt;/p&gt;

&lt;p&gt;It worked for me almost first time, but I noticed that the rebuild&lt;em&gt;search&lt;/em&gt;index action wasn&#039;t quite working correctly when I attached the behaviour to a plugin model. Basically, it was saving &#039;model&#039; into the search_index table instead of &#039;Plugin.model&#039;&lt;/p&gt;

&lt;p&gt;Here&#039;s my simple fix and good luck in next year&#039;s world cup from an Englishman. (You&#039;re going to struggle without Zidane and that clown Gallas in your team I think!)&lt;/p&gt;

&lt;hr /&gt;

&lt;pre&gt;&lt;code&gt;function admin_build_search_index() {

    $this-&gt;autoRender = false;

    $plugin_prefix = ($this-&gt;plugin) ? Inflector::camelize($this-&gt;plugin).&#039;.&#039; : &#039;&#039;;

    $model =&amp; $this-&gt;{$this-&gt;modelClass};

    if(!isset($model-&gt;Behaviors-&gt;Searchable))
    {
        echo &quot;&lt;pre&gt;Error : the {$model-&gt;alias} model is not linked with Searchable Behavior.&lt;/pre&gt;&quot;;
        exit;
    }

    $data = $model-&gt;find(&#039;all&#039;);

    foreach($data as $row)
    {
        $model-&gt;set($row);

        $model-&gt;Behaviors-&gt;Searchable-&gt;Search-&gt;saveIndex(
            $plugin_prefix.$model-&gt;alias,
            $model-&gt;id,
            $model-&gt;buildIndex()
        );
    }

    echo &quot;&lt;pre&gt;Search index for model {$model-&gt;alias} have been built.&lt;/pre&gt;&quot;;
}
&lt;/code&gt;&lt;/pre&gt;
</description>
		<content:encoded><![CDATA[<p>Hi,</p>

<p>Thanks for making this plugin &#8211; I wish I saw it 3 hours ago!</p>

<p>It worked for me almost first time, but I noticed that the rebuild<em>search</em>index action wasn&#8217;t quite working correctly when I attached the behaviour to a plugin model. Basically, it was saving &#8216;model&#8217; into the search_index table instead of &#8216;Plugin.model&#8217;</p>

<p>Here&#8217;s my simple fix and good luck in next year&#8217;s world cup from an Englishman. (You&#8217;re going to struggle without Zidane and that clown Gallas in your team I think!)</p>

<hr />

<pre><code>function admin_build_search_index() {

    $this-&amp;gt;autoRender = false;

    $plugin_prefix = ($this-&amp;gt;plugin) ? Inflector::camelize($this-&amp;gt;plugin).'.' : '';

    $model =&amp;amp; $this-&amp;gt;{$this-&amp;gt;modelClass};

    if(!isset($model-&amp;gt;Behaviors-&amp;gt;Searchable))
    {
        echo "&lt;pre&gt;Error : the {$model-&amp;gt;alias} model is not linked with Searchable Behavior.&lt;/pre&gt;";
        exit;
    }

    $data = $model-&amp;gt;find('all');

    foreach($data as $row)
    {
        $model-&amp;gt;set($row);

        $model-&amp;gt;Behaviors-&amp;gt;Searchable-&amp;gt;Search-&amp;gt;saveIndex(
            $plugin_prefix.$model-&amp;gt;alias,
            $model-&amp;gt;id,
            $model-&amp;gt;buildIndex()
        );
    }

    echo "&lt;pre&gt;Search index for model {$model-&amp;gt;alias} have been built.&lt;/pre&gt;";
}
</code></pre>]]></content:encoded>
	</item>
	<item>
		<title>Par : Gabriel</title>
		<link>http://www.formation-cakephp.com/269/plugin-moteur-recherche-interne-multi-modeles/comment-page-1#comment-3304</link>
		<dc:creator>Gabriel</dc:creator>
		<pubDate>Mon, 10 Aug 2009 13:58:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.formation-cakephp.com/?p=269#comment-3304</guid>
		<description>&lt;p&gt;Bonjour,
j&#039;ai suivi scrupuleusement tout ce qui est écrit dans l&#039;article, mais un problème subsiste :&lt;/p&gt;

&lt;p&gt;lorsque je lance la fonction rebuild&lt;em&gt;search&lt;/em&gt;index, la page mouline bien, récupère bien les infos de la table que je veux indexer, mais n&#039;insère rien dans la table search_index.&lt;/p&gt;

&lt;p&gt;les messages confirmant la suppression et la création de l&#039;index sont affichés.&lt;/p&gt;

&lt;p&gt;Une idée ?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Bonjour,
j&#8217;ai suivi scrupuleusement tout ce qui est écrit dans l&#8217;article, mais un problème subsiste :</p>

<p>lorsque je lance la fonction rebuild<em>search</em>index, la page mouline bien, récupère bien les infos de la table que je veux indexer, mais n&#8217;insère rien dans la table search_index.</p>

<p>les messages confirmant la suppression et la création de l&#8217;index sont affichés.</p>

<p>Une idée ?</p>]]></content:encoded>
	</item>
	<item>
		<title>Par : lioninho</title>
		<link>http://www.formation-cakephp.com/269/plugin-moteur-recherche-interne-multi-modeles/comment-page-1#comment-3103</link>
		<dc:creator>lioninho</dc:creator>
		<pubDate>Sun, 28 Jun 2009 07:29:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.formation-cakephp.com/?p=269#comment-3103</guid>
		<description>&lt;p&gt;Grand merci ça marche! &lt;/p&gt;

&lt;p&gt;ENcore bravo pour le plugin&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Grand merci ça marche! </p>

<p>ENcore bravo pour le plugin</p>]]></content:encoded>
	</item>
	<item>
		<title>Par : Pierre-Emmanuel Fringant</title>
		<link>http://www.formation-cakephp.com/269/plugin-moteur-recherche-interne-multi-modeles/comment-page-1#comment-3102</link>
		<dc:creator>Pierre-Emmanuel Fringant</dc:creator>
		<pubDate>Sat, 27 Jun 2009 13:17:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.formation-cakephp.com/?p=269#comment-3102</guid>
		<description>&lt;p&gt;Tu dois activer le routage admin en décommentant la ligne suivante dans {app}/config/core.php :
&lt;pre lang=&quot;php&quot;&gt;Configure::write(&#039;Routing.admin&#039;, &#039;admin&#039;);&lt;/pre&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Tu dois activer le routage admin en décommentant la ligne suivante dans {app}/config/core.php :

</p>
<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">Configure<span style="color: #339933;">::</span><span style="color: #004000;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Routing.admin'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'admin'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>


]]></content:encoded>
	</item>
</channel>
</rss>
