Wildcard searches within phrases to use proximity

View: New views
5 Messages — Rating Filter:   Alert me  

Wildcard searches within phrases to use proximity

by Jay Hill :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

by Ahmet Arslan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> 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 

Re: Wildcard searches within phrases to use proximity

by markrmiller :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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 <jayallenhill@...> 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

by Ahmet Arslan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


> 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

by Shalin Shekhar Mangar :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, Nov 8, 2009 at 1:29 AM, AHMET ARSLAN <iorixxx@...> 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.