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 Jamie Johnson <je...@gmail.com> on 2013/11/27 15:32:15 UTC

Term Vector Component Question

I am interested in retrieving the tf for terms that matched the query, not
all terms in the document.  Is this possible?  Looking at the example when
I search for the word cable I get the response that is shown below, ideally
I'd like to see only the tf for the word cable.  Is this possible or would
I need to write a custom query component to do this?

<response>

<lst name="responseHeader">

<int name="status">0</int>

<int name="QTime">2</int>

</lst>

<result name="response" numFound="4" start="0">

<doc/>

<doc>

<str name="includes">32MB SD card, USB cable, AV cable, battery</str>

</doc>

<doc>

<str name="includes">USB cable</str>

</doc>

<doc>

<str name="includes">earbud headphones, USB cable</str>

</doc>

</result>

<lst name="termVectors">

<str name="uniqueKeyFieldName">id</str>

<lst name="IW-02">

<str name="uniqueKey">IW-02</str>

</lst>

<lst name="9885A004">

<str name="uniqueKey">9885A004</str>

<lst name="includes">

<lst name="32mb">

<int name="tf">1</int>

</lst>

<lst name="av">

<int name="tf">1</int>

</lst>

<lst name="battery">

<int name="tf">1</int>

</lst>

<lst name="cable">

<int name="tf">2</int>

</lst>

<lst name="card">

<int name="tf">1</int>

</lst>

<lst name="sd">

<int name="tf">1</int>

</lst>

<lst name="usb">

<int name="tf">1</int>

</lst>

</lst>

</lst>

<lst name="3007WFP">

<str name="uniqueKey">3007WFP</str>

<lst name="includes">

<lst name="cable">

<int name="tf">1</int>

</lst>

<lst name="usb">

<int name="tf">1</int>

</lst>

</lst>

</lst>

<lst name="MA147LL/A">

<str name="uniqueKey">MA147LL/A</str>

<lst name="includes">

<lst name="cable">

<int name="tf">1</int>

</lst>

<lst name="earbud">

<int name="tf">1</int>

</lst>

<lst name="headphones">

<int name="tf">1</int>

</lst>

<lst name="usb">

<int name="tf">1</int>

</lst>

</lst>

</lst>

</lst>

</response>

Re: Term Vector Component Question

Posted by Jamie Johnson <je...@gmail.com>.
I definitely want tf, the number of times the matched term appears in the
document, the key is that I want only the term that was searched for, not
all terms.

Looking at the tf function this is close, except it needs to be the exact
term, I really need it to be the user entered text.  So for instance if the
user said q=tests, I'd like the tf to be for any terms that tests got
analyzed to.  So if I had a stemming analyzer I'd expect the user search
for tests to match test, and I'd like to get the number of time test
appeared in the document of interest.  Does that make sense?


On Wed, Nov 27, 2013 at 9:40 AM, Erick Erickson <er...@gmail.com>wrote:

> Would it serve to return the tf or ttf? You'd have to
> tack on clauses like
> fl=*,ttf(name,drive)
> or
> fl=*.ttf(name,drive)
>
> Which implies that you'd have to do some work
> on the query side to add the tf or ttf clauses.
>
> See:
> http://wiki.apache.org/solr/FunctionQuery#tf
>
> Best,
> Erick
>
>
> On Wed, Nov 27, 2013 at 9:32 AM, Jamie Johnson <je...@gmail.com> wrote:
>
> > I am interested in retrieving the tf for terms that matched the query,
> not
> > all terms in the document.  Is this possible?  Looking at the example
> when
> > I search for the word cable I get the response that is shown below,
> ideally
> > I'd like to see only the tf for the word cable.  Is this possible or
> would
> > I need to write a custom query component to do this?
> >
> > <response>
> >
> > <lst name="responseHeader">
> >
> > <int name="status">0</int>
> >
> > <int name="QTime">2</int>
> >
> > </lst>
> >
> > <result name="response" numFound="4" start="0">
> >
> > <doc/>
> >
> > <doc>
> >
> > <str name="includes">32MB SD card, USB cable, AV cable, battery</str>
> >
> > </doc>
> >
> > <doc>
> >
> > <str name="includes">USB cable</str>
> >
> > </doc>
> >
> > <doc>
> >
> > <str name="includes">earbud headphones, USB cable</str>
> >
> > </doc>
> >
> > </result>
> >
> > <lst name="termVectors">
> >
> > <str name="uniqueKeyFieldName">id</str>
> >
> > <lst name="IW-02">
> >
> > <str name="uniqueKey">IW-02</str>
> >
> > </lst>
> >
> > <lst name="9885A004">
> >
> > <str name="uniqueKey">9885A004</str>
> >
> > <lst name="includes">
> >
> > <lst name="32mb">
> >
> > <int name="tf">1</int>
> >
> > </lst>
> >
> > <lst name="av">
> >
> > <int name="tf">1</int>
> >
> > </lst>
> >
> > <lst name="battery">
> >
> > <int name="tf">1</int>
> >
> > </lst>
> >
> > <lst name="cable">
> >
> > <int name="tf">2</int>
> >
> > </lst>
> >
> > <lst name="card">
> >
> > <int name="tf">1</int>
> >
> > </lst>
> >
> > <lst name="sd">
> >
> > <int name="tf">1</int>
> >
> > </lst>
> >
> > <lst name="usb">
> >
> > <int name="tf">1</int>
> >
> > </lst>
> >
> > </lst>
> >
> > </lst>
> >
> > <lst name="3007WFP">
> >
> > <str name="uniqueKey">3007WFP</str>
> >
> > <lst name="includes">
> >
> > <lst name="cable">
> >
> > <int name="tf">1</int>
> >
> > </lst>
> >
> > <lst name="usb">
> >
> > <int name="tf">1</int>
> >
> > </lst>
> >
> > </lst>
> >
> > </lst>
> >
> > <lst name="MA147LL/A">
> >
> > <str name="uniqueKey">MA147LL/A</str>
> >
> > <lst name="includes">
> >
> > <lst name="cable">
> >
> > <int name="tf">1</int>
> >
> > </lst>
> >
> > <lst name="earbud">
> >
> > <int name="tf">1</int>
> >
> > </lst>
> >
> > <lst name="headphones">
> >
> > <int name="tf">1</int>
> >
> > </lst>
> >
> > <lst name="usb">
> >
> > <int name="tf">1</int>
> >
> > </lst>
> >
> > </lst>
> >
> > </lst>
> >
> > </lst>
> >
> > </response>
> >
>

Re: Term Vector Component Question

Posted by Erick Erickson <er...@gmail.com>.
Would it serve to return the tf or ttf? You'd have to
tack on clauses like
fl=*,ttf(name,drive)
or
fl=*.ttf(name,drive)

Which implies that you'd have to do some work
on the query side to add the tf or ttf clauses.

See:
http://wiki.apache.org/solr/FunctionQuery#tf

Best,
Erick


On Wed, Nov 27, 2013 at 9:32 AM, Jamie Johnson <je...@gmail.com> wrote:

