You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Karthik N S <ka...@controlnet.co.in> on 2004/12/09 08:59:32 UTC
SEARCH +HITS+LIMIT
Hi Guy's
Apologies...............
One question for the form [ Especially Erik]
1) I have a MERGED Index with 100,000 File Indexed into it ( Content is
one of the Fields of Type 'Text' )
2) On search for a simple words "Camera" returns me 6000 hits.
3) Since the Search process is via WebApps , a simple JSP is used to
display the Content.
Question
How to Display the Contents for the Hits in Incremental order ?
[ Each Time a re hit to the Mergerindex with Incremental X value ].
This would solve the problem of Out of Memory by prefetching all the hit in
one strait go process.
Ex:
Total hits 6000
1st page - hit's returned (1 to 25)
2nd page - hit's returned (26 to 50)
.
.
.
.
N th page hit's returned ( 5975 - 6000 )
Hint : - This is similar to a SQL query SELECT * FROM LUCENE LIMIT 10, 5
WITH WARM REGARDS
HAVE A NICE DAY
[ N.S.KARTHIK]
---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org
Re: SEARCH +HITS+LIMIT
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Dec 9, 2004, at 2:59 AM, Karthik N S wrote:
> Apologies...............
Again, no need to apologize for asking questions. Just ask :)
> One question for the form [ Especially Erik]
And no need to address anyone specifically here, though I'm happy to
help and am always here listening.
> Question
>
> How to Display the Contents for the Hits in Incremental order ?
>
> [ Each Time a re hit to the Mergerindex with Incremental X value ].
> This would solve the problem of Out of Memory by prefetching all the
> hit in
> one strait go process.
It is unwise, as you've seen, to prefetch the documents from Hits.
Hits is designed for exactly what you're after. You can get the number
of hits using hits.size().
My recommendation for paging through search results (and I'm using this
extensively myself) in a web application is to simply display 25
results on one page - iterating *only* through those 25 desired. The
link (or button) the user presses to go to the next or previous page
passes the page number and query (search.jsp?query=some+query&page=2).
Your server-side logic will search again, and start the hits iteration
for 25 entries at 25 * the value of the page attribute.
Lucene is plenty fast enough to allow this to work without much
concern. Since your index is getting somewhat large, though, you
probably do want to keep a persistent instance of IndexSearcher
available on the server (perhaps in application scope). But a first
pass implementation don't concern yourself with even that - just
re-instantiate IndexSearcher for every search and see how fast things
are. If its fast enough, leave well enough alone.
Does this all make sense?
Erik
---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org
Re: SEARCH +HITS+LIMIT
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Dec 10, 2004, at 8:24 AM, Andraz Skoric wrote:
> Displaytag (http://displaytag.sourceforge.net/) is for displaying
> search results in multiple pages
I don't know displaytag internals, but be cautious with such things.
What you do not want to happen is all the results to be grabbed and
cached somehow. You only want to retrieve the actual documents being
shown on that specific page. It looks like displaytag can support
this, as long as you provide your own custom pruned document set.
Personally, I use Tapestry :)
Erik
---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org
Re: SEARCH +HITS+LIMIT
Posted by Andraz Skoric <an...@medius.si>.
Displaytag (http://displaytag.sourceforge.net/) is for displaying search
results in multiple pages
lp, a
Karthik N S wrote:
>Hi Guy's
>
>Apologies...............
>
>
>
>One question for the form [ Especially Erik]
>
>
>1) I have a MERGED Index with 100,000 File Indexed into it ( Content is
>one of the Fields of Type 'Text' )
>
>2) On search for a simple words "Camera" returns me 6000 hits.
>
>3) Since the Search process is via WebApps , a simple JSP is used to
>display the Content.
>
>
>Question
>
>How to Display the Contents for the Hits in Incremental order ?
>
>[ Each Time a re hit to the Mergerindex with Incremental X value ].
>This would solve the problem of Out of Memory by prefetching all the hit in
>one strait go process.
>
>Ex:
>
>Total hits 6000
>
>1st page - hit's returned (1 to 25)
>2nd page - hit's returned (26 to 50)
>.
>.
>.
>.
>
> N th page hit's returned ( 5975 - 6000 )
>
>Hint : - This is similar to a SQL query SELECT * FROM LUCENE LIMIT 10, 5
>
>
>
> WITH WARM REGARDS
> HAVE A NICE DAY
> [ N.S.KARTHIK]
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org