Just figured out what happened... It's necessary for the schema to have a uniqueKey set, otherwise, highlighting will have one or less entries, as the map's key is the doc uniqueKey, so on debuggin I figured out that the QueryResponse tries to put all highlighted results in a map with null key... at end, putting tons of entries all with null key will result on a one-entry-only map.
Thanks for the help guys. On Thu, Jun 18, 2009 at 3:17 PM, Bruno <brun...@gmail.com> wrote: > I've checked the NamedList you told me about, but it contains only one > highlighted doc, when there I have more docs that sould be highlighted. > > > On Thu, Jun 18, 2009 at 3:03 PM, Erik Hatcher > <e...@ehatchersolutions.com>wrote: > >> Note that highlighting is NOT part of the document list returned. It's in >> an additional NamedList section of the response (with name="highlighting") >> >> Erik >> >> >> On Jun 18, 2009, at 1:22 PM, Bruno wrote: >> >> Hi guys. >>> >>> I new at using highlighting, so probably I'm making some stupid mistake, >>> however I'm not founding anything wrong. >>> >>> I use highlighting from a query withing a EmbeddedSolrServer, and within >>> the query I've set parameters necessary for enabling highlighting. Attached, >>> follows my schema and solrconfig.xml , and down below follows the Java code. >>> Content from the SolrDocumentList is not highlighted. >>> >>> EmbeddedSolrServer server = SolrServerManager.getServerEv(); >>> String queryString = filter; >>> SolrQuery query = >>> >>> new SolrQuery(); >>> >>> query.setQuery(queryString); >>> query.setHighlight(true); >>> query.addHighlightField(LOG_FIELD); >>> query.setHighlightSimplePost("<i>"); >>> query.setHighlightSimplePre("</i>"); >>> query.set("hl.usePhraseHighlighter", true); >>> query.set("hl.highlightMultiTerm", true); >>> query.set("hl.snippets", 100); >>> query.set("hl.fragsize", 1); >>> query.set("hl.mergeContiguous", false); >>> query.set("hl.requireFieldMatch", false); >>> query.set("hl.maxAnalyzedChars", -1); >>> >>> query.addSortField(DATE_FIELD, SolrQuery.ORDER.asc); >>> query.setFacetLimit(LogUtilProperties.getInstance().getProperty(LogUtilProperties.LOGEVENT_SEARCH_RESULT_SIZE, >>> 10000)); >>> query.setRows(LogUtilProperties.getInstance().getProperty(LogUtilProperties.LOGEVENT_SEARCH_RESULT_SIZE, >>> 10000)); >>> query.setIncludeScore(true); >>> QueryResponse rsp = server.query(query); >>> SolrDocumentList docs = rsp.getResults(); >>> >>> -- >>> Bruno Morelli Vargas >>> Mail: brun...@gmail.com >>> Msn: brun...@hotmail.com >>> Icq: 165055101 >>> Skype: morellibmv >>> >>> <schema.xml><solrconfig.xml> >>> >> >> > > > -- > Bruno Morelli Vargas > Mail: brun...@gmail.com > Msn: brun...@hotmail.com > Icq: 165055101 > Skype: morellibmv > > -- Bruno Morelli Vargas Mail: brun...@gmail.com Msn: brun...@hotmail.com Icq: 165055101 Skype: morellibmv