> I am interested in retrieving the tf for terms that matched the query, not
> all terms in the document.  Is this possible?  Looking at the example when
> I search for the word cable I get the response that is shown below, ideally
> I'd like to see only the tf for the word cable.  Is this possible or would
> I need to write a custom query component to do this?
>
> <response>
>
> <lst name="responseHeader">
>
> <int name="status">0</int>
>
> <int name="QTime">2</int>
>
> </lst>
>
> <result name="response" numFound="4" start="0">
>
> <doc/>
>
> <doc>
>
> <str name="includes">32MB SD card, USB cable, AV cable, battery</str>
>
> </doc>
>
> <doc>
>
> <str name="includes">USB cable</str>
>
> </doc>
>
> <doc>
>
> <str name="includes">earbud headphones, USB cable</str>
>
> </doc>
>
> </result>
>
> <lst name="termVectors">
>
> <str name="uniqueKeyFieldName">id</str>
>
> <lst name="IW-02">
>
> <str name="uniqueKey">IW-02</str>
>
> </lst>
>
> <lst name="9885A004">
>
> <str name="uniqueKey">9885A004</str>
>
> <lst name="includes">
>
> <lst name="32mb">
>
> <int name="tf">1</int>
>
> </lst>
>
> <lst name="av">
>
> <int name="tf">1</int>
>
> </lst>
>
> <lst name="battery">
>
> <int name="tf">1</int>
>
> </lst>
>
> <lst name="cable">
>
> <int name="tf">2</int>
>
> </lst>
>
> <lst name="card">
>
> <int name="tf">1</int>
>
> </lst>
>
> <lst name="sd">
>
> <int name="tf">1</int>
>
> </lst>
>
> <lst name="usb">
>
> <int name="tf">1</int>
>
> </lst>
>
> </lst>
>
> </lst>
>
> <lst name="3007WFP">
>
> <str name="uniqueKey">3007WFP</str>
>
> <lst name="includes">
>
> <lst name="cable">
>
> <int name="tf">1</int>
>
> </lst>
>
> <lst name="usb">
>
> <int name="tf">1</int>
>
> </lst>
>
> </lst>
>
> </lst>
>
> <lst name="MA147LL/A">
>
> <str name="uniqueKey">MA147LL/A</str>
>
> <lst name="includes">
>
> <lst name="cable">
>
> <int name="tf">1</int>
>
> </lst>
>
> <lst name="earbud">
>
> <int name="tf">1</int>
>
> </lst>
>
> <lst name="headphones">
>
> <int name="tf">1</int>
>
> </lst>
>
> <lst name="usb">
>
> <int name="tf">1</int>
>
> </lst>
>
> </lst>
>
> </lst>
>
> </lst>
>
> </response>
>

Re: Term Vector Component Question

Posted by Erick Erickson <er...@gmail.com>.
Jamie:

Before jumping into using debug, do take a bit to test
the performance! I've seen the debug component take
up to 80% of the query time. Admittedly, that was, I
think, 3.6 or something so it may be much different now.

But I should have asked first, "Why do you care?". What
is your use case. Of course I'm really asking if this is an
XY problem.

Best,
Erick


On Wed, Nov 27, 2013 at 2:52 PM, Jamie Johnson <je...@gmail.com> wrote:

> I didn't see anything so I created this
>
> https://issues.apache.org/jira/browse/SOLR-5511
>
>
> On Wed, Nov 27, 2013 at 2:35 PM, Jamie Johnson <je...@gmail.com> wrote:
>
> > Thanks Jack, I'll see if I can find anything on Jira about this and if
> not
> > I'll create a ticket for it.
> >
> >
> > On Wed, Nov 27, 2013 at 12:28 PM, Jack Krupansky <
> jack@basetechnology.com>wrote:
> >
> >> To be honest, this kind of question comes up so often, that it probably
> >> is worth a Jira to have a more customized or parameterized "explain".
> >>
> >> Function queries in the "fl" list give you a lot more control, but not
> at
> >> the level of actual terms that matched.
> >>
> >>
> >> -- Jack Krupansky
> >>
> >> -----Original Message----- From: Jamie Johnson
> >> Sent: Wednesday, November 27, 2013 12:18 PM
> >>
> >> To: solr-user@lucene.apache.org
> >> Subject: Re: Term Vector Component Question
> >>
> >> thanks I'm looking at this now, debug seems pretty close to what I want.
> >> Is there a way to exclude information from the debug response, for
> >> instance I don't need idf, fieldnorm, timing information, etc.  Again
> >> thanks.
> >>
> >>
> >> On Wed, Nov 27, 2013 at 11:49 AM, Jack Krupansky <
> jack@basetechnology.com
> >> >wrote:
> >>
> >>  There is an XML version of explain as well, if parsing the structured
> >>> text
> >>> is too difficult for your application. The point is that debug
> "explain"
> >>> details precisely the term vector values for actual query terms.
> >>>
> >>> Don't let the "debug" moniker throw you - this parameter is simply
> giving
> >>> you access to detail information that you might find of value in your
> >>> application.
> >>>
> >>> As Erick explained, the function query approach ("tf(query-term)") also
> >>> works, kind of, sort of, at least where all query terms must be
> matched,
> >>> but when the "OR" operator is used, it won't tell you which term
> matched
> >>> -
> >>> although a tf value of 0 basically tells you that.
> >>>
> >>>
> >>> -- Jack Krupansky
> >>>
> >>> -----Original Message----- From: Jamie Johnson
> >>> Sent: Wednesday, November 27, 2013 11:38 AM
> >>> To: solr-user@lucene.apache.org
> >>> Subject: Re: Term Vector Component Question
> >>>
> >>>
> >>> Jack,
> >>>
> >>> I'm not following, are you suggesting to turn on debug and then parse
> the
> >>> explain?  Seems very round about if that is the case, no?
> >>>
> >>>
> >>> On Wed, Nov 27, 2013 at 9:40 AM, Jack Krupansky <
> jack@basetechnology.com
> >>> >
> >>> wrote:
> >>>
> >>>  That information would be included in the debugQuery output as well.
> >>>
> >>>>
> >>>> -- Jack Krupansky
> >>>>
> >>>> -----Original Message----- From: Jamie Johnson Sent: Wednesday,
> November
> >>>> 27, 2013 9:32 AM To: solr-user@lucene.apache.org Subject: Term Vector
> >>>> Component Question
> >>>> I am interested in retrieving the tf for terms that matched the query,
> >>>> not
> >>>> all terms in the document.  Is this possible?  Looking at the example
> >>>> when
> >>>> I search for the word cable I get the response that is shown below,
> >>>> ideally
> >>>> I'd like to see only the tf for the word cable.  Is this possible or
> >>>> would
> >>>> I need to write a custom query component to do this?
> >>>>
> >>>> <response>
> >>>>
> >>>> <lst name="responseHeader">
> >>>>
> >>>> <int name="status">0</int>
> >>>>
> >>>> <int name="QTime">2</int>
> >>>>
> >>>> </lst>
> >>>>
> >>>> <result name="response" numFound="4" start="0">
> >>>>
> >>>> <doc/>
> >>>>
> >>>> <doc>
> >>>>
> >>>> <str name="includes">32MB SD card, USB cable, AV cable, battery</str>
> >>>>
> >>>> </doc>
> >>>>
> >>>> <doc>
> >>>>
> >>>> <str name="includes">USB cable</str>
> >>>>
> >>>> </doc>
> >>>>
> >>>> <doc>
> >>>>
> >>>> <str name="includes">earbud headphones, USB cable</str>
> >>>>
> >>>> </doc>
> >>>>
> >>>> </result>
> >>>>
> >>>> <lst name="termVectors">
> >>>>
> >>>> <str name="uniqueKeyFieldName">id</str>
> >>>>
> >>>> <lst name="IW-02">
> >>>>
> >>>> <str name="uniqueKey">IW-02</str>
> >>>>
> >>>> </lst>
> >>>>
> >>>> <lst name="9885A004">
> >>>>
> >>>> <str name="uniqueKey">9885A004</str>
> >>>>
> >>>> <lst name="includes">
> >>>>
> >>>> <lst name="32mb">
> >>>>
> >>>> <int name="tf">1</int>
> >>>>
> >>>> </lst>
> >>>>
> >>>> <lst name="av">
> >>>>
> >>>> <int name="tf">1</int>
> >>>>
> >>>> </lst>
> >>>>
> >>>> <lst name="battery">
> >>>>
> >>>> <int name="tf">1</int>
> >>>>
> >>>> </lst>
> >>>>
> >>>> <lst name="cable">
> >>>>
> >>>> <int name="tf">2</int>
> >>>>
> >>>> </lst>
> >>>>
> >>>> <lst name="card">
> >>>>
> >>>> <int name="tf">1</int>
> >>>>
> >>>> </lst>
> >>>>
> >>>> <lst name="sd">
> >>>>
> >>>> <int name="tf">1</int>
> >>>>
> >>>> </lst>
> >>>>
> >>>> <lst name="usb">
> >>>>
> >>>> <int name="tf">1</int>
> >>>>
> >>>> </lst>
> >>>>
> >>>> </lst>
> >>>>
> >>>> </lst>
> >>>>
> >>>> <lst name="3007WFP">
> >>>>
> >>>> <str name="uniqueKey">3007WFP</str>
> >>>>
> >>>> <lst name="includes">
> >>>>
> >>>> <lst name="cable">
> >>>>
> >>>> <int name="tf">1</int>
> >>>>
> >>>> </lst>
> >>>>
> >>>> <lst name="usb">
> >>>>
> >>>> <int name="tf">1</int>
> >>>>
> >>>> </lst>
> >>>>
> >>>> </lst>
> >>>>
> >>>> </lst>
> >>>>
> >>>> <lst name="MA147LL/A">
> >>>>
> >>>> <str name="uniqueKey">MA147LL/A</str>
> >>>>
> >>>> <lst name="includes">
> >>>>
> >>>> <lst name="cable">
> >>>>
> >>>> <int name="tf">1</int>
> >>>>
> >>>> </lst>
> >>>>
> >>>> <lst name="earbud">
> >>>>
> >>>> <int name="tf">1</int>
> >>>>
> >>>> </lst>
> >>>>
> >>>> <lst name="headphones">
> >>>>
> >>>> <int name="tf">1</int>
> >>>>
> >>>> </lst>
> >>>>
> >>>> <lst name="usb">
> >>>>
> >>>> <int name="tf">1</int>
> >>>>
> >>>> </lst>
> >>>>
> >>>> </lst>
> >>>>
> >>>> </lst>
> >>>>
> >>>> </lst>
> >>>>
> >>>> </response>
> >>>>
> >>>>
> >>>>
> >>>
> >>
> >
>

