Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8845097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:39:18+00:00 2026-06-14T11:39:18+00:00

I’m using Solr example server to do an investigation. After fed it with all

  • 0

I’m using Solr example server to do an investigation. After fed it with all cached documents, mostly html files, it works fine except the highlight part.

The request URL I’m using is as followed,

http://localhost:8983/solr/collection1/select?q=keyword&wt=xml&hl=true

And the XML response is as followed,

<response>
<lst name="responseHeader">...</lst>
<result name="response" numFound="371" start="0">
    <doc>
        <arr name="links">
            <str>rect</str>
            <str>FJU_KDJFJJ_DJ_13</str>
        </arr>
        <str name="id">
            F:\SkyDrive\funproj\cache\adfadf\asdff.htm
        </str>
        <arr name="title">
            <str>asdff.htm</str>
        </arr>
        <arr name="content_type">
            <str>text/html; charset=ISO-8859-1</str>
        </arr>
        <str name="resourcename">
            F:\SkyDrive\funproj\cache\adfadf\asdff.htm
        </str>
        <arr name="content">
            <str>...</str>
        </arr>
        <long name="_version_">1418589758873927680</long>
    </doc>
    <doc>...</doc>
</result>
<lst name="highlighting">
    <lst name="F:\SkyDrive\funproj\cache\adfadf\asdff.htm"/>
    <lst name="F:\SkyDrive\funproj\cache\cvzcv\c58053e10vq.htm"/>
    <lst name="F:\SkyDrive\funproj\cache\hgdfhdfgh\c00302e10vq.htm"/>
    <lst name="F:\SkyDrive\funproj\cache\asdfasdf\c00945e10vq.htm"/>
    <lst name="F:\SkyDrive\funproj\cache\hjmyukt\asfdf06113002_03312010.htm"/>
    <lst name="F:\SkyDrive\funproj\cache\nmvbmnm\saf0q033111.htm"/>
    <lst name="F:\SkyDrive\funproj\cache\lkiullkl\a10-5974_110q.htm"/>
    <lst name="F:\SkyDrive\funproj\cache\jhlhjkl\fdfinal.htm"/>
    <lst name="F:\SkyDrive\funproj\cache\vcbxcbvcx\zynex10q33110_5132010.htm"/>
    <lst name="F:\SkyDrive\funproj\cache\yuiuiou\v185403_10q.htm"/>
</lst>
</response>

The response, no matter JSON or XML, does not have the highlight part at all. I’ve checked the solrconfig.xml both in local file system and the admin page of the example server. The Highlighting is default on and pre/post are set to ““/”“. The example search portal itself works fine with highlight in its results. But since it’s not AJAX, there’s no way for me to check its result through chrome.

What did I do wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T11:39:20+00:00Added an answer on June 14, 2026 at 11:39 am

    You have to define the fields using hl.fl which needs to be highlighted. For example, if you want to search and highlight hits in content field, you can use query below:

    http://localhost:8983/solr/collection1/select?q=content:keyword&wt=xml&hl=true&hl.q=content:keyword&hl.fl=content
    

    By default highlighting response returns only one snippet,even if your field have multiple hits. Also the length of snippet(fragsize) is set to 100 chars by default.

    You can use hl.snippets and hl.fragsize to modify them.

    For example, to modify fragsize:

    http://localhost:8983/solr/collection1/select?q=content:keyword&wt=xml&hl=true&hl.q=content:keyword&hl.fl=content&hl.fragsize=5000
    

    Passing hl.fragsize=0 will make fragsize unlimited.

    For changing number of snippets:

    http://localhost:8983/solr/collection1/select?q=content:keyword&wt=xml&hl=true&hl.q=content:keyword&hl.fl=content&hl.snippets=10
    

    Refer to solr wiki for more parameters.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have thousands of HTML files to process using Groovy/Java and I need to
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
i got an object with contents of html markup in it, for example: string
I have a reasonable size flat file database of text documents mostly saved in
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.