Skip to main content

How to generate snippets in solr?


Snippet generation in the solr with lucene highlight is simple to configure task. Now with the advanced versions of he solr the snippet geneation works just fine bedefault. But there is need for change in the request.
To get the search results highlighted with the search terms in them and also to get the snippets i.e relevant text parts for users for deciding the relevance of the specific search results, you have to query the solr with parameters hl and hl.fl set to 'true' and 'filed name like title/content' etc.
Ex. Your query for the locally setup solr will be
http://localhost:8983/solr/select/?q=learning%20management%20systems&version=2.2&start=0&rows=10&indent=on&hl=true&hl.fl=CONTENT
where CONTENT is my name of my field which may be different for others.

And the highlighted part of the results occure at the botton after the results tag, as .
And in that the search terms are enclosed in the tags.

Comments

Popular posts from this blog

आपण महाराष्ट्राच्या संस्कृतीचे अजूनही खरंच पाईक आहोत कि भरकटलोत ?

महाराष्ट्र दिनाच्या सगळ्यांना शुभेच्छा. तसं ज्याला आज आपण महाराष्ट्र म्हणतो, त्याचा हा आधुनिक जन्म दिवस. महाराष्ट्र कधी पासून अस्तित्वात असेल? म्हणजे इथली संस्कृती, आपण जे वागतो, जगतो, बोलतो, राहतो वगैरे वगैरे. कधी पासून हे सगळं असं असावं? याचं उत्तर आपल्या सारख्या सामान्यांपेक्षा हा ज्या कोणत्या विषयाचा विषय असेल त्या विषयाच्या निष्णातांना जास्त चांगलं माहित असेल. तरी, आपला एक सामान्य माणूस म्हणून या भूमीवर अधिकार आहे आणि त्याच अधिकाराने आपण आपला एक अंदाज लावू शकतो. म्हणजे ज्ञानेश्वर-नामदेव इथे आपल्याला या मराठी राज्याची - महाराष्ट्राची - सुरुवात झाली असावी, असा अंदाज लावता येईल.म्हणजे आजच्या आपल्या मराठी म्हणता येईल अशा संस्कृतीची सुरवात तिथून झाली असं आपण समजू शकतो. किंवा मला जे मांडायचं त्या साठी ते सोयीचं आहे म्हणून समजा हवं तर! पण मीच कशाला वारकरी साहित्यातच संत बहिणाबाईंनी लिहून ठेवलयं - संतकृपा झाली । इमारत फळा आली ॥ १ ॥ ज्ञानदेवें रचिला पाया । उभारिलें देवालया ॥ २ ॥ नामा तयाचा किंकर । तेणें रचिलें तें आवार ॥ ३ ॥ जनार्दन एकनाथ । खांब दिधला भागवत ॥ ४ ॥ तुका झालासे कळस । भजन करा ...

Publishing business basics

Basic Steps: 1. Decide name for the company 2. Register the company with ministry - you will need an attorney (Lawyer for that) 3. Register with Registrar of News Papers in India if it's a magazine/News paper.  4. Study the relevant acts in general or get them known from the lawyer 5. Start publishing Following are details regarding the same (not that well written) : ----- Some starts and books; * Start Your Own Self-Publishing Business (Entrepreneur Magazine's Start Up) by Entrepreneur Press  * How To Start And Run A Small Book Publishing Company: A Small Business Guide To Self-Publishing And Independent Publishing by Peter I. Hupalo  * Art & Science Of Book Publishing by Herbert S., Jr. Bailey  * This Business of Books: A Complete Overview of the Industry from Concept Through Sales by Claudia Suzanne Raja Rammohun Roy National Agency for ISBN West Block-I, Wing-6, 2nd Floor, Sector -I, R.K. Puram, New Delhi-110066 Some new things and t...

Is Higher Education a Bubble? A view ...

Peter Thiel founder PayPal and now a Venture Capitalist puts his thought on the education system. Looks his thoughts are biased to his  experiences, but this view towards education is not completely wrong when the education system doesn't produce the quality resources. The situation in the India is similar and may be the bauble will burst one day. Need to be careful. Education is a bubble in a classic sense. To call something a bubble, it must be overpriced and there must be an intense belief in it. Housing was a classic bubble, as were tech stocks in the ’90s, because they were both very overvalued, but there was an incredibly widespread belief that almost could not be questioned — you had to own a house in 2005, and you had to be in an equity-market index fund in 1999. Probably the only candidate left for a bubble — at least in the developed world (maybe emerging markets are a bubble) — is education. It’s basically extremely overpriced. People ar...