Re: Term Vector Component Question

Posted by Jamie Johnson <je...@gmail.com>.
I didn't see anything so I created this

https://issues.apache.org/jira/browse/SOLR-5511


On Wed, Nov 27, 2013 at 2:35 PM, Jamie Johnson <je...@gmail.com> wrote:

> Thanks Jack, I'll see if I can find anything on Jira about this and if not
> I'll create a ticket for it.
>
>
> On Wed, Nov 27, 2013 at 12:28 PM, Jack Krupansky <ja...@basetechnology.com>wrote:
>
>> To be honest, this kind of question comes up so often, that it probably
>> is worth a Jira to have a more customized or parameterized "explain".
>>
>> Function queries in the "fl" list give you a lot more control, but not at
>> the level of actual terms that matched.
>>
>>
>> -- Jack Krupansky
>>
>> -----Original Message----- From: Jamie Johnson
>> Sent: Wednesday, November 27, 2013 12:18 PM
>>
>> To: solr-user@lucene.apache.org
>> Subject: Re: Term Vector Component Question
>>
>> thanks I'm looking at this now, debug seems pretty close to what I want.
>> Is there a way to exclude information from the debug response, for
>> instance I don't need idf, fieldnorm, timing information, etc.  Again
>> thanks.
>>
>>
>> On Wed, Nov 27, 2013 at 11:49 AM, Jack Krupansky <jack@basetechnology.com
>> >wrote:
>>
>>  There is an XML version of explain as well, if parsing the structured
>>> text
>>> is too difficult for your application. The point is that debug "explain"
>>> details precisely the term vector values for actual query terms.
>>>
>>> Don't let the "debug" moniker throw you - this parameter is simply giving
>>> you access to detail information that you might find of value in your
>>> application.
>>>
>>> As Erick explained, the function query approach ("tf(query-term)") also
>>> works, kind of, sort of, at least where all query terms must be matched,
>>> but when the "OR" operator is used, it won't tell you which term matched
>>> -
>>> although a tf value of 0 basically tells you that.
>>>
>>>
>>> -- Jack Krupansky
>>>
>>> -----Original Message----- From: Jamie Johnson
>>> Sent: Wednesday, November 27, 2013 11:38 AM
>>> To: solr-user@lucene.apache.org
>>> Subject: Re: Term Vector Component Question
>>>
>>>
>>> Jack,
>>>
>>> I'm not following, are you suggesting to turn on debug and then parse the
>>> explain?  Seems very round about if that is the case, no?
>>>
>>>
>>> On Wed, Nov 27, 2013 at 9:40 AM, Jack Krupansky <jack@basetechnology.com
>>> >
>>> wrote:
>>>
>>>  That information would be included in the debugQuery output as well.
>>>
>>>>
>>>> -- Jack Krupansky
>>>>
>>>> -----Original Message----- From: Jamie Johnson Sent: Wednesday, November
>>>> 27, 2013 9:32 AM To: solr-user@lucene.apache.org Subject: Term Vector
>>>> Component Question
>>>> I am interested in retrieving the tf for terms that matched the query,
>>>> not
>>>> all terms in the document.  Is this possible?  Looking at the example
>>>> when
>>>> I search for the word cable I get the response that is shown below,
>>>> ideally
>>>> I'd like to see only the tf for the word cable.  Is this possible or
>>>> would
>>>> I need to write a custom query component to do this?
>>>>
>>>> <response>
>>>>
>>>> <lst name="responseHeader">
>>>>
>>>> <int name="status">0</int>
>>>>
>>>> <int name="QTime">2</int>
>>>>
>>>> </lst>
>>>>
>>>> <result name="response" numFound="4" start="0">
>>>>
>>>> <doc/>
>>>>
>>>> <doc>
>>>>
>>>> <str name="includes">32MB SD card, USB cable, AV cable, battery</str>
>>>>
>>>> </doc>
>>>>
>>>> <doc>
>>>>
>>>> <str name="includes">USB cable</str>
>>>>
>>>> </doc>
>>>>
>>>> <doc>
>>>>
>>>> <str name="includes">earbud headphones, USB cable</str>
>>>>
>>>> </doc>
>>>>
>>>> </result>
>>>>
>>>> <lst name="termVectors">
>>>>
>>>> <str name="uniqueKeyFieldName">id</str>
>>>>
>>>> <lst name="IW-02">
>>>>
>>>> <str name="uniqueKey">IW-02</str>
>>>>
>>>> </lst>
>>>>
>>>> <lst name="9885A004">
>>>>
>>>> <str name="uniqueKey">9885A004</str>
>>>>
>>>> <lst name="includes">
>>>>
>>>> <lst name="32mb">
>>>>
>>>> <int name="tf">1</int>
>>>>
>>>> </lst>
>>>>
>>>> <lst name="av">
>>>>
>>>> <int name="tf">1</int>
>>>>
>>>> </lst>
>>>>
>>>> <lst name="battery">
>>>>
>>>> <int name="tf">1</int>
>>>>
>>>> </lst>
>>>>
>>>> <lst name="cable">
>>>>
>>>> <int name="tf">2</int>
>>>>
>>>> </lst>
>>>>
>>>> <lst name="card">
>>>>
>>>> <int name="tf">1</int>
>>>>
>>>> </lst>
>>>>
>>>> <lst name="sd">
>>>>
>>>> <int name="tf">1</int>
>>>>
>>>> </lst>
>>>>
>>>> <lst name="usb">
>>>>
>>>> <int name="tf">1</int>
>>>>
>>>> </lst>
>>>>
>>>> </lst>
>>>>
>>>> </lst>
>>>>
>>>> <lst name="3007WFP">
>>>>
>>>> <str name="uniqueKey">3007WFP</str>
>>>>
>>>> <lst name="includes">
>>>>
>>>> <lst name="cable">
>>>>
>>>> <int name="tf">1</int>
>>>>
>>>> </lst>
>>>>
>>>> <lst name="usb">
>>>>
>>>> <int name="tf">1</int>
>>>>
>>>> </lst>
>>>>
>>>> </lst>
>>>>
>>>> </lst>
>>>>
>>>> <lst name="MA147LL/A">
>>>>
>>>> <str name="uniqueKey">MA147LL/A</str>
>>>>
>>>> <lst name="includes">
>>>>
>>>> <lst name="cable">
>>>>
>>>> <int name="tf">1</int>
>>>>
>>>> </lst>
>>>>
>>>> <lst name="earbud">
>>>>
>>>> <int name="tf">1</int>
>>>>
>>>> </lst>
>>>>
>>>> <lst name="headphones">
>>>>
>>>> <int name="tf">1</int>
>>>>
>>>> </lst>
>>>>
>>>> <lst name="usb">
>>>>
>>>> <int name="tf">1</int>
>>>>
>>>> </lst>
>>>>
>>>> </lst>
>>>>
>>>> </lst>
>>>>
>>>> </lst>
>>>>
>>>> </response>
>>>>
>>>>
>>>>
>>>
>>
>

