You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Jay Hill <ja...@gmail.com> on 2009/11/06 20:39:50 UTC

Wildcard searches within phrases to use proximity

Is there a trick that I can use to use a wildcard operator within a phrase
in order to use proximity? What I'm after is something like this:

"bal* gui"~10

So I would get results with "baltimore" within 10 of "gui", and also
"balance" within 10 of "gui".

Thanks,
-Jay

Re: Wildcard searches within phrases to use proximity

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Fri, Nov 27, 2009 at 12:33 AM, AHMET ARSLAN <io...@yahoo.com> wrote:

> > That'd be great. Please open an issue in Jira and attach a
> > patch. See
> > http://wiki.apache.org/solr/HowToContribute
> >
>
> Hi Shalin,
> I opened an issue (SOLR-1604) and attached a patch as well as a maven
> project to enable this feature without applying the patch. I couldn't
> consume ComplexPhraseQueryParser from lucene-misc-2.9.1.jar. Because there
> is a fixed bug but it is not included in lucene release. LUCENE-1486 says
> guidance needed from the Solr team about preferred course of action.
>
> I will add more test cases to the patch in the future.
>
>
Thanks Ahmet, I've marked the issue for 1.5 so we do not forget about it.
I'll take a look at the patch soon.

-- 
Regards,
Shalin Shekhar Mangar.

Re: Wildcard searches within phrases to use proximity

Posted by AHMET ARSLAN <io...@yahoo.com>.
> That'd be great. Please open an issue in Jira and attach a
> patch. See
> http://wiki.apache.org/solr/HowToContribute
> 

Hi Shalin,
I opened an issue (SOLR-1604) and attached a patch as well as a maven project to enable this feature without applying the patch. I couldn't consume ComplexPhraseQueryParser from lucene-misc-2.9.1.jar. Because there is a fixed bug but it is not included in lucene release. LUCENE-1486 says guidance needed from the Solr team about preferred course of action.

I will add more test cases to the patch in the future.

Thanks.


      

Re: Wildcard searches within phrases to use proximity

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Sun, Nov 8, 2009 at 1:29 AM, AHMET ARSLAN <io...@yahoo.com> wrote:

>
> > You can do it with the
> > complexphrasequery parser in lucerne contrib (I think that's
> > the name). You have to plug it in to solr though - someone
> > has already donethis bit I'm not sure if it was controbbed
> > back.
>
> I would be happy to contribute it, what should i do?
>
>
That'd be great. Please open an issue in Jira and attach a patch. See
http://wiki.apache.org/solr/HowToContribute


-- 
Regards,
Shalin Shekhar Mangar.

Re: Wildcard searches within phrases to use proximity

Posted by AHMET ARSLAN <io...@yahoo.com>.
> You can do it with the
> complexphrasequery parser in lucerne contrib (I think that's
> the name). You have to plug it in to solr though - someone
> has already donethis bit I'm not sure if it was controbbed
> back.

I would be happy to contribute it, what should i do? 


      

Re: Wildcard searches within phrases to use proximity

Posted by Mark Miller <ma...@gmail.com>.
You can do it with the complexphrasequery parser in lucerne contrib (I  
think that's the name). You have to plug it in to solr though -  
someone has already donethis bit I'm not sure if it was controbbed back.

- Mark

http://www.lucidimagination.com (mobile)

On Nov 6, 2009, at 11:39 AM, Jay Hill <ja...@gmail.com> wrote:

> Is there a trick that I can use to use a wildcard operator within a  
> phrase
> in order to use proximity? What I'm after is something like this:
>
> "bal* gui"~10
>
> So I would get results with "baltimore" within 10 of "gui", and also
> "balance" within 10 of "gui".
>
> Thanks,
> -Jay

Re: Wildcard searches within phrases to use proximity

Posted by AHMET ARSLAN <io...@yahoo.com>.
> Is there a trick that I can use to
> use a wildcard operator within a phrase
> in order to use proximity? What I'm after is something like
> this:
> 
> "bal* gui"~10
> 
> So I would get results with "baltimore" within 10 of "gui",
> and also
> "balance" within 10 of "gui".

What you are looking for is ComplexPhraseQueryParser [1] and implemented in Lucene 2.9.0. I am using it with solr 1.4. I have faced some highlighting problems but it retrieves documents perfectly. It uses SpanQuery family. If you need i can share solr integration related java code.
It supports "bal* gui"~10 as well as "(baltimore balance) gui"~10 also 
"[bal TO bak] gui"~10. Ranges, OR and wildcard inside proximity (phrases).


[1] http://lucene.apache.org/java/2_9_0/api/contrib-misc/org/apache/lucene/queryParser/complexPhrase/package-summary.html

[2] https://issues.apache.org/jira/browse/LUCENE-1486

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com