|
|
-
TermsComponent show only terms that matched query?
Jay Hill 2012-02-24, 20:31
I have a situation where I want to show the term counts as is done in the TermsComponent, but *only* for terms that are *matched* in a query, so I get something returned like this (pseudo code):
q=title:(golf swing)
<doc> title: golf legends show how to improve your golf swing on the golf course ...other fields </doc>
<terms> golf (3) swing (1) </terms>
rather than getting back all of the terms in the doc.
Thanks, -Jay
-
Re: TermsComponent show only terms that matched query?
Erick Erickson 2012-02-25, 22:54
Jay:
I've seen the this question go 'round before, but don't remember a satisfactory solution. Are you talking on a per-document basis here? If so, I vaguely remember it being possible to do something with highlighting, just counting the tags returned after highlighting.
Best Erick
On Fri, Feb 24, 2012 at 3:31 PM, Jay Hill <[EMAIL PROTECTED]> wrote: > I have a situation where I want to show the term counts as is done in the > TermsComponent, but *only* for terms that are *matched* in a query, so I > get something returned like this (pseudo code): > > q=title:(golf swing) > > <doc> > title: golf legends show how to improve your golf swing on the golf course > ...other fields > </doc> > > <terms> > golf (3) > swing (1) > </terms> > > rather than getting back all of the terms in the doc. > > Thanks, > -Jay
-
Re: TermsComponent show only terms that matched query?
Lance Norskog 2012-02-25, 23:20
I think you have to walk the term positions and offsets, look in the stored field, and find the terms that matched. Which is exactly what highlighting does. And this will only find the actual terms in the text, no synonyms. So if you search for Sempranillo and find Sempranillo in some wines and Tempranillo in others, you have to know yourself that they are synonyms.
On Sat, Feb 25, 2012 at 2:54 PM, Erick Erickson <[EMAIL PROTECTED]> wrote: > Jay: > > I've seen the this question go 'round before, but don't remember > a satisfactory solution. Are you talking on a per-document basis > here? If so, I vaguely remember it being possible to do something > with highlighting, just counting the tags returned after highlighting. > > Best > Erick > > On Fri, Feb 24, 2012 at 3:31 PM, Jay Hill <[EMAIL PROTECTED]> wrote: >> I have a situation where I want to show the term counts as is done in the >> TermsComponent, but *only* for terms that are *matched* in a query, so I >> get something returned like this (pseudo code): >> >> q=title:(golf swing) >> >> <doc> >> title: golf legends show how to improve your golf swing on the golf course >> ...other fields >> </doc> >> >> <terms> >> golf (3) >> swing (1) >> </terms> >> >> rather than getting back all of the terms in the doc. >> >> Thanks, >> -Jay
-- Lance Norskog [EMAIL PROTECTED]
-
Re: TermsComponent show only terms that matched query?
Jay Hill 2012-02-27, 17:08
Yes, per-doc. I mentioned TermsComponent but meant TermVectorComponent, where we get back all the terms in the doc. Just wondering if there was a way to only get back the terms that matched the query.
Thanks EE, -Jay On Sat, Feb 25, 2012 at 2:54 PM, Erick Erickson <[EMAIL PROTECTED]>wrote:
> Jay: > > I've seen the this question go 'round before, but don't remember > a satisfactory solution. Are you talking on a per-document basis > here? If so, I vaguely remember it being possible to do something > with highlighting, just counting the tags returned after highlighting. > > Best > Erick > > On Fri, Feb 24, 2012 at 3:31 PM, Jay Hill <[EMAIL PROTECTED]> wrote: > > I have a situation where I want to show the term counts as is done in the > > TermsComponent, but *only* for terms that are *matched* in a query, so I > > get something returned like this (pseudo code): > > > > q=title:(golf swing) > > > > <doc> > > title: golf legends show how to improve your golf swing on the golf > course > > ...other fields > > </doc> > > > > <terms> > > golf (3) > > swing (1) > > </terms> > > > > rather than getting back all of the terms in the doc. > > > > Thanks, > > -Jay >
|
|