Re: Term Vector Component Question

Posted by Jamie Johnson <je...@gmail.com>.
Thanks Jack, I'll see if I can find anything on Jira about this and if not
I'll create a ticket for it.


On Wed, Nov 27, 2013 at 12:28 PM, Jack Krupansky <ja...@basetechnology.com>wrote:

> To be honest, this kind of question comes up so often, that it probably is
> worth a Jira to have a more customized or parameterized "explain".
>
> Function queries in the "fl" list give you a lot more control, but not at
> the level of actual terms that matched.
>
>
> -- Jack Krupansky
>
> -----Original Message----- From: Jamie Johnson
> Sent: Wednesday, November 27, 2013 12:18 PM
>
> To: solr-user@lucene.apache.org
> Subject: Re: Term Vector Component Question
>
> thanks I'm looking at this now, debug seems pretty close to what I want.
> Is there a way to exclude information from the debug response, for
> instance I don't need idf, fieldnorm, timing information, etc.  Again
> thanks.
>
>
> On Wed, Nov 27, 2013 at 11:49 AM, Jack Krupansky <ja...@basetechnology.com>
> wrote:
>
>  There is an XML version of explain as well, if parsing the structured text
>> is too difficult for your application. The point is that debug "explain"
>> details precisely the term vector values for actual query terms.
>>
>> Don't let the "debug" moniker throw you - this parameter is simply giving
>> you access to detail information that you might find of value in your
>> application.
>>
>> As Erick explained, the function query approach ("tf(query-term)") also
>> works, kind of, sort of, at least where all query terms must be matched,
>> but when the "OR" operator is used, it won't tell you which term matched -
>> although a tf value of 0 basically tells you that.
>>
>>
>> -- Jack Krupansky
>>
>> -----Original Message----- From: Jamie Johnson
>> Sent: Wednesday, November 27, 2013 11:38 AM
>> To: solr-user@lucene.apache.org
>> Subject: Re: Term Vector Component Question
>>
>>
>> Jack,
>>
>> I'm not following, are you suggesting to turn on debug and then parse the
>> explain?  Seems very round about if that is the case, no?
>>
>>
>> On Wed, Nov 27, 2013 at 9:40 AM, Jack Krupansky <ja...@basetechnology.com>
>> wrote:
>>
>>  That information would be included in the debugQuery output as well.
>>
>>>
>>> -- Jack Krupansky
>>>
>>> -----Original Message----- From: Jamie Johnson Sent: Wednesday, November
>>> 27, 2013 9:32 AM To: solr-user@lucene.apache.org Subject: Term Vector
>>> Component Question
>>> I am interested in retrieving the tf for terms that matched the query,
>>> not
>>> all terms in the document.  Is this possible?  Looking at the example
>>> when
>>> I search for the word cable I get the response that is shown below,
>>> ideally
>>> I'd like to see only the tf for the word cable.  Is this possible or
>>> would
>>> I need to write a custom query component to do this?
>>>
>>> <response>
>>>
>>> <lst name="responseHeader">
>>>
>>> <int name="status">0</int>
>>>
>>> <int name="QTime">2</int>
>>>
>>> </lst>
>>>
>>> <result name="response" numFound="4" start="0">
>>>
>>> <doc/>
>>>
>>> <doc>
>>>
>>> <str name="includes">32MB SD card, USB cable, AV cable, battery</str>
>>>
>>> </doc>
>>>
>>> <doc>
>>>
>>> <str name="includes">USB cable</str>
>>>
>>> </doc>
>>>
>>> <doc>
>>>
>>> <str name="includes">earbud headphones, USB cable</str>
>>>
>>> </doc>
>>>
>>> </result>
>>>
>>> <lst name="termVectors">
>>>
>>> <str name="uniqueKeyFieldName">id</str>
>>>
>>> <lst name="IW-02">
>>>
>>> <str name="uniqueKey">IW-02</str>
>>>
>>> </lst>
>>>
>>> <lst name="9885A004">
>>>
>>> <str name="uniqueKey">9885A004</str>
>>>
>>> <lst name="includes">
>>>
>>> <lst name="32mb">
>>>
>>> <int name="tf">1</int>
>>>
>>> </lst>
>>>
>>> <lst name="av">
>>>
>>> <int name="tf">1</int>
>>>
>>> </lst>
>>>
>>> <lst name="battery">
>>>
>>> <int name="tf">1</int>
>>>
>>> </lst>
>>>
>>> <lst name="cable">
>>>
>>> <int name="tf">2</int>
>>>
>>> </lst>
>>>
>>> <lst name="card">
>>>
>>> <int name="tf">1</int>
>>>
>>> </lst>
>>>
>>> <lst name="sd">
>>>
>>> <int name="tf">1</int>
>>>
>>> </lst>
>>>
>>> <lst name="usb">
>>>
>>> <int name="tf">1</int>
>>>
>>> </lst>
>>>
>>> </lst>
>>>
>>> </lst>
>>>
>>> <lst name="3007WFP">
>>>
>>> <str name="uniqueKey">3007WFP</str>
>>>
>>> <lst name="includes">
>>>
>>> <lst name="cable">
>>>
>>> <int name="tf">1</int>
>>>
>>> </lst>
>>>
>>> <lst name="usb">
>>>
>>> <int name="tf">1</int>
>>>
>>> </lst>
>>>
>>> </lst>
>>>
>>> </lst>
>>>
>>> <lst name="MA147LL/A">
>>>
>>> <str name="uniqueKey">MA147LL/A</str>
>>>
>>> <lst name="includes">
>>>
>>> <lst name="cable">
>>>
>>> <int name="tf">1</int>
>>>
>>> </lst>
>>>
>>> <lst name="earbud">
>>>
>>> <int name="tf">1</int>
>>>
>>> </lst>
>>>
>>> <lst name="headphones">
>>>
>>> <int name="tf">1</int>
>>>
>>> </lst>
>>>
>>> <lst name="usb">
>>>
>>> <int name="tf">1</int>
>>>
>>> </lst>
>>>
>>> </lst>
>>>
>>> </lst>
>>>
>>> </lst>
>>>
>>> </response>
>>>
>>>
>>>
>>
>

