Changeset 82464 in spip-zone


Ignore:
Timestamp:
May 16, 2014, 4:26:08 PM (5 years ago)
Author:
marcimat@…
Message:

Prise en compte de l'année

Location:
_plugins_/indexer/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/indexer/trunk/content/sphinx.html

    r82443 r82464  
    55
    66
    7 [(#SET{sql, [(#ENV{source,spip}|sphinx_get_query_documents{#ENV*{recherche},#ENV*{tag},#ENV*{auteur}})]})]
     7[(#SET{sql, [(#ENV{source,spip}|sphinx_get_query_documents{#ENV*{recherche},#ENV*{tag},#ENV*{auteur},#ENV{annee}})]})]
    88
    99
  • _plugins_/indexer/trunk/indexer_fonctions.php

    r82462 r82464  
    66 *
    77 */
    8 function sphinx_get_query_documents($index, $recherche, $tag = '', $auteur = '', $orderby = '') {
     8function sphinx_get_query_documents($index, $recherche, $tag = '', $auteur = '', $annee='', $orderby = '') {
    99    include_spip('inc/indexer');
    1010    $sq = new \Sphinx\SphinxQLQuery();
     
    3636        $sq->select("IN(properties.authors, " . $sq->quote($auteur) . ") AS auteur");
    3737        $sq->where("auteur = 1");
     38    }
     39
     40    if ($annee) {
     41        $sq->select("(YEAR(date) = " . $sq->quote($annee) . ") AS annee");
     42        $sq->where("annee = 1");
    3843    }
    3944
Note: See TracChangeset for help on using the changeset viewer.