From 4b135c0205cfa5d668c22398eeb9ceb6f581e8fb Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Mon, 7 Mar 2011 14:10:10 +0000 Subject: [PATCH] Suppression Repertoire test --- library/framework/sphinx/test/index.php | 187 -------------------- library/framework/sphinx/test/test.php | 157 ---------------- library/framework/sphinx/test/test2.php | 53 ------ library/framework/sphinx/test/test2_old.php | 44 ----- library/framework/sphinx/test/test_old.php | 108 ----------- 5 files changed, 549 deletions(-) delete mode 100644 library/framework/sphinx/test/index.php delete mode 100644 library/framework/sphinx/test/test.php delete mode 100644 library/framework/sphinx/test/test2.php delete mode 100644 library/framework/sphinx/test/test2_old.php delete mode 100644 library/framework/sphinx/test/test_old.php diff --git a/library/framework/sphinx/test/index.php b/library/framework/sphinx/test/index.php deleted file mode 100644 index 7b383da6..00000000 --- a/library/framework/sphinx/test/index.php +++ /dev/null @@ -1,187 +0,0 @@ -'exacte' && - $_REQUEST['typeRecherche']<>'approx') ) - $_REQUEST['typeRecherche']='exacte'; - - if (!isset($_REQUEST['nbRep']) || $_REQUEST['nbRep']<25 || $_REQUEST['nbRep']>200 ) - $_REQUEST['nbRep']=25; - if (!isset($_REQUEST['nom'])) $_REQUEST['nom']=''; - if (!isset($_REQUEST['prenom'])) $_REQUEST['prenom']=''; - if (!isset($_REQUEST['codePostal'])) $_REQUEST['codePostal']=''; -?> -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Informations sur la personne 
NOM *
Prénom *
Département ou Code Postal de résidence *
Civilité Mlle - Mme - M
Date de Naissance * /  / 
Ville de Naissance
Département de Naissance
Pays de Naissance
Adresse de résidence *
Ville de résidence *
Montant du crédit demandé *
SIREN si entrepreneur individuel
RIB
Téléphone Domicile Liste rouge Oui    Non
Téléphone Professionel
Téléphone Portable
Informations complémentaires 
Nom de l'employeur
Adresse de l'employeur
Code Postal de l'employeur
Ville de l'employeur
  
Type de recherche name="typeRecherche" value="exacte">Exacte   name="typeRecherche" value="approx">Approchante
Nombre de résultats
-    -
- [--group ] [-p ] [-i ]\n" ); - -$q = $_REQUEST['nom'].' '.$_REQUEST['prenom']; -$any = false; // si false $index='xxx' -$port = 3312; -if ($_REQUEST['typeRecherche']=='exacte') - $index="annuaire_pp"; -else - $index="annuaire_pp_shx"; -$nbRep=$_REQUEST['nbRep']; - -//////////// -// do query -//////////// - -$cl = new SphinxClient (); -$cl->SetServer ( "localhost", $port ); -$cl->SetLimits (0, $nbRep); -$cl->SetWeights ( array ( 100, 1 ) ); -$cl->SetMatchMode ( $any ? SPH_MATCH_ANY : SPH_MATCH_ALL ); -if ( isset($_REQUEST['codePostal']) && $_REQUEST['codePostal']<>'' ) { - $tailleCP=strlen($_REQUEST['codePostal']); - if ($tailleCP>1 && $tailleCP<4) $cl->SetFilter("departement", array(0=>$_REQUEST['codePostal'])); - elseif ($tailleCP==5) $cl->SetFilter("codepostal", array(0=>$_REQUEST['codePostal'])); -} -if ( isset($_REQUEST['telephoneMaison']) && $_REQUEST['telephoneMaison']<>'' ) { - $cl->SetFilter("tel", array(0=>$_REQUEST['telephoneMaison'])); -} -$res = $cl->Query ( $q, $index ); - -//////////////// -// print me out -//////////////// - -if ( $res===false ) -{ - print "Query failed: " . $cl->GetLastError() . ".\n"; - -} else -{ - if ( $cl->GetLastWarning() ) - print "WARNING: " . $cl->GetLastWarning() . "\n\n"; - - print "Query '$q' retrieved $res[total] of $res[total_found] matches in $res[time] sec.
"; - print "

