I am using liferay6.2. I uploaded a Word file in document and media. If I am searching for a word like example, "stack overflow" which occurs in 10 places in the document. I'm getting only the first three occurrences. How do I get all occurrences in the file? For this I tried following
SearchContext searchContext = SearchContextFactory.getInstance(request);
searchContext.setKeywords(keywords);
QueryConfig queryConfig = new QueryConfig();
queryConfig.setHighlightEnabled(true);
searchContext.setQueryConfig(queryConfig);
MultiValueFacet xhtmlFacet = new MultiValueFacet(searchContext);
xhtmlFacet.setFieldName("extension");
String[] extensions = {"docx"};
xhtmlFacet.setValues(extensions);
searchContext.addFacet(xhtmlFacet);
Indexer indexer = IndexerRegistryUtil.getIndexer("com.liferay.portlet.documentlibrary.model.DLFileEntry");
Hits hits = indexer.search(searchContext);
PortletURL portleturl1 = PortletURLFactoryUtil.create(request, themeDisplay.getPortletDisplay().getId(), themeDisplay.getPlid(), PortletRequest.RENDER_PHASE);
List<SearchResult> searchResults = SearchResultUtil.getSearchResults(hits,serviceContext.getLocale(), portleturl1);
for(SearchResult searchResult : searchResults ){
Summary summary = searchResult.getSummary();
System.out.println("content :"+ summary.getContent());*/
}
But, this return only the first three occurrences. How to increase searched results snippet content size or length in lifery or is there any other way in liferay to get all occurences?