Pradeep,
I believe that using 'Suhas*' tells the search engine you're looking for a
term which starts with 'Suhas' and has 1 or more terms in addition. Using
'Suhas' looks for a direct term match.
The '+' preceding the term tells the engine its mandatory that this term be
included. The '-' says it's mandatory that this term not be included.
It's all in the docs, I think.
Hope this helps.
Regards,
Terry
----- Original Message -----
From: "Pradeep Kumar K" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 26, 2002 1:25 PM
Subject: Query
> Hi
>
> I added one document in to the index using the code
> doc=new Document();
> IndexWriter indwr=new IndexWriter(rdir,new
> StandardAnalyzer(),true)
> doc.add(Field.Text("name", "Suhas Kumar"));
> indwr.close()
>
> and searched using the code
>
> indSe = new IndexSearcher(rdir);
> Query quer=QueryParser.parse("Suhas","name",new
> StandardAnalyzer());
> Hits hits= indSe.search(quer);
>
> here the number of hits returned is 1, which is correct.
>
> But when I searched using the query
> Query quer=QueryParser.parse("Suhas*","name",new
> StandardAnalyzer());
> It returns number of hits 0.
>
> Also canany body tell how to use '+' and '-' to include and
> exclude some words from search.
>
> Regards
> Pradeep
>
>
>
> --------------------------------------------------------------
> Robosoft Technologies, Mangalore, India
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>