Hello, Thanks for replying! I tried using it in a query string, but without success. Should I add it to my solrconfig? If so, are there any other hl parameters that are necessary?
-Teague > On Dec 1, 2015, at 9:01 PM, Philippe Soares <soa...@gqlifesciences.com> wrote: > > Hi, > Did you try hl.mergeContiguous=true ? > > On Tue, Dec 1, 2015 at 3:36 PM, Teague James <teag...@insystechinc.com> > wrote: > >> Hello everyone, >> >> I am having difficulty enabling phrase highlighting and am hoping someone >> here can offer some help. This is what I have currently: >> >> Solr 4.9 >> solrconfig.xml (partial snip) >> <requestHandler name="/select" class="solr.SearchHandler"> >> <lst name="defaults"> >> <str name="wt">xml</str> >> <str name="echoParams">explicit</str> >> <int name="rows">10</int> >> <str name="df">text</str> >> <str name="hl">on</str> >> <str name="hl.fl">text</str> >> <str name="hl.encoder">html</str> >> <str name="hl.snippets">100</str> >> <str name="hl.simple.pre"><b></str> >> <str name="hl.simple.post"></b></str> >> </lst> >> </requestHandler> >> >> schema.xml (partial snip) >> <field name="id" type="string" indexed="true" stored="true" >> required="true" multiValued="false" /> >> <field name="documentText" type="string" indexed="true" stored="true" /> >> >> Query (partial snip): >> ...select?fq=id:43040&q="my%20search%20phrase" >> >> Response (partial snip): >> ... >> <str> >> ipsum dolor sit amet, pro ne verear prompta, sea te aeterno scripta >> assentior. (<b>my</b> <b>search</b> >> </str> >> <str> >> <b>phrase</b> facilitates highlighting). Et option molestiae referrentur >> ius. Viris quaeque legimus an pri >> </str> >> >> The document in which this phrase is found is very long. If I reduce the >> document to a single sentence, such as "My search phrase facilitates >> highlighting" then the response I get from Solr is: >> <str> >> <b>My</b> <b>search</b> <b>phrase</b> facilitates highlighting >> </str> >> >> What I am trying to achieve instead, regardless of the document size is: >> <str><b>My search phrase</b></str> with a single indicator at the beginning >> and end rather than three separate words that may get dsitributed between >> two different snippets depending on the placement of the snippet in te >> larger document. >> >> I tried to follow this guide: >> >> http://stackoverflow.com/questions/25930180/solr-how-to-highlight-the-whole- >> search-phrase-only/25970452#25970452 but got zero results. I suspect that >> this is due to the hl parameters in my solrconfig file, but I cannot find >> any specific guidance on the correct parameters should be. I tried >> commenting out all of the hl parameters and also got no results. >> >> Can anyone offer any solutions for searching large documents and returning >> a >> single phrase highlight? >> >> -Teague > > > -- > [image: GQ Life Sciences, Inc.] <http://www.gqlifesciences.com/>Philippe > Soares Senior Developer | [image: ☎] +1 508 599 3963 > GQ Life Sciences, Inc. www.gqlifesciences.comThis email message and any > attachments are confidential and may be privileged. If you are not the > intended recipient, please notify GQ Life Sciences immediately by > forwarding this message to le...@gqlifesciences.com and destroy all copies > of this message and any attachments without reading or disclosing their > contents.