Re: Term Vector Component Question

Posted by Jack Krupansky <ja...@basetechnology.com>.
To be honest, this kind of question comes up so often, that it probably is 
worth a Jira to have a more customized or parameterized "explain".

Function queries in the "fl" list give you a lot more control, but not at 
the level of actual terms that matched.

-- Jack Krupansky

-----Original Message----- 
From: Jamie Johnson
Sent: Wednesday, November 27, 2013 12:18 PM
To: solr-user@lucene.apache.org
Subject: Re: Term Vector Component Question

thanks I'm looking at this now, debug seems pretty close to what I want.
Is there a way to exclude information from the debug response, for
instance I don't need idf, fieldnorm, timing information, etc.  Again
thanks.


On Wed, Nov 27, 2013 at 11:49 AM, Jack Krupansky 
<ja...@basetechnology.com>wrote:

> There is an XML version of explain as well, if parsing the structured text
> is too difficult for your application. The point is that debug "explain"
> details precisely the term vector values for actual query terms.
>
> Don't let the "debug" moniker throw you - this parameter is simply giving
> you access to detail information that you might find of value in your
> application.
>
> As Erick explained, the function query approach ("tf(query-term)") also
> works, kind of, sort of, at least where all query terms must be matched,
> but when the "OR" operator is used, it won't tell you which term matched -
> although a tf value of 0 basically tells you that.
>
>
> -- Jack Krupansky
>
> -----Original Message----- From: Jamie Johnson
> Sent: Wednesday, November 27, 2013 11:38 AM
> To: solr-user@lucene.apache.org
> Subject: Re: Term Vector Component Question
>
>
> Jack,
>
> I'm not following, are you suggesting to turn on debug and then parse the
> explain?  Seems very round about if that is the case, no?
>
>
> On Wed, Nov 27, 2013 at 9:40 AM, Jack Krupansky <ja...@basetechnology.com>
> wrote:
>
>  That information would be included in the debugQuery output as well.
>>
>> -- Jack Krupansky
>>
>> -----Original Message----- From: Jamie Johnson Sent: Wednesday, November
>> 27, 2013 9:32 AM To: solr-user@lucene.apache.org Subject: Term Vector
>> Component Question
>> I am interested in retrieving the tf for terms that matched the query, 
>> not
>> all terms in the document.  Is this possible?  Looking at the example 
>> when
>> I search for the word cable I get the response that is shown below,
>> ideally
>> I'd like to see only the tf for the word cable.  Is this possible or 
>> would
>> I need to write a custom query component to do this?
>>
>> <response>
>>
>> <lst name="responseHeader">
>>
>> <int name="status">0</int>
>>
>> <int name="QTime">2</int>
>>
>> </lst>
>>
>> <result name="response" numFound="4" start="0">
>>
>> <doc/>
>>
>> <doc>
>>
>> <str name="includes">32MB SD card, USB cable, AV cable, battery</str>
>>
>> </doc>
>>
>> <doc>
>>
>> <str name="includes">USB cable</str>
>>
>> </doc>
>>
>> <doc>
>>
>> <str name="includes">earbud headphones, USB cable</str>
>>
>> </doc>
>>
>> </result>
>>
>> <lst name="termVectors">
>>
>> <str name="uniqueKeyFieldName">id</str>
>>
>> <lst name="IW-02">
>>
>> <str name="uniqueKey">IW-02</str>
>>
>> </lst>
>>
>> <lst name="9885A004">
>>
>> <str name="uniqueKey">9885A004</str>
>>
>> <lst name="includes">
>>
>> <lst name="32mb">
>>
>> <int name="tf">1</int>
>>
>> </lst>
>>
>> <lst name="av">
>>
>> <int name="tf">1</int>
>>
>> </lst>
>>
>> <lst name="battery">
>>
>> <int name="tf">1</int>
>>
>> </lst>
>>
>> <lst name="cable">
>>
>> <int name="tf">2</int>
>>
>> </lst>
>>
>> <lst name="card">
>>
>> <int name="tf">1</int>
>>
>> </lst>
>>
>> <lst name="sd">
>>
>> <int name="tf">1</int>
>>
>> </lst>
>>
>> <lst name="usb">
>>
>> <int name="tf">1</int>
>>
>> </lst>
>>
>> </lst>
>>
>> </lst>
>>
>> <lst name="3007WFP">
>>
>> <str name="uniqueKey">3007WFP</str>
>>
>> <lst name="includes">
>>
>> <lst name="cable">
>>
>> <int name="tf">1</int>
>>
>> </lst>
>>
>> <lst name="usb">
>>
>> <int name="tf">1</int>
>>
>> </lst>
>>
>> </lst>
>>
>> </lst>
>>
>> <lst name="MA147LL/A">
>>
>> <str name="uniqueKey">MA147LL/A</str>
>>
>> <lst name="includes">
>>
>> <lst name="cable">
>>
>> <int name="tf">1</int>
>>
>> </lst>
>>
>> <lst name="earbud">
>>
>> <int name="tf">1</int>
>>
>> </lst>
>>
>> <lst name="headphones">
>>
>> <int name="tf">1</int>
>>
>> </lst>
>>
>> <lst name="usb">
>>
>> <int name="tf">1</int>
>>
>> </lst>
>>
>> </lst>
>>
>> </lst>
>>
>> </lst>
>>
>> </response>
>>
>>
> 


