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 Sarvadnya Mutalik <sa...@renaissance-it.com> on 2006/07/06 07:58:15 UTC

Problem : Searching with Lucene 2.0

Hi, I'm using Lucene 2.0, latest ver of Apache Lucene search engine.
After successfully indexing, when I tried to search, I'm not able to get
the complete information.
In the following code snippet, I'm getting the values for  "doctitle"
and "summary" as null.
While it says there are two results.


	for (int i = startindex; i < (thispage + startindex); i++) {  //
for each element

                        Document doc = hits.doc(i);
//get the next document 
                        String doctitle = doc.get("title");
//get its title
                        String url = doc.get("path");
//get its url field

                        if ((doctitle == null) || doctitle.equals(""))
//use the url if it has no title
                                doctitle = url;


		String summary = doc.get("summary");

		......
		......
	}

Please help..

Regards,
Sam

=========================================
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you
received this in error, please contact the sender and delete all copies
from any computer.




Re: Problem : Searching with Lucene 2.0

Posted by yueyu lin <po...@gmail.com>.
How you index "doctitle" and "summary".
The Store parameter must be "COMPRESS" or "YES"

On 7/6/06, Sarvadnya Mutalik <sa...@renaissance-it.com> wrote:
>
> Hi, I'm using Lucene 2.0, latest ver of Apache Lucene search engine.
> After successfully indexing, when I tried to search, I'm not able to get
> the complete information.
> In the following code snippet, I'm getting the values for  "doctitle"
> and "summary" as null.
> While it says there are two results.
>
>
>         for (int i = startindex; i < (thispage + startindex); i++) {  //
> for each element
>
>                         Document doc = hits.doc(i);
> //get the next document
>                         String doctitle = doc.get("title");
> //get its title
>                         String url = doc.get("path");
> //get its url field
>
>                         if ((doctitle == null) || doctitle.equals(""))
> //use the url if it has no title
>                                 doctitle = url;
>
>
>                 String summary = doc.get("summary");
>
>                 ......
>                 ......
>         }
>
> Please help..
>
> Regards,
> Sam
>
> =========================================
> The information transmitted is intended only for the person or entity to
> which it is addressed and may contain confidential and/or privileged
> material. Any review, retransmission, dissemination or other use of, or
> taking of any action in reliance upon, this information by persons or
> entities other than the intended recipient is prohibited. If you
> received this in error, please contact the sender and delete all copies
> from any computer.
>
>
>
>
>


-- 
--
Yueyu Lin