In theory, you could store all your pages in a single document using a
dynamic field type:

<dynamicField name="page*" type="text" indexed="true" stored="true" />

Store each page in a separate field (e.g. page1, page2, page3 .. pageN) then
at query time, use the highlighting parameters to highlight matches in the
page fields. You should be able to determine the page field that matched the
query by observing the highlighted results (I'm not certain if the
hl.flparameter accepts dynamic field names, you may need to specify
them all
manually):

hl=true&hl.fl=page1,page2,page3,pageN&hl.requireFieldMatch=true

It sounds like a bit of a rough hack and I haven't actually tried to do this
myself, maybe someone else has a better idea?

cheers,
Piete


On 08/08/2007, Pierre-Yves LANDRON <[EMAIL PROTECTED]> wrote:
>
> Hello,Is it possible to structure lucene documents via Solr, so one
> document coud fit into another one ?What I would like to do, for example :I
> want to retrieve full text articles, that fit on several pages for each of
> them. Results must take in account both the pages and the article from wich
> the search terms are from. I can create a lucene document for each pages of
> the article AND the article itself, and do two requests to get my results,
> but it would duplicate the full text in the index, and will not be too
> efficient. Ideally, what I would like to do is to create a document for
> indexing the text of each pages of the article, and group these documents in
> one document that describe the article : this way, when Lucene retrieve a
> requested term, i'll get the article and the page that contains the 
> term.Iwonder if there's a way to emulate elegantly this behavior with Solr 
> ?Kind
> Regards,Pierre-Yves Landron
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today it's FREE!
> http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

Reply via email to