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 rakesh rakesh <ra...@gmail.com> on 2010/06/17 21:23:51 UTC

phrase search in a particular case

Hi,

I have thousands of article titles in lucene index. So for a query "Oil
spill" I want to return all the article title starts with "Oil spill". I do
not want those titles which has this phrase but do not start with this.

Can anyone help me.

Thanks in advance

Thanks
rakesh

Re: phrase search in a particular case

Posted by Lance Norskog <go...@gmail.com>.
SpanFirstQuery is the clean option. Another option is to add a "start
token" to each title. Then, search for "startToken oil spill". This
will be faster than SpanFirstQuery. But it also requires doing
something weird to the field.

Lance

On Thu, Jun 17, 2010 at 3:19 PM, Michael McCandless
<lu...@mikemccandless.com> wrote:
> SpanFirstQuery?
>
> Mike
>
> On Thu, Jun 17, 2010 at 3:23 PM, rakesh rakesh <ra...@gmail.com> wrote:
>> Hi,
>>
>> I have thousands of article titles in lucene index. So for a query "Oil
>> spill" I want to return all the article title starts with "Oil spill". I do
>> not want those titles which has this phrase but do not start with this.
>>
>> Can anyone help me.
>>
>> Thanks in advance
>>
>> Thanks
>> rakesh
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>



-- 
Lance Norskog
goksron@gmail.com

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


Re: phrase search in a particular case

Posted by Michael McCandless <lu...@mikemccandless.com>.
SpanFirstQuery?

Mike

On Thu, Jun 17, 2010 at 3:23 PM, rakesh rakesh <ra...@gmail.com> wrote:
> Hi,
>
> I have thousands of article titles in lucene index. So for a query "Oil
> spill" I want to return all the article title starts with "Oil spill". I do
> not want those titles which has this phrase but do not start with this.
>
> Can anyone help me.
>
> Thanks in advance
>
> Thanks
> rakesh
>

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