Re: Term Vector Component Question

Posted by Jamie Johnson <je...@gmail.com>.
a little more reading gave me it.  I can just do debug=results, but that
still includes idf and fieldnorm.  Much less though so it's a step ;)  If
there is anyway to get just idf that would be great, otherwise no big deal


On Wed, Nov 27, 2013 at 12:18 PM, Jamie Johnson <je...@gmail.com> wrote:

> thanks I'm looking at this now, debug seems pretty close to what I want.
>  Is there a way to exclude information from the debug response, for
> instance I don't need idf, fieldnorm, timing information, etc.  Again
> thanks.
>
>
> On Wed, Nov 27, 2013 at 11:49 AM, Jack Krupansky <ja...@basetechnology.com>wrote:
>
>> There is an XML version of explain as well, if parsing the structured
>> text is too difficult for your application. The point is that debug
>> "explain" details precisely the term vector values for actual query terms.
>>
>> Don't let the "debug" moniker throw you - this parameter is simply giving
>> you access to detail information that you might find of value in your
>> application.
>>
>> As Erick explained, the function query approach ("tf(query-term)") also
>> works, kind of, sort of, at least where all query terms must be matched,
>> but when the "OR" operator is used, it won't tell you which term matched -
>> although a tf value of 0 basically tells you that.
>>
>>
>> -- Jack Krupansky
>>
>> -----Original Message----- From: Jamie Johnson
>> Sent: Wednesday, November 27, 2013 11:38 AM
>> To: solr-user@lucene.apache.org
>> Subject: Re: Term Vector Component Question
>>
>>
>> Jack,
>>
>> I'm not following, are you suggesting to turn on debug and then parse the
>> explain?  Seems very round about if that is the case, no?
>>
>>
>> On Wed, Nov 27, 2013 at 9:40 AM, Jack Krupansky <ja...@basetechnology.com>
>> wrote:
>>
>>  That information would be included in the debugQuery output as well.
>>>
>>> -- Jack Krupansky
>>>
>>> -----Original Message----- From: Jamie Johnson Sent: Wednesday, November
>>> 27, 2013 9:32 AM To: solr-user@lucene.apache.org Subject: Term Vector
>>> Component Question
>>> I am interested in retrieving the tf for terms that matched the query,
>>> not
>>> all terms in the document.  Is this possible?  Looking at the example
>>> when
>>> I search for the word cable I get the response that is shown below,
>>> ideally
>>> I'd like to see only the tf for the word cable.  Is this possible or
>>> would
>>> I need to write a custom query component to do this?
>>>
>>> <response>
>>>
>>> <lst name="responseHeader">
>>>
>>> <int name="status">0</int>
>>>
>>> <int name="QTime">2</int>
>>>
>>> </lst>
>>>
>>> <result name="response" numFound="4" start="0">
>>>
>>> <doc/>
>>>
>>> <doc>
>>>
>>> <str name="includes">32MB SD card, USB cable, AV cable, battery</str>
>>>
>>> </doc>
>>>
>>> <doc>
>>>
>>> <str name="includes">USB cable</str>
>>>
>>> </doc>
>>>
>>> <doc>
>>>
>>> <str name="includes">earbud headphones, USB cable</str>
>>>
>>> </doc>
>>>
>>> </result>
>>>
>>> <lst name="termVectors">
>>>
>>> <str name="uniqueKeyFieldName">id</str>
>>>
>>> <lst name="IW-02">
>>>
>>> <str name="uniqueKey">IW-02</str>
>>>
>>> </lst>
>>>
>>> <lst name="9885A004">
>>>
>>> <str name="uniqueKey">9885A004</str>
>>>
>>> <lst name="includes">
>>>
>>> <lst name="32mb">
>>>
>>> <int name="tf">1</int>
>>>
>>> </lst>
>>>
>>> <lst name="av">
>>>
>>> <int name="tf">1</int>
>>>
>>> </lst>
>>>
>>> <lst name="battery">
>>>
>>> <int name="tf">1</int>
>>>
>>> </lst>
>>>
>>> <lst name="cable">
>>>
>>> <int name="tf">2</int>
>>>
>>> </lst>
>>>
>>> <lst name="card">
>>>
>>> <int name="tf">1</int>
>>>
>>> </lst>
>>>
>>> <lst name="sd">
>>>
>>> <int name="tf">1</int>
>>>
>>> </lst>
>>>
>>> <lst name="usb">
>>>
>>> <int name="tf">1</int>
>>>
>>> </lst>
>>>
>>> </lst>
>>>
>>> </lst>
>>>
>>> <lst name="3007WFP">
>>>
>>> <str name="uniqueKey">3007WFP</str>
>>>
>>> <lst name="includes">
>>>
>>> <lst name="cable">
>>>
>>> <int name="tf">1</int>
>>>
>>> </lst>
>>>
>>> <lst name="usb">
>>>
>>> <int name="tf">1</int>
>>>
>>> </lst>
>>>
>>> </lst>
>>>
>>> </lst>
>>>
>>> <lst name="MA147LL/A">
>>>
>>> <str name="uniqueKey">MA147LL/A</str>
>>>
>>> <lst name="includes">
>>>
>>> <lst name="cable">
>>>
>>> <int name="tf">1</int>
>>>
>>> </lst>
>>>
>>> <lst name="earbud">
>>>
>>> <int name="tf">1</int>
>>>
>>> </lst>
>>>
>>> <lst name="headphones">
>>>
>>> <int name="tf">1</int>
>>>
>>> </lst>
>>>
>>> <lst name="usb">
>>>
>>> <int name="tf">1</int>
>>>
>>> </lst>
>>>
>>> </lst>
>>>
>>> </lst>
>>>
>>> </lst>
>>>
>>> </response>
>>>
>>>
>>
>

Re: Term Vector Component Question

Posted by Jamie Johnson <je...@gmail.com>.
thanks I'm looking at this now, debug seems pretty close to what I want.
 Is there a way to exclude information from the debug response, for
instance I don't need idf, fieldnorm, timing information, etc.  Again
thanks.


On Wed, Nov 27, 2013 at 11:49 AM, Jack Krupansky <ja...@basetechnology.com>wrote:

