Skip to content

Commit d80d23b

Browse files
committed
Fixes for site search
1 parent 8897852 commit d80d23b

File tree

1 file changed

+20
-27
lines changed

1 file changed

+20
-27
lines changed

src/main/java/org/computate/frFR/java/EcrireApiClasse.java

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4209,8 +4209,7 @@ public void ecrireGenApiServiceImpl3(String classeLangueNom) throws Exception {
42094209

42104210
tl(5, "if(param", i18nGlobale.getString(I18n.var_Valeurs), i18nGlobale.getString(I18n.var_Objet), " != null && \"facet.pivot\".equals(param", i18nGlobale.getString(I18n.var_Nom), ")) {");
42114211
tl(6, "Matcher mFacetPivot = Pattern.compile(\"(?:(\\\\{![^\\\\}]+\\\\}))?(.*)\").matcher(StringUtils.join(param", i18nGlobale.getString(I18n.var_Objets), ".getList().toArray(), \",\"));");
4212-
tl(6, "boolean foundFacetPivot = mFacetPivot.find();");
4213-
tl(6, "if(foundFacetPivot) {");
4212+
tl(6, "if(mFacetPivot.find()) {");
42144213
tl(7, "String solrLocalParams = mFacetPivot.group(1);");
42154214
tl(7, "String[] ", i18nGlobale.getString(I18n.var_entite), "Vars = mFacetPivot.group(2).trim().split(\",\");");
42164215
tl(7, "String[] vars", i18nGlobale.getString(I18n.var_Indexe), " = new String[", i18nGlobale.getString(I18n.var_entite), "Vars.length];");
@@ -4225,34 +4224,30 @@ public void ecrireGenApiServiceImpl3(String classeLangueNom) throws Exception {
42254224
tl(6, "for(Object param", i18nGlobale.getString(I18n.var_Objet), " : param", i18nGlobale.getString(I18n.var_Objets), ") {");
42264225
tl(7, "if(param", i18nGlobale.getString(I18n.var_Nom), ".equals(\"q\")) {");
42274226
tl(8, "Matcher mQ = Pattern.compile(\"(\\\\w+):(.+?(?=(\\\\)|\\\\s+OR\\\\s+|\\\\s+AND\\\\s+|\\\\^|$)))\").matcher((String)param", i18nGlobale.getString(I18n.var_Objet), ");");
4228-
tl(8, "boolean foundQ = mQ.find();");
4229-
tl(8, "if(foundQ) {");
4230-
tl(9, "StringBuffer sb = new StringBuffer();");
4231-
tl(9, "while(foundQ) {");
4232-
tl(10, i18nGlobale.getString(I18n.var_entite), "Var = mQ.group(1).trim();");
4233-
tl(10, i18nGlobale.getString(I18n.var_valeur), i18nGlobale.getString(I18n.var_Indexe), " = mQ.group(2).trim();");
4234-
tl(10, "var", i18nGlobale.getString(I18n.var_Indexe), " = ", classeNomSimple, ".var", i18nGlobale.getString(I18n.var_Indexe), "", classeNomSimple, "(", i18nGlobale.getString(I18n.var_entite), "Var);");
4235-
tl(10, "String ", i18nGlobale.getString(I18n.var_entite), "Q = ", i18nGlobale.getString(I18n.var_rechercher), classeNomSimple, "Fq(", i18nGlobale.getString(I18n.var_listeRecherche), ", ", i18nGlobale.getString(I18n.var_entite), "Var, ", i18nGlobale.getString(I18n.var_valeur), i18nGlobale.getString(I18n.var_Indexe), ", ", "var", i18nGlobale.getString(I18n.var_Indexe), ");");
4236-
tl(10, "mQ.appendReplacement(sb, ", i18nGlobale.getString(I18n.var_entite), "Q);");
4237-
tl(10, "foundQ = mQ.find();");
4238-
tl(9, "}");
4227+
tl(8, "StringBuffer sb = new StringBuffer();");
4228+
tl(8, "while(mQ.find()) {");
4229+
tl(9, i18nGlobale.getString(I18n.var_entite), "Var = mQ.group(1).trim();");
4230+
tl(9, i18nGlobale.getString(I18n.var_valeur), i18nGlobale.getString(I18n.var_Indexe), " = mQ.group(2).trim();");
4231+
tl(9, "var", i18nGlobale.getString(I18n.var_Indexe), " = ", classeNomSimple, ".var", i18nGlobale.getString(I18n.var_Indexe), "", classeNomSimple, "(", i18nGlobale.getString(I18n.var_entite), "Var);");
4232+
tl(9, "String ", i18nGlobale.getString(I18n.var_entite), "Q = ", i18nGlobale.getString(I18n.var_rechercher), classeNomSimple, "Fq(", i18nGlobale.getString(I18n.var_listeRecherche), ", ", i18nGlobale.getString(I18n.var_entite), "Var, ", i18nGlobale.getString(I18n.var_valeur), i18nGlobale.getString(I18n.var_Indexe), ", ", "var", i18nGlobale.getString(I18n.var_Indexe), ");");
4233+
tl(9, "mQ.appendReplacement(sb, ", i18nGlobale.getString(I18n.var_entite), "Q);");
4234+
tl(8, "}");
4235+
tl(8, "if(!sb.isEmpty()) {");
42394236
tl(9, "mQ.appendTail(sb);");
42404237
tl(9, i18nGlobale.getString(I18n.var_listeRecherche), ".q(sb.toString());");
42414238
tl(8, "}");
42424239

42434240
tl(7, "} else if(param", i18nGlobale.getString(I18n.var_Nom), ".equals(\"fq\")) {");
42444241
tl(8, "Matcher mFq = Pattern.compile(\"(\\\\w+):(.+?(?=(\\\\)|\\\\s+OR\\\\s+|\\\\s+AND\\\\s+|$)))\").matcher((String)param", i18nGlobale.getString(I18n.var_Objet), ");");
4245-
tl(8, "boolean foundFq = mFq.find();");
4246-
tl(8, "if(foundFq) {");
42474242
tl(9, "StringBuffer sb = new StringBuffer();");
4248-
tl(9, "while(foundFq) {");
4249-
tl(10, i18nGlobale.getString(I18n.var_entite), "Var = mFq.group(1).trim();");
4250-
tl(10, i18nGlobale.getString(I18n.var_valeur), i18nGlobale.getString(I18n.var_Indexe), " = mFq.group(2).trim();");
4251-
tl(10, "var", i18nGlobale.getString(I18n.var_Indexe), " = ", classeNomSimple, ".var", i18nGlobale.getString(I18n.var_Indexe), "", classeNomSimple, "(", i18nGlobale.getString(I18n.var_entite), "Var);");
4252-
tl(10, "String ", i18nGlobale.getString(I18n.var_entite), "Fq = ", i18nGlobale.getString(I18n.var_rechercher), classeNomSimple, "Fq(", i18nGlobale.getString(I18n.var_listeRecherche), ", ", i18nGlobale.getString(I18n.var_entite), "Var, ", i18nGlobale.getString(I18n.var_valeur), i18nGlobale.getString(I18n.var_Indexe), ", ", "var", i18nGlobale.getString(I18n.var_Indexe), ");");
4253-
tl(10, "mFq.appendReplacement(sb, ", i18nGlobale.getString(I18n.var_entite), "Fq);");
4254-
tl(10, "foundFq = mFq.find();");
4255-
tl(9, "}");
4243+
tl(8, "while(mFq.find()) {");
4244+
tl(9, i18nGlobale.getString(I18n.var_entite), "Var = mFq.group(1).trim();");
4245+
tl(9, i18nGlobale.getString(I18n.var_valeur), i18nGlobale.getString(I18n.var_Indexe), " = mFq.group(2).trim();");
4246+
tl(9, "var", i18nGlobale.getString(I18n.var_Indexe), " = ", classeNomSimple, ".var", i18nGlobale.getString(I18n.var_Indexe), "", classeNomSimple, "(", i18nGlobale.getString(I18n.var_entite), "Var);");
4247+
tl(9, "String ", i18nGlobale.getString(I18n.var_entite), "Fq = ", i18nGlobale.getString(I18n.var_rechercher), classeNomSimple, "Fq(", i18nGlobale.getString(I18n.var_listeRecherche), ", ", i18nGlobale.getString(I18n.var_entite), "Var, ", i18nGlobale.getString(I18n.var_valeur), i18nGlobale.getString(I18n.var_Indexe), ", ", "var", i18nGlobale.getString(I18n.var_Indexe), ");");
4248+
tl(9, "mFq.appendReplacement(sb, ", i18nGlobale.getString(I18n.var_entite), "Fq);");
4249+
tl(8, "}");
4250+
tl(8, "if(!sb.isEmpty()) {");
42564251
tl(9, "mFq.appendTail(sb);");
42574252
tl(9, i18nGlobale.getString(I18n.var_listeRecherche), ".fq(sb.toString());");
42584253
tl(8, "}");
@@ -4281,8 +4276,7 @@ public void ecrireGenApiServiceImpl3(String classeLangueNom) throws Exception {
42814276

42824277
tl(7, "} else if(param", i18nGlobale.getString(I18n.var_Nom), ".equals(\"stats.field\")) {");
42834278
tl(8, "Matcher mStats = Pattern.compile(\"(?:(\\\\{![^\\\\}]+\\\\}))?(.*)\").matcher((String)param", i18nGlobale.getString(I18n.var_Objet), ");");
4284-
tl(8, "boolean foundStats = mStats.find();");
4285-
tl(8, "if(foundStats) {");
4279+
tl(8, "if(mStats.find()) {");
42864280
tl(9, "String solrLocalParams = mStats.group(1);");
42874281
tl(9, i18nGlobale.getString(I18n.var_entite), "Var = mStats.group(2).trim();");
42884282
tl(9, "var", i18nGlobale.getString(I18n.var_Indexe), " = ", classeNomSimple, ".var", i18nGlobale.getString(I18n.var_Indexe), "", classeNomSimple, "(", i18nGlobale.getString(I18n.var_entite), "Var);");
@@ -4313,8 +4307,7 @@ public void ecrireGenApiServiceImpl3(String classeLangueNom) throws Exception {
43134307

43144308
tl(7, "} else if(param", i18nGlobale.getString(I18n.var_Nom), ".equals(\"facet.range\")) {");
43154309
tl(8, "Matcher mFacetRange = Pattern.compile(\"(?:(\\\\{![^\\\\}]+\\\\}))?(.*)\").matcher((String)param", i18nGlobale.getString(I18n.var_Objet), ");");
4316-
tl(8, "boolean foundFacetRange = mFacetRange.find();");
4317-
tl(8, "if(foundFacetRange) {");
4310+
tl(8, "if(mFacetRange.find()) {");
43184311
tl(9, "String solrLocalParams = mFacetRange.group(1);");
43194312
tl(9, i18nGlobale.getString(I18n.var_entite), "Var = mFacetRange.group(2).trim();");
43204313
tl(9, "var", i18nGlobale.getString(I18n.var_Indexe), " = ", classeNomSimple, ".var", i18nGlobale.getString(I18n.var_Indexe), "", classeNomSimple, "(", i18nGlobale.getString(I18n.var_entite), "Var);");

0 commit comments

Comments
 (0)