Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Apache Solr Search how to Highlight

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

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
This video teaches viewers about errors in exception handling.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

829 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