Solved

Apache Solr Search how to Highlight

Posted on 2015-01-02
4
276 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
[X]
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
  • 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

Save the day with this special offer from ATEN!

Save 30% on the CV211 using promo code EXPERTS30 now through April 30th. The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
WordPress 8 54
Drop down list show all elements but disabled for selection 6 36
Problem to copy file 14 51
SP inserts data with order number, then push the rest one order up 11 19
When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
The viewer will learn how to implement Singleton Design Pattern in Java.
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.

749 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