Satya, In fact the highlighter will select the relevant part of the whole text and return it with the matched terms highlighted.
If you do so for a whole book, you will face the issue spotted by Dave (too long text). To address that issue, you have the possibility to split your book in chapters, and index each chapter as a unique document. You would then be interested in adding a field to identify uniquely each book (using ISBN number for example) and turn on grouping (or collapsing) on that field ... (see this very good blog post : http://blog.jteam.nl/2009/10/20/result-grouping-field-collapsing-with-solr/ ) Moreover, you might be interested by the following JIRA issue : https://issues.apache.org/jira/browse/SOLR-2272 . Using this patch, you could for example ensure that if a given document-chapter is selected by the query, then another (or several) document(s) (maybe a father "book-document", or all the other chapters) get selected along the way (by doing a self-join on the ISBN number). Here again, grouping afterward would return a group of document representing each book. Good luck! -- Tanguy 2010/12/14 Dave Searle <dave.sea...@magicalia.com>: > Highlighting is exactly what you need, although if you highlight the whole > book, this could slow down your queries. Index/store the first 5000-10000 > characters and see how you get on > > -----Original Message----- > From: satya swaroop [mailto:satya.yada...@gmail.com] > Sent: 14 December 2010 10:08 > To: solr-user@lucene.apache.org > Subject: Re: Google like search > > Hi Tanguy, > I am not asking for highlighting.. I think it can be > explained with an example.. Here i illustarte it:: > > when i post the query like dis:: > > http://localhost:8080/solr/select?q=Java&version=2.2&start=0&rows=10&indent=on > > i Would be getting the result as follows:: > > -<response> > -<lst name="responseHeader"> > <int name="status">0</int> > <int name="QTime">1</int> > </lst> > -<result name="response" numFound="1" start="0"> > -<doc> > <str name="filename">Java%20debugging.pdf</str> > <str name="id">1222222</str> > -<arr name="text1"> > -<str> > Table of Contents > If you're viewing this document online, you can click any of the topics > below to link directly to that section. > 1. Tutorial tips 2 > 2. Introducing debugging 4 > 3. Overview of the basics 6 > 4. Lessons in client-side debugging 11 > 5. Lessons in server-side debugging 15 > 6. Multithread debugging 18 > 7. Jikes overview 20 > </str> > </arr> > </doc> > </result> > </response> > > Here the str field contains the first 300 characters of the file as i kept a > field to copy only 300 characters in schema.xml... > But i dont want the content like dis.. Is there any way to make an o/p as > follows:: > > <str> Java is one of the best language,java is easy to learn...</str> > > > where this content is at start of the chapter,where the first word of java > is occured in the file... > > > Regards, > Satya >