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 Ganesh <em...@yahoo.co.in> on 2011/02/18 11:38:48 UTC

Keyword Analyzer

Hello all,
 
I am using Keyword analyzer to index a field and while using queryparser, I am using the same analyzer.  I am indexing the text Hello world and while searching using queryparser.parse it is not returning me any results. I need to use the text within the codes qp.parse("Hello world");   

My question is why i need to give the text within codes (basically as a phrase). While indexing i have not given and it is indexing as single term and while searching also it should consider the complete text as single term.

Regards
Ganesh
Send free SMS to your Friends on Mobile from your Yahoo! Messenger. Download Now! http://messenger.yahoo.com/download.php

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Keyword Analyzer

Posted by Ian Lea <ia...@gmail.com>.
You say you are indexing it as a single term, so TermQuery.

--
Ian.


On Fri, Feb 18, 2011 at 11:32 AM, Ganesh <em...@yahoo.co.in> wrote:
> Exactly. QueryParser is splitting it in to two words.
>
>>>Just build the query directly.
> TermQuery or PhraseQuery?
>
> Regards
> Ganesh
>
>
> ----- Original Message -----
> From: "Ian Lea" <ia...@gmail.com>
> To: <ja...@lucene.apache.org>
> Sent: Friday, February 18, 2011 4:34 PM
> Subject: Re: Keyword Analyzer
>
>
> Presumably because without the quotes the parser is splitting it up
> into 2 terms.  Why bother parsing it?  Just build the query directly.
>
>
> --
> Ian.
>
>
> On Fri, Feb 18, 2011 at 10:38 AM, Ganesh <em...@yahoo.co.in> wrote:
>> Hello all,
>>
>> I am using Keyword analyzer to index a field and while using queryparser, I am using the same analyzer. I am indexing the text Hello world and while searching using queryparser.parse it is not returning me any results. I need to use the text within the codes qp.parse("Hello world");
>>
>> My question is why i need to give the text within codes (basically as a phrase). While indexing i have not given and it is indexing as single term and while searching also it should consider the complete text as single term.
>>
>> Regards
>> Ganesh
>> Send free SMS to your Friends on Mobile from your Yahoo! Messenger. Download Now! http://messenger.yahoo.com/download.php
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
> Send free SMS to your Friends on Mobile from your Yahoo! Messenger. Download Now! http://messenger.yahoo.com/download.php
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Keyword Analyzer

Posted by Ganesh <em...@yahoo.co.in>.
Exactly. QueryParser is splitting it in to two words. 

>>Just build the query directly.
TermQuery or PhraseQuery?

Regards
Ganesh 


----- Original Message ----- 
From: "Ian Lea" <ia...@gmail.com>
To: <ja...@lucene.apache.org>
Sent: Friday, February 18, 2011 4:34 PM
Subject: Re: Keyword Analyzer


Presumably because without the quotes the parser is splitting it up
into 2 terms.  Why bother parsing it?  Just build the query directly.


--
Ian.


On Fri, Feb 18, 2011 at 10:38 AM, Ganesh <em...@yahoo.co.in> wrote:
> Hello all,
>
> I am using Keyword analyzer to index a field and while using queryparser, I am using the same analyzer. I am indexing the text Hello world and while searching using queryparser.parse it is not returning me any results. I need to use the text within the codes qp.parse("Hello world");
>
> My question is why i need to give the text within codes (basically as a phrase). While indexing i have not given and it is indexing as single term and while searching also it should consider the complete text as single term.
>
> Regards
> Ganesh
> Send free SMS to your Friends on Mobile from your Yahoo! Messenger. Download Now! http://messenger.yahoo.com/download.php
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org

Send free SMS to your Friends on Mobile from your Yahoo! Messenger. Download Now! http://messenger.yahoo.com/download.php

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Keyword Analyzer

Posted by Ian Lea <ia...@gmail.com>.
Presumably because without the quotes the parser is splitting it up
into 2 terms.  Why bother parsing it?  Just build the query directly.


--
Ian.


On Fri, Feb 18, 2011 at 10:38 AM, Ganesh <em...@yahoo.co.in> wrote:
> Hello all,
>
> I am using Keyword analyzer to index a field and while using queryparser, I am using the same analyzer.  I am indexing the text Hello world and while searching using queryparser.parse it is not returning me any results. I need to use the text within the codes qp.parse("Hello world");
>
> My question is why i need to give the text within codes (basically as a phrase). While indexing i have not given and it is indexing as single term and while searching also it should consider the complete text as single term.
>
> Regards
> Ganesh
> Send free SMS to your Friends on Mobile from your Yahoo! Messenger. Download Now! http://messenger.yahoo.com/download.php
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org