Query stats

    "; - if ( is_array($res["words"]) ) - foreach ( $res["words"] as $word => $info ) - print "
  • '$word' found $info[hits] times in $info[docs] documents
  • "; - print "
"; - - if ( is_array($res["matches"]) ) - { - $n = 1; - print "

Reponses :

    "; - foreach ( $res["matches"] as $doc => $docinfo ) - { - // print "
  • $n. doc_id=$doc, weight=$docinfo[weight]
    "; - // foreach ( $res["attrs"] as $attrname => $attrtype ) - // { - $info=mysql_select('particuliers', 'Nom, Adresse, CodePostal, Ville, Tel, Fax', "id=$doc"); - $personne=$info[0]; - echo '
  • '. $n .'. '. $personne['Nom'] .' ('. $docinfo[weight] .' %)
    '; - echo $personne['Adresse'] .'
    '; - echo $personne['CodePostal'] .' '. $personne['Ville'] .'
    '; - if ($personne['Tel']<>'') echo 'Tél : '.$personne['Tel'].'
    '; - if ($personne['Fax']<>'') echo 'Fax : '.$personne['Fax'].'
    '; - echo "
  • \n"; - $n++; - -/* $value = $docinfo["attrs"][$attrname]; - if ( $attrtype==SPH_ATTR_TIMESTAMP ) - $value = date ( "Y-m-d H:i:s", $value ); - print ", $attrname=$value"; - } - print "";*/ - //$n++; - } - print "
