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 Yangrui Guo <gu...@gmail.com> on 2015/12/15 08:35:49 UTC

Partial sentence match with block join

Hello

I've been using 5.3.1. I would like to enable this feature: when user
enters a query, the results should include documents that also partially
match the query. For example, the document is <name>Apple Company</name>
and user query is "apple computer company". Though the document is missing
the term "computer". I've tried phrase slop but it doesn't seem to be
working with block join. How can I do this in solr?

Thanks

Yangrui

Re: Partial sentence match with block join

Posted by Upayavira <uv...@odoko.co.uk>.
"Apple Computer Company" is a phrase query, meaning all the words must
appear, in that order. Adding phrase slop just allows adjustments to the
location of those words, not making them optional.

If you want them to be optional, then do it as a regular query. If you
want a phrase to score better, then add a phrase version boosted:

"apple computer company"^2 (apple computer company)

Upayavira

On Tue, Dec 15, 2015, at 07:35 AM, Yangrui Guo wrote:
> Hello
> 
> I've been using 5.3.1. I would like to enable this feature: when user
> enters a query, the results should include documents that also partially
> match the query. For example, the document is <name>Apple Company</name>
> and user query is "apple computer company". Though the document is
> missing
> the term "computer". I've tried phrase slop but it doesn't seem to be
> working with block join. How can I do this in solr?
> 
> Thanks
> 
> Yangrui

Re: Partial sentence match with block join

Posted by Yangrui Guo <gu...@gmail.com>.
For example:

If company A is { name:"Apple Inc", location:"Los Alamos"} and company B is
{ name:"Banana Inc", location:"Los Angeles"} then if you only want to
retrieve company A you must use "Apple AND Inc AND Los AND Alamos"},
otherwise it will also retrieve company B. However if you use AND for all
terms then partial match wouldn't be possible. This seems to be
contradictory.

On Tuesday, December 15, 2015, Upayavira <uv...@odoko.co.uk> wrote:

>
> Cab you give an example? I cannot understand what you mean from your
> description below.
>
> Thx!
>
> On Wed, Dec 16, 2015, at 12:42 AM, Yangrui Guo wrote:
> > This will be a very common situation. Amazon and Google now display
> > keywords missing in the document. However it seems that Solr parent-child
> > structure requires to use "AND" to confine all terms appear inside a
> > single
> > child document, otherwise it will totally disregard the parent-child
> > structure. Is there a way to achieve this?
> >
> > On Tuesday, December 15, 2015, Jack Krupansky <jack.krupansky@gmail.com
> <javascript:;>>
> > wrote:
> >
> > > Set the default operator to OR and optionally set the mm parameter to
> 2 to
> > > require at least two of the query terms to match, and don't quote the
> terms
> > > as a phrase unless you want an exact (optionally sloppy) match.
> > >
> > > Interesting example since I'll bet there are a lot of us who still
> think of
> > > the company as being named "Apple Computer" even though they dropped
> > > "Computer" from the name back in 2007. Also, it is "Inc.", not
> "Company",
> > > so a proper search would be for "Apple Inc." or the old "Apple
> Computer,
> > > Inc."
> > >
> > >
> > > -- Jack Krupansky
> > >
> > > On Tue, Dec 15, 2015 at 2:35 AM, Yangrui Guo <guoyangrui@gmail.com
> <javascript:;>
> > > <javascript:;>> wrote:
> > >
> > > > Hello
> > > >
> > > > I've been using 5.3.1. I would like to enable this feature: when user
> > > > enters a query, the results should include documents that also
> partially
> > > > match the query. For example, the document is <name>Apple
> Company</name>
> > > > and user query is "apple computer company". Though the document is
> > > missing
> > > > the term "computer". I've tried phrase slop but it doesn't seem to be
> > > > working with block join. How can I do this in solr?
> > > >
> > > > Thanks
> > > >
> > > > Yangrui
> > > >
> > >
>

Re: Partial sentence match with block join

Posted by Upayavira <uv...@odoko.co.uk>.
Cab you give an example? I cannot understand what you mean from your
description below.

Thx!

