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 Mahendra <ma...@gmail.com> on 2004/12/06 12:34:51 UTC

Help on Phrase Prefix query

Hi,
 
Presently i am working on a requirement in my application, to do the
search using lucene as follows,
 
Users enters phrase prefix query text. The query should be constructed
as follows,
- a PhrasePrefixQuery based on the user entered text,  for eg FieldA
- a termquery based on another field, for eg FieldB
- a boolean query is constructed based on the above two queries.
 
The search based on the boolean query, does not yield any results.
However, query based on PhrasePrefixQuery and TermQuery is returning
results. Can anyone suggest how
to use PhrasePrefixQuery as part of Booleanquery.
 
-Thanks,
Mahendra

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


Re: Help on Phrase Prefix query

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Dec 6, 2004, at 11:05 PM, Mahendra wrote:
> Thanks for responding. I have attached a sample java file for the
> sample implementation.

Please convert this program to building the index using RAMDirectory  
also.  I cannot run it as it is because it relies on an external index  
using a Windows path (I'm on Mac OS X).  I'd be happy to take a look at  
it once I can run it easily.

	Erik


>
>
> -regards,
> mahendra
>
>
> On Mon, 6 Dec 2004 08:19:54 -0500, Erik Hatcher
> <er...@ehatchersolutions.com> wrote:
>> Mahendra,
>>
>> Could you provide a concrete, and simple, example of what you're  
>> trying
>> to achieve?  It would help me understand what you're after.
>>
>> Any Query implementation works fine as a clause within a BooleanQuery,
>> there is nothing special to do for a PhrasePrefixQuery in this regard.
>>
>>        Erik
>>
>>
>>
>>
>> On Dec 6, 2004, at 6:34 AM, Mahendra wrote:
>>
>>> Hi,
>>>
>>> Presently i am working on a requirement in my application, to do the
>>> search using lucene as follows,
>>>
>>> Users enters phrase prefix query text. The query should be  
>>> constructed
>>> as follows,
>>> - a PhrasePrefixQuery based on the user entered text,  for eg FieldA
>>> - a termquery based on another field, for eg FieldB
>>> - a boolean query is constructed based on the above two queries.
>>>
>>> The search based on the boolean query, does not yield any results.
>>> However, query based on PhrasePrefixQuery and TermQuery is returning
>>> results. Can anyone suggest how
>>> to use PhrasePrefixQuery as part of Booleanquery.
>>>
>>> -Thanks,
>>> Mahendra
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>>
> <TestPhrasePrefixQuery.java>------------------------------------------- 
> --------------------------
> 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


Re: Help on Phrase Prefix query

Posted by Mahendra <ma...@gmail.com>.
Hi Erik,

Thanks for responding. I have attached a sample java file for the
sample implementation.


-regards,
mahendra


On Mon, 6 Dec 2004 08:19:54 -0500, Erik Hatcher
<er...@ehatchersolutions.com> wrote:
> Mahendra,
> 
> Could you provide a concrete, and simple, example of what you're trying
> to achieve?  It would help me understand what you're after.
> 
> Any Query implementation works fine as a clause within a BooleanQuery,
> there is nothing special to do for a PhrasePrefixQuery in this regard.
> 
>        Erik
> 
> 
> 
> 
> On Dec 6, 2004, at 6:34 AM, Mahendra wrote:
> 
> > Hi,
> >
> > Presently i am working on a requirement in my application, to do the
> > search using lucene as follows,
> >
> > Users enters phrase prefix query text. The query should be constructed
> > as follows,
> > - a PhrasePrefixQuery based on the user entered text,  for eg FieldA
> > - a termquery based on another field, for eg FieldB
> > - a boolean query is constructed based on the above two queries.
> >
> > The search based on the boolean query, does not yield any results.
> > However, query based on PhrasePrefixQuery and TermQuery is returning
> > results. Can anyone suggest how
> > to use PhrasePrefixQuery as part of Booleanquery.
> >
> > -Thanks,
> > Mahendra
> >
> > ---------------------------------------------------------------------
> > 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
> 
>

Re: Help on Phrase Prefix query

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
Mahendra,

Could you provide a concrete, and simple, example of what you're trying 
to achieve?  It would help me understand what you're after.

Any Query implementation works fine as a clause within a BooleanQuery, 
there is nothing special to do for a PhrasePrefixQuery in this regard.

	Erik


On Dec 6, 2004, at 6:34 AM, Mahendra wrote:

> Hi,
>
> Presently i am working on a requirement in my application, to do the
> search using lucene as follows,
>
> Users enters phrase prefix query text. The query should be constructed
> as follows,
> - a PhrasePrefixQuery based on the user entered text,  for eg FieldA
> - a termquery based on another field, for eg FieldB
> - a boolean query is constructed based on the above two queries.
>
> The search based on the boolean query, does not yield any results.
> However, query based on PhrasePrefixQuery and TermQuery is returning
> results. Can anyone suggest how
> to use PhrasePrefixQuery as part of Booleanquery.
>
> -Thanks,
> Mahendra
>
> ---------------------------------------------------------------------
> 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