Solved

Apache Solr Search how to Highlight

Posted on 2015-01-02
4
256 Views
Last Modified: 2015-01-06
Hi..
I have a search that returns JSON with the highlighting feature. It returns addtional JSON like
this

"highlighting":{
    "903514":{
      "details":["<em>Smith</em>"],
      "text":["<em>Smith</em>"]},


How can use JS to use this JSON and highlight the search results text in HTML page?

Any ideas?
0
Comment
Question by:JElster
  • 3
4 Comments
 
LVL 25

Assisted Solution

by:James Rodgers
James Rodgers earned 500 total points
ID: 40529513
solr has a built in highlihtong settings and option, how are you  calling the search?
0
 
LVL 1

Author Comment

by:JElster
ID: 40529535
...wt=json&indent=true&hl=true&hl.simple.pre=%3Cem%3E&hl.simple.post=%3C%2Fem%3E'

I need to findout how I can process the returned JSON t to show the highlighted text
0
 
LVL 25

Accepted Solution

by:
James Rodgers earned 500 total points
ID: 40529787
Have a look at  this to see how the json is parsed for highlighting
http://wiki.apache.org/solr/SolJSON
contained within the function updatepage block
0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 40533712
glad i could help
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
This video teaches viewers about errors in exception handling.
The viewer will learn how to count occurrences of each item in an array.

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now