You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2009/11/05 10:10:12 UTC
[Solr Wiki] Update of "TermVectorComponent" by ChantalAckermann
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.
The "TermVectorComponent" page has been changed by ChantalAckermann.
The comment on this change is: Added solrconfig requirements, and a note concerning SolrJ including link to JIRA issue..
http://wiki.apache.org/solr/TermVectorComponent?action=diff&rev1=10&rev2=11
--------------------------------------------------
All examples are based on using the Solr example.
== Enabling the TVC ==
+
+ === Changes required in solrconfig.xml ===
+
+ You need to enable the TermVectorComponent in your solr configuration:
+
+ {{{
+ <searchComponent name="tvComponent" class="org.apache.solr.handler.component.TermVectorComponent"/>
+ }}}
+
+ A RequestHandler configuration using this component could look like this:
+
+ {{{
+ <requestHandler name="tvrh" class="org.apache.solr.handler.component.SearchHandler">
+ <lst name="defaults">
+ <bool name="tv">true</bool>
+ </lst>
+ <arr name="last-components">
+ <str>tvComponent</str>
+ </arr>
+ </requestHandler>
+ }}}
+
+ === HTTP Requests ===
{{{http://localhost:8983/solr/select/?q=*%3A*&version=2.2&start=0&rows=10&indent=on&qt=tvrh&tv=true}}}
@@ -30, +53 @@
* tv.df - Return the Document Frequency (DF) of the term in the collection. This can be expensive.
* tv.positions - Return position information.
* tv.offsets - Return offset information for each term in the document.
- * tv.tf_idf - Calculates tf*idf for each term. This can be expensive. (not shown in example output)
+ * tv.tf_idf - Calculates tf*idf for each term. Requires the parameters tv.tf and tv.df to be "true". This can be expensive. (not shown in example output)
Alternatively, a shortcut for all options on is:
* tv.all=true
Example output: See TermVectorComponentExampleOptions.
+ Schema requirements see: FieldOptionsByUseCase.
+
== Other Options ==
* tv.fl - List of fields to get TV information from. Optional. If not specified, the fl parameter is used.
* tv.docIds - List of Lucene document ids (not the Solr Unique Key) to get term vectors for.
+ == SolrJ ==
+
+ Neither the SolrQuery class nor the QueryResponse class offer specific method calls to set TermVectorComponent parameters or get the "termVectors" output. However, there is a patch for it: [[https://issues.apache.org/jira/browse/SOLR-949|SOLR-949]].
+
== History ==
[[https://issues.apache.org/jira/browse/SOLR-651|SOLR-651]] covers the development history.