|
|
#HTTP_HEADER{Content-Type: application/json; charset=#CHARSET}
|
|
|
#CACHE{0}
|
|
|
[(#REM)
|
|
|
|
|
|
Menu de selection d'un mot a partir d'une valeur passee en parametre
|
|
|
|
|
|
Params:
|
|
|
- objet, id_objet : Pour Exclure les mots liés
|
|
|
- id_groupe? Dans quel(s) groupe(s) de mot (id ou liste d’id)
|
|
|
|
|
|
Boucles:
|
|
|
- _e : Eliminer les doublons
|
|
|
- _s1 : Chercher les mots correspondant à la requete dans le titre
|
|
|
- _s2 : Si aucun, on recherche plus librement dans l'ensemble des mots
|
|
|
|
|
|
Deprecated
|
|
|
- Param `groupes`. Uses id_groupe.
|
|
|
]
|
|
|
[(#ENV{groupes}|oui)[(#ENV{groupes}|explode{','}|setenv{id_groupe})]]
|
|
|
{
|
|
|
"results": \[
|
|
|
<BOUCLE_e(MOTS){tout}{objet}{id_objet}{doublons} />
|
|
|
<BOUCLE_s1(MOTS){titre LIKE (#ENV*{q})%}{","}
|
|
|
{id_groupe ?IN #ENV{id_groupe}}
|
|
|
{0,20}{par titre}{doublons}{tout}>
|
|
|
[(#SET{label,#TITRE[ - (#DESCRIPTIF|textebrut|couper{20})][ ((#TYPE|textebrut))]})]
|
|
|
{
|
|
|
"id": [(#ID_MOT|json_encode)],
|
|
|
"long_text": [(#GET{label}|json_encode)],
|
|
|
"text": [(#TITRE|textebrut|json_encode)]
|
|
|
}
|
|
|
</BOUCLE_s1>
|
|
|
<BOUCLE_s2(MOTS){recherche (#ENV*{q})*}{","}
|
|
|
{id_groupe ?IN #ENV{id_groupe}}
|
|
|
{0,20}{!par points}{doublons}{tout}>
|
|
|
[(#SET{label,#TITRE[ - (#DESCRIPTIF|textebrut|couper{20})][ ((#TYPE|textebrut))]})]
|
|
|
{
|
|
|
"id": [(#ID_MOT|json_encode)],
|
|
|
"long_text": [(#GET{label}|json_encode)],
|
|
|
"text": [(#TITRE|textebrut|json_encode)]
|
|
|
}
|
|
|
</BOUCLE_s2>
|
|
|
<//B_s1>
|
|
|
\]
|
|
|
} |