Changeset 82415 in spip-zone


Ignore:
Timestamp:
May 15, 2014, 2:30:48 PM (5 years ago)
Author:
fil@…
Message:

facette utilisant GEODIST()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/indexer/trunk/prive/squelettes/contenu/sphinx.html

    r82388 r82415  
     1<style>
     2#resultats>* {
     3        padding: 10px;
     4}
     5
     6#resultats pre {
     7        background: #eee;
     8        overflow: scroll;
     9}
     10
     11section.recherche {
     12        float: left;
     13        width: 60%;
     14        max-width: 60%;
     15}
     16
     17
     18
     19aside.facettes {
     20        float: right;
     21        width: 35%;
     22}
     23</style>
     24
    125<h1>Test SPHINX</h1>
    226
    327[(#FORMULAIRE_RECHERCHE{#SELF})]
     28
     29
     30<div id="resultats">
     31
     32<section class="recherche">
     33
    434
    535<?php
     
    3161</aside>
    3262
     63[(#ENV{tag}|?{[(#SET{tag,[IN(properties.tags,(#ENV{tag}|_q)) AS tag]})]})]
     64[(#ENV{tag}|=={'-'}?{[(#SET{tag,"LENGTH(properties.tags)=0 AS tag"})]})]
    3365
    34 
    35 [(#SET{sql,"SELECT WEIGHT() AS score, *, SNIPPET(content,"[(#ENV*{recherche}|_q|concat{","})]'limit=200') as snippet FROM [(#ENV{source,spip})] WHERE MATCH([(#ENV*{recherche}|_q)])[ ORDER BY (#GET{order})] LIMIT 10})]
     66[(#SET{sql,"SELECT WEIGHT() AS score, *, SNIPPET(content,"[(#ENV*{recherche}|_q|concat{","})]'limit=200') as snippet [, (#GET{tag})] FROM [(#ENV{source,spip})] WHERE MATCH([(#ENV*{recherche}|_q)])[ (#GET{tag}|?{AND tag=1})][ ORDER BY (#GET{order})] LIMIT 10})]
    3667
    3768
     
    6899
    69100</BOUCLE_recherche>
     101</section>
    70102
    71 
     103<aside class="facettes">
    72104
    73105<h2>Facettes</h2>
     
    78110
    79111]
    80 [(#SET{grouper,'INTERVAL(UINT(properties.length),100,300,1000,3000,10000,30000)'})]
    81 [(#SET{sqlf,"SELECT COUNT(*) AS c, "[(#GET{grouper}) AS grouper, ]GROUPBY() AS facette FROM [(#ENV{source,spip})] WHERE MATCH([(#ENV*{recherche}|_q)]) GROUP BY grouper ORDER BY c DESC LIMIT 10})]
     112[(#SET{grouper,'INTERVAL(UINT(properties.length),10000,30000,100000,300000,1000000,300000000)'})]
     113[(#SET{sqlf,"SELECT COUNT(*) AS c, "[(#GET{grouper}) AS grouper, ]GROUPBY() AS facette FROM [(#ENV{source,spip})] WHERE MATCH([(#ENV*{recherche}|_q)]) GROUP BY grouper ORDER BY c DESC LIMIT 30})]
     114
     115
     116[(#REM)
     117
     118 Distance de Nairobi :
     119                GEODIST(lat1,long1,lat2,long2)
     120]
     121#SET{lon,36.817}
     122#SET{lat,1.283}
     123
     124[(#SET{grouper,#VAL{'INTERVAL(GEODIST('}|concat{#GET{lat}}|concat{','}|concat{#GET{lon}}|concat{',UINT(properties.geo.lat),UINT(properties.geo.lon)),100,300,1000,3000,10000,30000)'}})]
     125[(#SET{sqlf,"SELECT COUNT(*) AS c, "[(#GET{grouper}) AS grouper, ]GROUPBY() AS facette FROM [(#ENV{source,spip})] WHERE MATCH([(#ENV*{recherche}|_q)]) GROUP BY grouper ORDER BY c DESC LIMIT 30})]
     126
     127
    82128
    83129[(#REM)
     
    86132
    87133]
    88 [(#SET{sqlf,"SELECT COUNT(*) AS c, "GROUPBY() AS facette FROM [(#ENV{source,spip})] WHERE MATCH([(#ENV*{recherche}|_q)]) GROUP BY properties.tags ORDER BY c DESC LIMIT 10})]
     134[(#SET{sqlf,"SELECT COUNT(*) AS c, "GROUPBY() AS facette FROM [(#ENV{source,spip})] WHERE MATCH([(#ENV*{recherche}|_q)]) GROUP BY properties.tags ORDER BY c DESC LIMIT 30})]
    89135
    90136<pre>[(#GET{sqlf}|htmlspecialchars)]</pre>
     
    95141            <h2>Liste des facettes</h2>
    96142        <BOUCLE_facette(DATA){source tableau, #VALEUR}{si #CLE|=={docs}}>
    97                 #VALEUR{c} = #VALEUR{facette}<br />
     143                #VALEUR{c} = <a href="[(#SELF|parametre_url{tag,[(#VALEUR{facette}|sinon{-})]})]">[(#VALEUR{facette}|sinon{<i>sans tag</i>})]</a><br />
    98144        </BOUCLE_facette>
    99145        </B_facette>
     
    113159
    114160</BOUCLE_facettes>
     161
     162</aside>
     163
     164</div>
Note: See TracChangeset for help on using the changeset viewer.