On Wed, Dec 16, 2015, at 12:42 AM, Yangrui Guo wrote:
> This will be a very common situation. Amazon and Google now display
> keywords missing in the document. However it seems that Solr parent-child
> structure requires to use "AND" to confine all terms appear inside a
> single
> child document, otherwise it will totally disregard the parent-child
> structure. Is there a way to achieve this?
> 
> On Tuesday, December 15, 2015, Jack Krupansky <ja...@gmail.com>
> wrote:
> 
> > Set the default operator to OR and optionally set the mm parameter to 2 to
> > require at least two of the query terms to match, and don't quote the terms
> > as a phrase unless you want an exact (optionally sloppy) match.
> >
> > Interesting example since I'll bet there are a lot of us who still think of
> > the company as being named "Apple Computer" even though they dropped
> > "Computer" from the name back in 2007. Also, it is "Inc.", not "Company",
> > so a proper search would be for "Apple Inc." or the old "Apple Computer,
> > Inc."
> >
> >
> > -- Jack Krupansky
> >
> > On Tue, Dec 15, 2015 at 2:35 AM, Yangrui Guo <guoyangrui@gmail.com
> > <javascript:;>> wrote:
> >
> > > Hello
> > >
> > > I've been using 5.3.1. I would like to enable this feature: when user
> > > enters a query, the results should include documents that also partially
> > > match the query. For example, the document is <name>Apple Company</name>
> > > and user query is "apple computer company". Though the document is
> > missing
> > > the term "computer". I've tried phrase slop but it doesn't seem to be
> > > working with block join. How can I do this in solr?
> > >
> > > Thanks
> > >
> > > Yangrui
> > >
> >

Re: Partial sentence match with block join

Posted by Yangrui Guo <gu...@gmail.com>.
This will be a very common situation. Amazon and Google now display
keywords missing in the document. However it seems that Solr parent-child
structure requires to use "AND" to confine all terms appear inside a single
child document, otherwise it will totally disregard the parent-child
structure. Is there a way to achieve this?

On Tuesday, December 15, 2015, Jack Krupansky <ja...@gmail.com>
wrote:

> Set the default operator to OR and optionally set the mm parameter to 2 to
> require at least two of the query terms to match, and don't quote the terms
> as a phrase unless you want an exact (optionally sloppy) match.
>
> Interesting example since I'll bet there are a lot of us who still think of
> the company as being named "Apple Computer" even though they dropped
> "Computer" from the name back in 2007. Also, it is "Inc.", not "Company",
> so a proper search would be for "Apple Inc." or the old "Apple Computer,
> Inc."
>
>
> -- Jack Krupansky
>
> On Tue, Dec 15, 2015 at 2:35 AM, Yangrui Guo <guoyangrui@gmail.com
> <javascript:;>> wrote:
>
> > Hello
> >
> > I've been using 5.3.1. I would like to enable this feature: when user
> > enters a query, the results should include documents that also partially
> > match the query. For example, the document is <name>Apple Company</name>
> > and user query is "apple computer company". Though the document is
> missing
> > the term "computer". I've tried phrase slop but it doesn't seem to be
> > working with block join. How can I do this in solr?
> >
> > Thanks
> >
> > Yangrui
> >
>

Re: Partial sentence match with block join

Posted by Jack Krupansky <ja...@gmail.com>.
Set the default operator to OR and optionally set the mm parameter to 2 to
require at least two of the query terms to match, and don't quote the terms
as a phrase unless you want an exact (optionally sloppy) match.

Interesting example since I'll bet there are a lot of us who still think of
the company as being named "Apple Computer" even though they dropped
"Computer" from the name back in 2007. Also, it is "Inc.", not "Company",
so a proper search would be for "Apple Inc." or the old "Apple Computer,
Inc."


-- Jack Krupansky

On Tue, Dec 15, 2015 at 2:35 AM, Yangrui Guo <gu...@gmail.com> wrote:

> Hello
>
> I've been using 5.3.1. I would like to enable this feature: when user
> enters a query, the results should include documents that also partially
> match the query. For example, the document is <name>Apple Company</name>
> and user query is "apple computer company". Though the document is missing
> the term "computer". I've tried phrase slop but it doesn't seem to be
> working with block join. How can I do this in solr?
>
> Thanks
>
> Yangrui
>