The query:

http://localhost:8983/solr/select/?qt=tvrh&q=query:the&tv.fl=query&tv.all=true&f.id.tv.tf=true&facet.field=id&facet=true&facet.limit=-1&facet.mincount=1

be careful with facet.limit=-1, it'll pull everything matching the query.
Probably paging would make more sense in your case.
f.id.tv.tf will make sure to output term frequencies.

In my schema the field "query" contains some "text" data to search against
(don't get mixed up ;) ). You will also need termVectors="true"
termPositions="true" termOffsets="true" for your searching field.

Relevant exceprts from response:

<result name="response" numFound="787" start="0">
<doc>
<str name="id">721</str>
<str name="query">the doors "the end"</str>
<date name="timestamp">2002-08-09T04:05:28Z</date>
<str name="user">wifcbcdr</str>
</doc>
...
</result>
<lst name="facet_counts">
<lst name="facet_queries"/>
<lst name="facet_fields">
<lst name="id">
<int name="721">1</int>
...
</lst>
</lst>
<lst name="facet_dates"/>
<lst name="facet_ranges"/>
<lst name="termVectors">
<lst name="doc-720"> <!-- Notice how strange the doc-id is less than solr
uniqueKey id by one. I have no idea why it is like this -->
<str name="uniqueKey">721</str>
<lst name="query">
<lst name="doors">
<int name="tf">1</int>
<lst name="offsets">
<int name="start">4</int>
<int name="end">9</int>
</lst>
<lst name="positions">
<int name="position">1</int>
</lst>
<int name="df">37</int>
<double name="tf-idf">0.02702702702702703</double>
</lst>
<lst name="end">
<int name="tf">1</int>
<lst name="offsets">
<int name="start">15</int>
<int name="end">18</int>
</lst>
<lst name="positions">
<int name="position">3</int>
</lst>
<int name="df">43</int>
<double name="tf-idf">0.023255813953488372</double>
</lst>
<lst name="*the*"> <!-- In-document term frequency -->
<int name="tf">2</int>
<lst name="offsets">
<int name="start">0</int>
<int name="end">3</int>
<int name="start">11</int>
<int name="end">14</int>
</lst>
<lst name="positions">
<int name="position">0</int>
<int name="position">2</int>
</lst>
<int name="df">787</int>
<double name="tf-idf">0.0025412960609911056</double>
</lst>
</lst>
</lst>
...
</lst>

-Dmitry

On Sat, May 5, 2012 at 12:05 AM, Jamie Johnson <jej2...@gmail.com> wrote:

> it might be...can you provide an example of the request/response?
>
> On Fri, May 4, 2012 at 3:31 PM, Dmitry Kan <dmitry....@gmail.com> wrote:
> > I have tried (as a test) combining facets and term vectors (
> > http://wiki.apache.org/solr/TermVectorComponent ) in one query and was
> able
> > to get a list of facets and for each facet there was a term freq under
> > termVectors section. Not sure, if that's what you are trying to achieve.
> >
> > -Dmitry
> >
> > On Fri, May 4, 2012 at 8:37 PM, Jamie Johnson <jej2...@gmail.com> wrote:
> >
> >> Is it possible when faceting to return not only the strings but also
> >> the total term frequency for those facets?  I am trying to avoid
> >> building a customized faceting component and making multiple queries.
> >> In our scenario we have multivalued fields which may have duplicates
> >> and I would like to be able to get a count of how many documents that
> >> term appears (currently what faceting does) but also how many times
> >> that term appears in general.
> >>
> >
> >
> >
> > --
> > Regards,
> >
> > Dmitry Kan
>



-- 
Regards,

Dmitry Kan

Reply via email to