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 Christopher Ball <ch...@metaheuristica.com> on 2010/01/29 05:29:11 UTC
Querying for multi-term phrases only . . .
I am curious how I can query for multi-term phrases using the
TermsComponent?
The field I am searching has been shingled so it contains 2 and 3 word
phrases.
For example in the sample results below I want to only get back multi-word
phrases such as "table of contents" and "under the" but not the single word
terms such as "year" and "significant"
<int name="table of contents">25302</int>
<int name="including">25162</int>
<int name="year">25097</int>
<int name="significant">17501</int>
<int name="under the">17359</int>
Appreciate any ideas,
Christopher
Re: Querying for multi-term phrases only . . .
Posted by Erik Hatcher <er...@gmail.com>.
You can avoid one word terms by setting outputUnigrams="false" on the
ShingleFilterFactory configuration.
Erik
On Jan 28, 2010, at 11:29 PM, Christopher Ball wrote:
> I am curious how I can query for multi-term phrases using the
> TermsComponent?
>
>
>
> The field I am searching has been shingled so it contains 2 and 3 word
> phrases.
>
>
>
> For example in the sample results below I want to only get back
> multi-word
> phrases such as "table of contents" and "under the" but not the
> single word
> terms such as "year" and "significant"
>
>
>
> <int name="table of contents">25302</int>
>
> <int name="including">25162</int>
>
> <int name="year">25097</int>
>
> <int name="significant">17501</int>
>
> <int name="under the">17359</int>
>
>
>
> Appreciate any ideas,
>
>
>
> Christopher
>