> There is an XML version of explain as well, if parsing the structured text
> is too difficult for your application. The point is that debug "explain"
> details precisely the term vector values for actual query terms.
>
> Don't let the "debug" moniker throw you - this parameter is simply giving
> you access to detail information that you might find of value in your
> application.
>
> As Erick explained, the function query approach ("tf(query-term)") also
> works, kind of, sort of, at least where all query terms must be matched,
> but when the "OR" operator is used, it won't tell you which term matched -
> although a tf value of 0 basically tells you that.
>
>
> -- Jack Krupansky
>
> -----Original Message----- From: Jamie Johnson
> Sent: Wednesday, November 27, 2013 11:38 AM
> To: solr-user@lucene.apache.org
> Subject: Re: Term Vector Component Question
>
>
> Jack,
>
> I'm not following, are you suggesting to turn on debug and then parse the
> explain?  Seems very round about if that is the case, no?
>
>
> On Wed, Nov 27, 2013 at 9:40 AM, Jack Krupansky <ja...@basetechnology.com>
> wrote:
>
>  That information would be included in the debugQuery output as well.
>>
>> -- Jack Krupansky
>>
>> -----Original Message----- From: Jamie Johnson Sent: Wednesday, November
>> 27, 2013 9:32 AM To: solr-user@lucene.apache.org Subject: Term Vector
>> Component Question
>> I am interested in retrieving the tf for terms that matched the query, not
>> all terms in the document.  Is this possible?  Looking at the example when
>> I search for the word cable I get the response that is shown below,
>> ideally
>> I'd like to see only the tf for the word cable.  Is this possible or would
>> I need to write a custom query component to do this?
>>
>> <response>
>>
>> <lst name="responseHeader">
>>
>> <int name="status">0</int>
>>
>> <int name="QTime">2</int>
>>
>> </lst>
>>
>> <result name="response" numFound="4" start="0">
>>
>> <doc/>
>>
>> <doc>
>>
>> <str name="includes">32MB SD card, USB cable, AV cable, battery</str>
>>
>> </doc>
>>
>> <doc>
>>
>> <str name="includes">USB cable</str>
>>
>> </doc>
>>
>> <doc>
>>
>> <str name="includes">earbud headphones, USB cable</str>
>>
>> </doc>
>>
>> </result>
>>
>> <lst name="termVectors">
>>
>> <str name="uniqueKeyFieldName">id</str>
>>
>> <lst name="IW-02">
>>
>> <str name="uniqueKey">IW-02</str>
>>
>> </lst>
>>
>> <lst name="9885A004">
>>
>> <str name="uniqueKey">9885A004</str>
>>
>> <lst name="includes">
>>
>> <lst name="32mb">
>>
>> <int name="tf">1</int>
>>
>> </lst>
>>
>> <lst name="av">
>>
>> <int name="tf">1</int>
>>
>> </lst>
>>
>> <lst name="battery">
>>
>> <int name="tf">1</int>
>>
>> </lst>
>>
>> <lst name="cable">
>>
>> <int name="tf">2</int>
>>
>> </lst>
>>
>> <lst name="card">
>>
>> <int name="tf">1</int>
>>
>> </lst>
>>
>> <lst name="sd">
>>
>> <int name="tf">1</int>
>>
>> </lst>
>>
>> <lst name="usb">
>>
>> <int name="tf">1</int>
>>
>> </lst>
>>
>> </lst>
>>
>> </lst>
>>
>> <lst name="3007WFP">
>>
>> <str name="uniqueKey">3007WFP</str>
>>
>> <lst name="includes">
>>
>> <lst name="cable">
>>
>> <int name="tf">1</int>
>>
>> </lst>
>>
>> <lst name="usb">
>>
>> <int name="tf">1</int>
>>
>> </lst>
>>
>> </lst>
>>
>> </lst>
>>
>> <lst name="MA147LL/A">
>>
>> <str name="uniqueKey">MA147LL/A</str>
>>
>> <lst name="includes">
>>
>> <lst name="cable">
>>
>> <int name="tf">1</int>
>>
>> </lst>
>>
>> <lst name="earbud">
>>
>> <int name="tf">1</int>
>>
>> </lst>
>>
>> <lst name="headphones">
>>
>> <int name="tf">1</int>
>>
>> </lst>
>>
>> <lst name="usb">
>>
>> <int name="tf">1</int>
>>
>> </lst>
>>
>> </lst>
>>
>> </lst>
>>
>> </lst>
>>
>> </response>
>>
>>
>

Re: Term Vector Component Question

Posted by Jack Krupansky <ja...@basetechnology.com>.
There is an XML version of explain as well, if parsing the structured text 
is too difficult for your application. The point is that debug "explain" 
details precisely the term vector values for actual query terms.

Don't let the "debug" moniker throw you - this parameter is simply giving 
you access to detail information that you might find of value in your 
application.

As Erick explained, the function query approach ("tf(query-term)") also 
works, kind of, sort of, at least where all query terms must be matched, but 
when the "OR" operator is used, it won't tell you which term matched - 
although a tf value of 0 basically tells you that.

-- Jack Krupansky

-----Original Message----- 
From: Jamie Johnson
Sent: Wednesday, November 27, 2013 11:38 AM
To: solr-user@lucene.apache.org
Subject: Re: Term Vector Component Question

Jack,

I'm not following, are you suggesting to turn on debug and then parse the
explain?  Seems very round about if that is the case, no?


On Wed, Nov 27, 2013 at 9:40 AM, Jack Krupansky 
<ja...@basetechnology.com>wrote:

> That information would be included in the debugQuery output as well.
>
> -- Jack Krupansky
>
> -----Original Message----- From: Jamie Johnson Sent: Wednesday, November
> 27, 2013 9:32 AM To: solr-user@lucene.apache.org Subject: Term Vector
> Component Question
> I am interested in retrieving the tf for terms that matched the query, not
> all terms in the document.  Is this possible?  Looking at the example when
> I search for the word cable I get the response that is shown below, 
> ideally
> I'd like to see only the tf for the word cable.  Is this possible or would
> I need to write a custom query component to do this?
>
> <response>
>
> <lst name="responseHeader">
>
> <int name="status">0</int>
>
> <int name="QTime">2</int>
>
> </lst>
>
> <result name="response" numFound="4" start="0">
>
> <doc/>
>
> <doc>
>
> <str name="includes">32MB SD card, USB cable, AV cable, battery</str>
>
> </doc>
>
> <doc>
>
> <str name="includes">USB cable</str>
>
> </doc>
>
> <doc>
>
> <str name="includes">earbud headphones, USB cable</str>
>
> </doc>
>
> </result>
>
> <lst name="termVectors">
>
> <str name="uniqueKeyFieldName">id</str>
>
> <lst name="IW-02">
>
> <str name="uniqueKey">IW-02</str>
>
> </lst>
>
> <lst name="9885A004">
>
> <str name="uniqueKey">9885A004</str>
>
> <lst name="includes">
>
> <lst name="32mb">
>
> <int name="tf">1</int>
>
> </lst>
>
> <lst name="av">
>
> <int name="tf">1</int>
>
> </lst>
>
> <lst name="battery">
>
> <int name="tf">1</int>
>
> </lst>
>
> <lst name="cable">
>
> <int name="tf">2</int>
>
> </lst>
>
> <lst name="card">
>
> <int name="tf">1</int>
>
> </lst>
>
> <lst name="sd">
>
> <int name="tf">1</int>
>
> </lst>
>
> <lst name="usb">
>
> <int name="tf">1</int>
>
> </lst>
>
> </lst>
>
> </lst>
>
> <lst name="3007WFP">
>
> <str name="uniqueKey">3007WFP</str>
>
> <lst name="includes">
>
> <lst name="cable">
>
> <int name="tf">1</int>
>
> </lst>
>
> <lst name="usb">
>
> <int name="tf">1</int>
>
> </lst>
>
> </lst>
>
> </lst>
>
> <lst name="MA147LL/A">
>
> <str name="uniqueKey">MA147LL/A</str>
>
> <lst name="includes">
>
> <lst name="cable">
>
> <int name="tf">1</int>
>
> </lst>
>
> <lst name="earbud">
>
> <int name="tf">1</int>
>
> </lst>
>
> <lst name="headphones">
>
> <int name="tf">1</int>
>
> </lst>
>
> <lst name="usb">
>
> <int name="tf">1</int>
>
> </lst>
>
> </lst>
>
> </lst>
>
> </lst>
>
> </response>
> 


