I want to get the excerpt(5 words before and after the search term) for the given fulltext search. I am trying hit.getExceprt() and it returns null. I know that I can set the excerpt properties in web console, but we can only set the jcr:properties there and I am not sure how to specify the content to include in the excerpt.
I also read that you can write a query in the indexer to index the summary. I am not sure how this is done and if it is the best approach.
Thanks Sam. I was expanding on the word excert by saying "5words before and after". What I actually meant was highlight the search term and in the excerpt it usually shows the sentence that the search term is found in.
My search query does not return 0 results. The query is working fine. I get the excerpt if the returned result is a page. But if it is a Pdf(dam:Asset), I do get results but the excerpt is null or empty.