<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Hi Rafael,</p>
<p>in your case, you might switch to the JSON configuration instead
of using the XML content. You can adjust the configuration each
time you call the search tag.</p>
<p>The documentation provides an example:</p>
<p><a
href="http://documentation.opencms.org/opencms-documentation/demos/lists-and-detail-pages-ii/index.html">http://documentation.opencms.org/opencms-documentation/demos/lists-and-detail-pages-ii/index.html</a></p>
<p>And an example JSON configuration (most of the nodes are
optionally). You can just "translate" your XML-content to that
configuration.</p>
<p><a
href="http://documentation.opencms.org/opencms-documentation/.galleries/Documentation-Documents-for-download/cms-search-config-full.json">http://documentation.opencms.org/opencms-documentation/.galleries/Documentation-Documents-for-download/cms-search-config-full.json</a></p>
<p><br>
</p>
<p>Best, Daniel<br>
</p>
<br>
<div class="moz-cite-prefix">Am 21.02.2017 um 11:38 schrieb Cano
Parra, Rafael:<br>
</div>
<blockquote
cite="mid:VI1PR04MB1007E449B65B9C055D2DD87BCF510@VI1PR04MB1007.eurprd04.prod.outlook.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="Generator" content="Microsoft Word 14 (filtered
medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]-->
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
color:black;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";
color:black;}
pre
{mso-style-priority:99;
mso-style-link:"HTML con formato previo Car";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
color:black;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Texto de globo Car";
margin:0cm;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";
color:black;
mso-fareast-language:EN-US;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
color:black;
mso-fareast-language:EN-US;}
span.HTMLconformatoprevioCar
{mso-style-name:"HTML con formato previo Car";
mso-style-priority:99;
mso-style-link:"HTML con formato previo";
font-family:Consolas;
color:black;
mso-fareast-language:EN-US;}
span.TextodegloboCar
{mso-style-name:"Texto de globo Car";
mso-style-priority:99;
mso-style-link:"Texto de globo";
font-family:"Tahoma","sans-serif";}
span.EstiloCorreo23
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.EstiloCorreo24
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span style="color:windowtext">Daniel,
thanks for your quick response!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext">By default I
have configured the query modifier as “content_es:%(query)
OR content_en:%(query) OR spell:%(query) OR
Title_prop:%(query)”. The default OR search operator is used
by default with this configuration.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext">If I change
this query modifier as “content_es:{!q.op=AND}%(query) OR
content_en:{!q.op=AND}%(query) OR spell:{!q.op=AND}%(query)
OR Title_prop:{!q.op=AND}%(query)”, the search operator is
changed to AND.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext">In the same
way, if i change the “:{!q.op=AND}%(query)” by “”%(query)””
(query between quotations), a literal search is done.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext">However, I
want the user can select the way to make the search
operation (AND, OR, or LITERAL), using a SELECT label with
three OPTION labels in the HTML search form. When the user
submit the search form, the results are showed.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext">My problem
is, how can I adapt, change or configure the default query
modifier previously configured in the formatter
configuration after the user submitted the form and before
the formatter shows the results?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext">I can have
the modified query adapted with the search type using this
code:<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:35.4pt"><span
style="color:windowtext"><c:set var="andQuery"
value="{!q.op=AND}${param.q}" /> <%-- the param.q must
be fixed to obtain the search query independently of the
query parameter name --%><o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:35.4pt"><span
style="color:windowtext"><c:set var="modifiedQuery"
value="${search.controller.common.config.getModifiedQuery(andQuery)}"
/><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext">But I do not
know how to apply this change in the search configuration or
status and update the search results.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext">Best
regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><b><span
style="color:windowtext;mso-fareast-language:ES">Rafael
Cano Parra<o:p></o:p></span></b></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:ES">Servicio
de Informática<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:ES">Tel.: 947
52 20 13 – Ext.: 34 941<o:p></o:p></span></p>
<p class="MsoNormal"><a moz-do-not-send="true"
href="mailto:rafaelcano@saludcastillayleon.es"><span
style="color:blue;mso-fareast-language:ES">rafaelcano@saludcastillayleon.es</span></a><span
style="color:windowtext;mso-fareast-language:ES"><o:p></o:p></span></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:ES"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span
style="color:#1F497D;mso-fareast-language:ES">Hospital
Santos Reyes<o:p></o:p></span></b></p>
<p class="MsoNormal"><span
style="color:#1F497D;mso-fareast-language:ES">Avda.
Ruperta Baraya, 6<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="color:#1F497D;mso-fareast-language:ES">09400 Aranda
de Duero (Burgos)<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="color:#1F497D;mso-fareast-language:ES">Tel.: 947 52
20 00 – Ext.: 34 600<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="color:#1F497D;mso-fareast-language:ES">Fax: 947 52
20 12<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:ES"><o:p> </o:p></span></p>
<p class="MsoNormal"><a moz-do-not-send="true"
href="https://www.saludcastillayleon.es/HSReyesAranda/"><span
style="color:blue;mso-fareast-language:ES;text-decoration:none"><img
id="Imagen_x0020_5"
src="cid:part4.462531EE.3C81AC24@alkacon.com"
alt="logo_hsry" border="0" height="32" width="44"></span></a><span
style="color:windowtext;mso-fareast-language:ES">
</span><a moz-do-not-send="true"
href="https://www.saludcastillayleon.es/"><span
style="color:blue;mso-fareast-language:ES;text-decoration:none"><img
id="Imagen_x0020_6"
src="cid:part6.089C0A12.4557FB92@alkacon.com"
alt="logo_sacyl" border="0" height="32" width="63"></span></a><span
style="color:windowtext;mso-fareast-language:ES"> </span><a
moz-do-not-send="true" href="https://www.jcyl.es/"><span
style="color:blue;mso-fareast-language:ES;text-decoration:none"><img
id="Imagen_x0020_4"
src="cid:part8.0A958FDA.A0AC8BB6@alkacon.com"
alt="logo_jcyl" border="0" height="32" width="53"></span></a><span
style="color:windowtext;mso-fareast-language:ES"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="color:windowtext"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF
1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext;mso-fareast-language:ES">De:</span></b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext;mso-fareast-language:ES">
<a class="moz-txt-link-abbreviated" href="mailto:opencms-dev-bounces@opencms.org">opencms-dev-bounces@opencms.org</a>
[<a class="moz-txt-link-freetext" href="mailto:opencms-dev-bounces@opencms.org">mailto:opencms-dev-bounces@opencms.org</a>] <b>En nombre
de </b>Daniel Seidel<br>
<b>Enviado el:</b> lunes, 20 de febrero de 2017 13:22<br>
<b>Para:</b> <a class="moz-txt-link-abbreviated" href="mailto:opencms-dev@opencms.org">opencms-dev@opencms.org</a><br>
<b>Asunto:</b> Re: [opencms-dev] AND, OR and LITERAL
type search options using the JSP search functionality<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p>Hi Rafael,<o:p></o:p></p>
<p>you can use the local query parameters, specifying the query
modifier, i.e., {!q.op=AND}%(query). You might also consider
using the modifier to add quotes for phrase search. This might
only cause problems if someone enters quotes in his query.<o:p></o:p></p>
<p><o:p> </o:p></p>
<p>Best, Daniel.<o:p></o:p></p>
<p><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Am 20.02.2017 um 09:22 schrieb Cano
Parra, Rafael:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">Dear all,<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">I am configuring the JSP search
functionality with a custom formatter.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">I followed the documentation and the
example formatter, with good results in pagination, sorting,
and search content.<o:p></o:p></p>
<p class="MsoNormal">However, I can not find how to implement
a type search with three options: search any word (OR
option, it is the default behavior), search all words (AND
option), and search a literal phrase (words between
quotations).<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">I found that SOLR has an option to
configure AND search with local parameters (i.e., using
“{¡q.op=AND}” attached before the search query), but I can
not find the way to implement this with the JSP search
formatter configuration, or by code in the formatter.<o:p></o:p></p>
<p class="MsoNormal">Also, I can not find the way to cover the
search query with quotations when the “search a literal
phrase” option is selected, without requiring the user to
explicitly write the quotations in the search query.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Can anyone help me, please?<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Best regards,<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><b><span style="mso-fareast-language:ES">Rafael
Cano Parra</span></b><o:p></o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:ES">Servicio
de Informática</span><o:p></o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:ES">Tel.:
947 52 20 13 – Ext.: 34 941</span><o:p></o:p></p>
<p class="MsoNormal"><a moz-do-not-send="true"
href="mailto:rafaelcano@saludcastillayleon.es"><span
style="mso-fareast-language:ES">rafaelcano@saludcastillayleon.es</span></a><o:p></o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:ES"> </span><o:p></o:p></p>
<p class="MsoNormal"><b><span
style="color:#1F497D;mso-fareast-language:ES">Hospital
Santos Reyes</span></b><o:p></o:p></p>
<p class="MsoNormal"><span
style="color:#1F497D;mso-fareast-language:ES">Avda.
Ruperta Baraya, 6</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="color:#1F497D;mso-fareast-language:ES">09400 Aranda
de Duero (Burgos)</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="color:#1F497D;mso-fareast-language:ES">Tel.: 947 52
20 00 – Ext.: 34 600</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="color:#1F497D;mso-fareast-language:ES">Fax: 947 52
20 12</span><o:p></o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:ES"> </span><o:p></o:p></p>
<p class="MsoNormal"><a moz-do-not-send="true"
href="https://www.saludcastillayleon.es/HSReyesAranda/"><span
style="mso-fareast-language:ES;text-decoration:none"><img
id="Imagen_x0020_1"
src="cid:part11.A7A914EB.30E29098@alkacon.com"
alt="logo_hsry" border="0" height="32" width="44"></span></a><span
style="mso-fareast-language:ES">
</span><a moz-do-not-send="true"
href="https://www.saludcastillayleon.es/"><span
style="mso-fareast-language:ES;text-decoration:none"><img
id="Imagen_x0020_2"
src="cid:part13.0E2459C4.3AABACF0@alkacon.com"
alt="logo_sacyl" border="0" height="32" width="63"></span></a><span
style="mso-fareast-language:ES"> </span><a
moz-do-not-send="true" href="https://www.jcyl.es/"><span
style="mso-fareast-language:ES;text-decoration:none"><img
id="Imagen_x0020_3"
src="cid:part8.0A958FDA.A0AC8BB6@alkacon.com"
alt="logo_jcyl" border="0" height="32" width="53"></span></a><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:12.0pt;font-family:"Times New
Roman","serif";mso-fareast-language:ES"><br>
--- AVISO SOBRE CONFIDENCIALIDAD. La legislación española
ampara el secreto de las comunicaciones. Este correo
electrónico y sus anexos son estrictamente confidenciales.
Si Vd. no es el destinatario del mismo, por favor,
notifíquenoslo inmediatamente y destruya el original. No
deberá copiar este mensaje ni sus anexos o usarlo para
propósito alguno, ni divulgar su contenido a ninguna
persona. ---- ---- --- WARNING ABOUT CONFIDENTIALITY.
Spanish law guarantees privacy in electronic
communications. This message and its attachments are
confidential. If you are not the intended recipient
please, notify us immediately and destroy the original.
You should not copy this message or use it for any
purpose, nor disclose its content to any other person.
<br>
<br>
<br>
<o:p></o:p></span></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>This mail is sent to you from the opencms-dev mailing list<o:p></o:p></pre>
<pre>To change your list options, or to unsubscribe from the list, please visit<o:p></o:p></pre>
<pre><a moz-do-not-send="true" href="http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev">http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev</a><o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre><o:p> </o:p></pre>
<pre><o:p> </o:p></pre>
</blockquote>
<p class="MsoNormal"><span
style="font-size:12.0pt;font-family:"Times New
Roman","serif";mso-fareast-language:ES"><br>
<br>
<o:p></o:p></span></p>
<pre>-- <o:p></o:p></pre>
<pre>Kind Regards,<o:p></o:p></pre>
<pre>Daniel.<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>-------------------<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Daniel Seidel<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Alkacon Software GmbH & Co. KG - The OpenCms Experts <o:p></o:p></pre>
<pre><a moz-do-not-send="true" href="http://www.alkacon.com">http://www.alkacon.com</a> - <a moz-do-not-send="true" href="http://www.opencms.org">http://www.opencms.org</a> <o:p></o:p></pre>
<p class="MsoNormal"><span
style="font-size:12.0pt;font-family:"Times New
Roman","serif";mso-fareast-language:ES"><br>
--- AVISO SOBRE CONFIDENCIALIDAD. La legislación española
ampara el secreto de las comunicaciones. Este correo
electrónico y sus anexos son estrictamente confidenciales.
Si Vd. no es el destinatario del mismo, por favor,
notifíquenoslo inmediatamente y destruya el original. No
deberá copiar este mensaje ni sus anexos o usarlo para
propósito alguno, ni divulgar su contenido a ninguna
persona.
<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:12.0pt;font-family:"Times New
Roman","serif";mso-fareast-language:ES">----
----
<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:12.0pt;font-family:"Times New
Roman","serif";mso-fareast-language:ES">---
WARNING ABOUT CONFIDENTIALITY. Spanish law guarantees
privacy in electronic communications. This message and its
attachments are confidential. If you are not the intended
recipient please, notify us immediately and destroy the
original. You should not copy this message or use it for any
purpose, nor disclose its content to any other person.
<o:p></o:p></span></p>
</div>
<br>
--- AVISO SOBRE CONFIDENCIALIDAD. La legislación española ampara
el secreto de las comunicaciones. Este correo electrónico y sus
anexos son estrictamente confidenciales. Si Vd. no es el
destinatario del mismo, por favor, notifíquenoslo inmediatamente y
destruya el original. No deberá copiar este mensaje ni sus anexos
o usarlo para propósito alguno, ni divulgar su contenido a ninguna
persona.
---- ----
--- WARNING ABOUT CONFIDENTIALITY. Spanish law guarantees privacy
in electronic communications. This message and its attachments are
confidential. If you are not the intended recipient please, notify
us immediately and destroy the original. You should not copy this
message or use it for any purpose, nor disclose its content to any
other person.
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
<a class="moz-txt-link-freetext" href="http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev">http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Kind Regards,
Daniel.
-------------------
Daniel Seidel
Alkacon Software GmbH & Co. KG - The OpenCms Experts
<a class="moz-txt-link-freetext" href="http://www.alkacon.com">http://www.alkacon.com</a> - <a class="moz-txt-link-freetext" href="http://www.opencms.org">http://www.opencms.org</a> </pre>
</body>
</html>