Re: Term Vector Component Question

Posted by Jamie Johnson <je...@gmail.com>.
Jack,

I'm not following, are you suggesting to turn on debug and then parse the
explain?  Seems very round about if that is the case, no?


On Wed, Nov 27, 2013 at 9:40 AM, Jack Krupansky <ja...@basetechnology.com>wrote:

> That information would be included in the debugQuery output as well.
>
> -- Jack Krupansky
>
> -----Original Message----- From: Jamie Johnson Sent: Wednesday, November
> 27, 2013 9:32 AM To: solr-user@lucene.apache.org Subject: Term Vector
> Component Question
> I am interested in retrieving the tf for terms that matched the query, not
> all terms in the document.  Is this possible?  Looking at the example when
> I search for the word cable I get the response that is shown below, ideally
> I'd like to see only the tf for the word cable.  Is this possible or would
> I need to write a custom query component to do this?
>
> <response>
>
> <lst name="responseHeader">
>
> <int name="status">0</int>
>
> <int name="QTime">2</int>
>
> </lst>
>
> <result name="response" numFound="4" start="0">
>
> <doc/>
>
> <doc>
>
> <str name="includes">32MB SD card, USB cable, AV cable, battery</str>
>
> </doc>
>
> <doc>
>
> <str name="includes">USB cable</str>
>
> </doc>
>
> <doc>
>
> <str name="includes">earbud headphones, USB cable</str>
>
> </doc>
>
> </result>
>
> <lst name="termVectors">
>
> <str name="uniqueKeyFieldName">id</str>
>
> <lst name="IW-02">
>
> <str name="uniqueKey">IW-02</str>
>
> </lst>
>
> <lst name="9885A004">
>
> <str name="uniqueKey">9885A004</str>
>
> <lst name="includes">
>
> <lst name="32mb">
>
> <int name="tf">1</int>
>
> </lst>
>
> <lst name="av">
>
> <int name="tf">1</int>
>
> </lst>
>
> <lst name="battery">
>
> <int name="tf">1</int>
>
> </lst>
>
> <lst name="cable">
>
> <int name="tf">2</int>
>
> </lst>
>
> <lst name="card">
>
> <int name="tf">1</int>
>
> </lst>
>
> <lst name="sd">
>
> <int name="tf">1</int>
>
> </lst>
>
> <lst name="usb">
>
> <int name="tf">1</int>
>
> </lst>
>
> </lst>
>
> </lst>
>
> <lst name="3007WFP">
>
> <str name="uniqueKey">3007WFP</str>
>
> <lst name="includes">
>
> <lst name="cable">
>
> <int name="tf">1</int>
>
> </lst>
>
> <lst name="usb">
>
> <int name="tf">1</int>
>
> </lst>
>
> </lst>
>
> </lst>
>
> <lst name="MA147LL/A">
>
> <str name="uniqueKey">MA147LL/A</str>
>
> <lst name="includes">
>
> <lst name="cable">
>
> <int name="tf">1</int>
>
> </lst>
>
> <lst name="earbud">
>
> <int name="tf">1</int>
>
> </lst>
>
> <lst name="headphones">
>
> <int name="tf">1</int>
>
> </lst>
>
> <lst name="usb">
>
> <int name="tf">1</int>
>
> </lst>
>
> </lst>
>
> </lst>
>
> </lst>
>
> </response>
>

Re: Term Vector Component Question

Posted by Jack Krupansky <ja...@basetechnology.com>.
That information would be included in the debugQuery output as well.

-- Jack Krupansky

-----Original Message----- 
From: Jamie Johnson 
Sent: Wednesday, November 27, 2013 9:32 AM 
To: solr-user@lucene.apache.org 
Subject: Term Vector Component Question 

I am interested in retrieving the tf for terms that matched the query, not
all terms in the document.  Is this possible?  Looking at the example when
I search for the word cable I get the response that is shown below, ideally
I'd like to see only the tf for the word cable.  Is this possible or would
I need to write a custom query component to do this?

<response>

<lst name="responseHeader">

<int name="status">0</int>

<int name="QTime">2</int>

</lst>

<result name="response" numFound="4" start="0">

<doc/>

<doc>

<str name="includes">32MB SD card, USB cable, AV cable, battery</str>

</doc>

<doc>

<str name="includes">USB cable</str>

</doc>

<doc>

<str name="includes">earbud headphones, USB cable</str>

</doc>

</result>

<lst name="termVectors">

<str name="uniqueKeyFieldName">id</str>

<lst name="IW-02">

<str name="uniqueKey">IW-02</str>

</lst>

<lst name="9885A004">

<str name="uniqueKey">9885A004</str>

<lst name="includes">

<lst name="32mb">

<int name="tf">1</int>

</lst>

<lst name="av">

<int name="tf">1</int>

</lst>

<lst name="battery">

<int name="tf">1</int>

</lst>

<lst name="cable">

<int name="tf">2</int>

</lst>

<lst name="card">

<int name="tf">1</int>

</lst>

<lst name="sd">

<int name="tf">1</int>

</lst>

<lst name="usb">

<int name="tf">1</int>

</lst>

</lst>

</lst>

<lst name="3007WFP">

<str name="uniqueKey">3007WFP</str>

<lst name="includes">

<lst name="cable">

<int name="tf">1</int>

</lst>

<lst name="usb">

<int name="tf">1</int>

</lst>

</lst>

</lst>

<lst name="MA147LL/A">

<str name="uniqueKey">MA147LL/A</str>

<lst name="includes">

<lst name="cable">

<int name="tf">1</int>

</lst>

<lst name="earbud">

<int name="tf">1</int>

</lst>

<lst name="headphones">

<int name="tf">1</int>

</lst>

<lst name="usb">

<int name="tf">1</int>

</lst>

</lst>

</lst>

</lst>

</response>