Solved

Apache Solr Search how to Highlight

Posted on 2015-01-02
4
266 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

770 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