Re: (no subject)
Benjamin Papez <[email protected]> Thu, 19 Mar 2009 16:29:59 +0100
| Newsgroups | gmane.comp.cms.jahia.devel |
|---|---|
| Message-ID | <[email protected]> |
--===============0320597562==
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Ciao Gioele,<br>
<br>
please always mention which Jahia version you are using, since Jahia 6
is out and Manfrotto still used Jahia 4, so there are different
possibilities. I believe your question is based on Jahia 5, because in
Jahia 6 I have already changed the teaser retrieval. In Jahia 5 you may
see, that the teaser is created in the JSP, so that the one returned
from the searchhit object is just the default (in Jahia 6 the API will
already return the highlighted teaser). <br>
<br>
Now for Jahia 5 you have to add this in your Search class :<br>
...<br>
String description = thisHit.getTeaser();<br>
CompassHighlighter highlighter = thisHit.highlighter();<br>
if ( highlighter != null ){<br>
description = highlighter.fragmentsWithSeparator(<br>
JahiaSearchConstant.CONTENT_FULLTEXT_SEARCH_FIELD);<br>
description = description.replaceAll("\\r\\n", "\r");<br>
description = description.replaceAll("\\r{2,}", "<br/>");<br>
}<br>
...<br>
<br>
Regards,<br>
Benjamin<br>
<br>
<br>
On 19.03.2009 15:47 Zanzico Gioele wrote:
<blockquote
cite="mid:[email protected]"
type="cite">
<meta http-equiv="Content-Type" content="text/html; ">
<meta name="Generator" content="Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Webdings;
panose-1:5 3 1 2 1 5 9 6 7 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.StileMessaggioDiPostaElettronica17
{mso-style-type:personal-compose;
font-family:Verdana;
color:windowtext;
font-weight:normal;
font-style:normal;
text-decoration:none none;}
@page Section1
{size:595.3pt 841.9pt;
margin:70.85pt 2.0cm 2.0cm 2.0cm;}
div.Section1
{page:Section1;}
-->
</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="Section1">
<p class="MsoNormal"><font face="Verdana" size="1"><span
style="font-size: 8pt; font-family: Verdana;" lang="EN-GB">Hi, <o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Verdana" size="1"><span
style="font-size: 8pt; font-family: Verdana;" lang="EN-GB">doing a
search implementing the API of Jahia (</span></font><font color="black"
face="Verdana" size="1"><span
style="font-size: 8pt; font-family: Verdana; color: black;"
lang="EN-GB">Search.java)</span></font><font face="Verdana" size="1"><span
style="font-size: 8pt; font-family: Verdana;" lang="EN-GB"> it works
and the number of results seems correct.<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Verdana" size="1"><span
style="font-size: 8pt; font-family: Verdana;" lang="EN-GB">Doing the
same search (the same search key) with the
standard .jsp of Jahia (searchresults.jsp) <o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Verdana" size="1"><span
style="font-size: 8pt; font-family: Verdana;" lang="EN-GB">in effect
we get the same number of record, but the teaser
is different.<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Verdana" size="1"><span
style="font-size: 8pt; font-family: Verdana;" lang="EN-GB">In our
“custom” search they teaser seems
to keep only a little bit of the description, <o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Verdana" size="1"><span
style="font-size: 8pt; font-family: Verdana;" lang="EN-GB">with the
“standard” search it is more
long, more or less with all the content of the result.<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Verdana" size="1"><span
style="font-size: 8pt; font-family: Verdana;" lang="EN-GB"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font face="Verdana" size="1"><span
style="font-size: 8pt; font-family: Verdana;" lang="EN-GB">Does it is
necessary to change something on our code
to get the same teaser<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Verdana" size="1"><span
style="font-size: 8pt; font-family: Verdana;" lang="EN-GB">or using
the API this is the correct result ?<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Verdana" size="1"><span
style="font-size: 8pt; font-family: Verdana;" lang="EN-GB"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font face="Verdana" size="1"><span
style="font-size: 8pt; font-family: Verdana;" lang="EN-GB">tks<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Verdana" size="1"><span
style="font-size: 8pt; font-family: Verdana;" lang="EN-GB">ciao<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Verdana" size="1"><span
style="font-size: 8pt; font-family: Verdana;" lang="EN-GB">gioele<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Verdana" size="1"><span
style="font-size: 8pt; font-family: Verdana;" lang="EN-GB"><o:p> </o:p></span></font></p>
<p class="MsoNormal" style=""><b><font face="Arial" size="1"><span
style="font-size: 8pt; font-family: Arial; font-weight: bold;"
lang="EN-GB">Zanzico Gioele</span></font></b><span lang="EN-GB"><br>
</span><b><font face="Arial" size="1"><span
style="font-size: 8pt; font-family: Arial; font-weight: bold;"
lang="EN-GB">Senior Web Analyst<o:p></o:p></span></font></b></p>
<p class="MsoNormal" style=""><font face="Arial" size="1"><span
style="font-size: 8pt; font-family: Arial;" lang="EN-GB">Vitec
Group - Imaging & Staging<br>
Tel +39 0424 555 507<br>
</span></font><font face="Arial" size="1"><span
style="font-size: 8pt; font-family: Arial;" lang="EN-US"></span><a
moz-do-not-send="true" href="blocked::http://www.manfrotto.com/"
title="blocked::http://www.manfrotto.com/
http://www.manfrotto.com/"><font
color="red"><b>MailScanner has detected a possible fraud attempt from
"www.manfrotto.com" claiming to be</b></font> <span
title="blocked::http://www.manfrotto.com/
http://www.manfrotto.com/">www.vitecgroup.it</span></a><br>
</font><font color="green" face="Webdings" size="6"><span
style="font-size: 22pt; font-family: Webdings; color: green;"
lang="EN-US">P </span></font><b><font color="green" face="Arial"
size="1"><span
style="font-size: 8pt; font-family: Arial; color: green; font-weight: bold;"
lang="EN-US">Respect the environment:
don’t print this e-mail, if not necessary.</span></font></b><font
face="Arial" size="1"><span style="font-size: 8pt; font-family: Arial;"
lang="EN-US"> </span></font><span lang="EN-GB"><o:p></o:p></span></p>
<p class="MsoNormal"><font face="Times New Roman" size="3"><span
style="font-size: 12pt;" lang="EN-GB"><o:p> </o:p></span></font></p>
</div>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
dev_list mailing list
<a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a>
<a class="moz-txt-link-freetext" href="http://lists.jahia.org/cgi-bin/mailman/listinfo/dev_list">http://lists.jahia.org/cgi-bin/mailman/listinfo/dev_list</a>
</pre>
</blockquote>
</body>
</html>
--===============0320597562==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
dev_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/dev_list
--===============0320597562==--