Ciao Gioele,

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).

Now for Jahia 5 you have to add this in your Search class :
...
String description = thisHit.getTeaser();
CompassHighlighter highlighter = thisHit.highlighter();
if ( highlighter != null ){
    description = highlighter.fragmentsWithSeparator(
            JahiaSearchConstant.CONTENT_FULLTEXT_SEARCH_FIELD);
    description = description.replaceAll("\\r\\n", "\r");
    description = description.replaceAll("\\r{2,}", "<br/>");
}
...

Regards,
Benjamin


On 19.03.2009 15:47 Zanzico Gioele wrote:

Hi,

doing a search implementing the API of Jahia (Search.java) it works and the number of results seems correct.

Doing the same search (the same search key) with the standard .jsp of Jahia (searchresults.jsp)

in effect we get the same number of record, but the teaser is different.

In our “custom” search they teaser seems to keep only a little bit of the description,

with the “standard” search it is more long, more or less with all the content of the result.

 

Does it is necessary to change something on our code to get the same teaser

or using the API this is the correct result ?

 

tks

ciao

gioele

 

Zanzico Gioele
Senior Web Analyst

Vitec Group - Imaging & Staging
Tel   +39 0424 555 507
MailScanner has detected a possible fraud attempt from "www.manfrotto.com" claiming to be www.vitecgroup.it
P Respect the environment: don’t print this e-mail, if not necessary.

 


_______________________________________________ dev_list mailing list [email protected] http://lists.jahia.org/cgi-bin/mailman/listinfo/dev_list


_______________________________________________
dev_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/dev_list

Reply via email to