"; - } -echo ''; - - if ($_POST['submitted']) { - print_r($_POST); - - /* Actions à effectuer : - - // 1. Vérification de l'existance du NOM, Prénom et Adresse dans Annuaire (/30 points) - 1.1. Si NOM+Prénom à l'adresse ==> OK 30 points - 1.2. Si NOM sans prénom à l'adresse ==> OK 25 points - 1.3. Si quelqu'un dans annuaire à l'adresse 10 points - 1.4. Si pas d'adresse 0 point - - // Si 1.2 ==> 2 - // Si 1.3 ==> 2 + 3 - // Si 1.4 ==> 2 + 3 + 4 - - // 2. Vérifier si le prénom existe dans la table des prénoms (/ 3 points) - 2.1. Si le prénom existe OK 2 points - 2.2. Sinon valeur approchante 1 point - 2.3. Sinon ?????????? 0 point - - // 3. Vérifier si le nom existe dans la table des noms (/ 3 points) - 1.1. Si le nom existe OK 2 points - 1.2. Sinon valeur approchante 1 point - 1.3. Sinon 0 point - - // 4. Recherche de l'existance de l'adresse / ville (/ 5 points) - 2.1. Si adresse complète existe 5 points - 2.2. Si adresse sans n° 3 points - 2.3. Si approchant 2 points - 2.4. Si ville sans l'adresse 0 point - - //10. Vérifier si le prénom est logique avec les l'age moyen des personnes portant ce prénom (/ 3 points) - 2.4.1. Si logique OK 2 points - 2.4.2. Si approchant 1 point - 2.4.3. Sinon 0 point - - - 3.3.1 Vérification dans le pages blanches - - // 3. Si un téléphone est communiqué et qu'absence de liste rouge : (30 points) - 3.1. Vérifier la concordance NOM, Prénom, Adresse, Téléphonesi OK 30 point - - Enregistrer chaque requête - et les informations communqiuées par le client - */ - - } -} - -?> diff --git a/library/framework/sphinx/test/test.php b/library/framework/sphinx/test/test.php deleted file mode 100644 index 3d1349ee..00000000 --- a/library/framework/sphinx/test/test.php +++ /dev/null @@ -1,157 +0,0 @@ -\tconnect to searchd at host HOST\n" ); - print ( "-p, --port\t\tconnect to searchd at port PORT\n" ); - print ( "-i, --index \tsearch through index(es) specified by IDX\n" ); - print ( "-s, --sortby \tsort matches by 'CLAUSE' in sort_extended mode\n" ); - print ( "-S, --sortexpr \tsort matches by 'EXPR' DESC in sort_expr mode\n" ); - print ( "-a, --any\t\tuse 'match any word' matching mode\n" ); - print ( "-b, --boolean\t\tuse 'boolean query' matching mode\n" ); - print ( "-e, --extended\t\tuse 'extended query' matching mode\n" ); - print ( "-ph,--phrase\t\tuse 'exact phrase' matching mode\n" ); - print ( "-f, --filter \tfilter by attribute 'ATTR' (default is 'group_id')\n" ); - print ( "-v, --value \tadd VAL to allowed 'group_id' values list\n" ); - print ( "-g, --groupby \tgroup matches by 'EXPR'\n" ); - print ( "-gs,--groupsort \tsort groups by 'EXPR'\n" ); - print ( "-d, --distinct \tcount distinct values of 'ATTR''\n" ); - print ( "-l, --limit \tretrieve COUNT matches (default: 20)\n" ); - exit; -} - -$args = array(); -foreach ( $_SERVER["argv"] as $arg ) - $args[] = $arg; - -$q = ""; -$mode = SPH_MATCH_ALL; -$host = "localhost"; -$port = 3312; -$index = "*"; -$groupby = ""; -$groupsort = "@group desc"; -$filter = "group_id"; -$filtervals = array(); -$distinct = ""; -$sortby = ""; -$limit = 20; -$ranker = SPH_RANK_PROXIMITY_BM25; -for ( $i=0; $iSetServer ( $host, $port ); -$cl->SetWeights ( array ( 100, 1 ) ); -$cl->SetMatchMode ( $mode ); -if ( count($filtervals) ) $cl->SetFilter ( $filter, $filtervals ); -if ( $groupby ) $cl->SetGroupBy ( $groupby, SPH_GROUPBY_ATTR, $groupsort ); -if ( $sortby ) $cl->SetSortMode ( SPH_SORT_EXTENDED, $sortby ); -if ( $sortexpr ) $cl->SetSortMode ( SPH_SORT_EXPR, $sortexpr ); -if ( $distinct ) $cl->SetGroupDistinct ( $distinct ); -if ( $limit ) $cl->SetLimits ( 0, $limit, ( $limit>1000 ) ? $limit : 1000 ); -$cl->SetRankingMode ( $ranker ); -$cl->SetArrayResult ( true ); -$res = $cl->Query ( $q, $index ); - -//////////////// -// print me out -//////////////// - -if ( $res===false ) -{ - print "Query failed: " . $cl->GetLastError() . ".\n"; - -} else -{ - if ( $cl->GetLastWarning() ) - print "WARNING: " . $cl->GetLastWarning() . "\n\n"; - - print "Query '$q' retrieved $res[total] of $res[total_found] matches in $res[time] sec.\n"; - print "Query stats:\n"; - if ( is_array($res["words"]) ) - foreach ( $res["words"] as $word => $info ) - print " '$word' found $info[hits] times in $info[docs] documents\n"; - print "\n"; - - if ( is_array($res["matches"]) ) - { - $n = 1; - print "Matches:\n"; - foreach ( $res["matches"] as $docinfo ) - { - print "$n. doc_id=$docinfo[id], weight=$docinfo[weight]"; - foreach ( $res["attrs"] as $attrname => $attrtype ) - { - $value = $docinfo["attrs"][$attrname]; - if ( $attrtype & SPH_ATTR_MULTI ) - { - $value = "(" . join ( ",", $value ) .")"; - } else - { - if ( $attrtype==SPH_ATTR_TIMESTAMP ) - $value = date ( "Y-m-d H:i:s", $value ); - } - print ", $attrname=$value"; - } - print "\n"; - $n++; - } - } -} - -// -// $Id: test.php 1103 2008-01-24 18:42:57Z shodan $ -// - -?> \ No newline at end of file diff --git a/library/framework/sphinx/test/test2.php b/library/framework/sphinx/test/test2.php deleted file mode 100644 index 21e4a36c..00000000 --- a/library/framework/sphinx/test/test2.php +++ /dev/null @@ -1,53 +0,0 @@ - "", - "after_match" => "", - "chunk_separator" => " ... ", - "limit" => 60, - "around" => 3, -); - -foreach ( array(0,1) as $exact ) -{ - $opts["exact_phrase"] = $exact; - print "exact_phrase=$exact\n"; - - $cl = new SphinxClient (); - $res = $cl->BuildExcerpts ( $docs, $index, $words, $opts ); - if ( !$res ) - { - die ( "ERROR: " . $cl->GetLastError() . ".\n" ); - } else - { - $n = 0; - foreach ( $res as $entry ) - { - $n++; - print "n=$n, res=$entry\n"; - } - print "\n"; - } -} - -// -// $Id: test2.php 910 2007-11-16 11:43:46Z shodan $ -// - -?> \ No newline at end of file diff --git a/library/framework/sphinx/test/test2_old.php b/library/framework/sphinx/test/test2_old.php deleted file mode 100644 index 5ea540ea..00000000 --- a/library/framework/sphinx/test/test2_old.php +++ /dev/null @@ -1,44 +0,0 @@ - "", - "after_match" => "", - "chunk_separator" => " ... ", - "limit" => 400, - "around" => 15 -); - - -$cl = new SphinxClient (); -$res = $cl->BuildExcerpts ( $docs, $index, $words, $opts ); -if ( !$res ) -{ - die ( "ERROR: " . $cl->GetLastError() . ".\n" ); -} else -{ - foreach ( $res as $entry ) - { - $n++; - print "n=$n, res=$entry\n"; - } -} - -// -// $Id: test2.php,v 1.4 2006/11/26 12:24:21 shodan Exp $ -// - -?> \ No newline at end of file diff --git a/library/framework/sphinx/test/test_old.php b/library/framework/sphinx/test/test_old.php deleted file mode 100644 index 935a9230..00000000 --- a/library/framework/sphinx/test/test_old.php +++ /dev/null @@ -1,108 +0,0 @@ -#!/usr/bin/php -q - [--group ] [-p ] [-i ]\n" ); - -$args = array(); -foreach ( $_SERVER["argv"] as $arg ) - $args[] = $arg; - -$q = ""; -$any = false; -$groups = array(); -$port = 3312; -$index = "*"; -for ( $i=0; $iSetServer ( "localhost", $port ); -$cl->SetWeights ( array ( 100, 1 ) ); -$cl->SetMatchMode ( $any ? SPH_MATCH_ANY : SPH_MATCH_ALL ); -if ( count($groups) ) - $cl->SetFilter ( "group_id", $groups ); -$res = $cl->Query ( $q, $index ); - -//////////////// -// print me out -//////////////// - -if ( $res===false ) -{ - print "Query failed: " . $cl->GetLastError() . ".\n"; - -} else -{ - if ( $cl->GetLastWarning() ) - print "WARNING: " . $cl->GetLastWarning() . "\n\n"; - - print "Query '$q' retrieved $res[total] of $res[total_found] matches in $res[time] sec.\n"; - print "Query stats:\n"; - if ( is_array($res["words"]) ) - foreach ( $res["words"] as $word => $info ) - print " '$word' found $info[hits] times in $info[docs] documents\n"; - print "\n"; - - if ( is_array($res["matches"]) ) - { - $n = 1; - print "Matches:\n"; - foreach ( $res["matches"] as $doc => $docinfo ) - { - print "$n. doc_id=$doc, weight=$docinfo[weight]"; - foreach ( $res["attrs"] as $attrname => $attrtype ) - { - $value = $docinfo["attrs"][$attrname]; - if ( $attrtype==SPH_ATTR_TIMESTAMP ) - $value = date ( "Y-m-d H:i:s", $value ); - print ", $attrname=$value"; - } - print "\n"; - $n++; - } - } -} - -// -// $Id: test.php,v 1.12 2006/11/26 12:24:21 shodan Exp $ -// - -?>