Return-Path: Delivered-To: apmail-lucene-solr-commits-archive@minotaur.apache.org Received: (qmail 73598 invoked from network); 8 Mar 2011 22:31:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Mar 2011 22:31:05 -0000 Received: (qmail 86661 invoked by uid 500); 8 Mar 2011 22:31:05 -0000 Delivered-To: apmail-lucene-solr-commits-archive@lucene.apache.org Received: (qmail 86630 invoked by uid 500); 8 Mar 2011 22:31:05 -0000 Mailing-List: contact solr-commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-dev@lucene.apache.org Delivered-To: mailing list solr-commits@lucene.apache.org Received: (qmail 86623 invoked by uid 99); 8 Mar 2011 22:31:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Mar 2011 22:31:05 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.131] (HELO eos.apache.org) (140.211.11.131) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Mar 2011 22:31:02 +0000 Received: from eosnew.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id 4A1DE3C6 for ; Tue, 8 Mar 2011 22:30:41 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Apache Wiki To: Apache Wiki Date: Tue, 08 Mar 2011 22:30:41 -0000 Message-ID: <20110308223041.13017.45736@eosnew.apache.org> Subject: =?utf-8?q?=5BSolr_Wiki=5D_Update_of_=22TermVectorComponent=22_by_YonikSee?= =?utf-8?q?ley?= X-Virus-Checked: Checked by ClamAV on apache.org Dear Wiki user, You have subscribed to a wiki page or wiki category on "Solr Wiki" for chan= ge notification. The "TermVectorComponent" page has been changed by YonikSeeley. The comment on this change is: generald doc cleanup, remove most JIRA issue= s, change examples to select for "includes" field which as termvectors, rem= ove extraneous params, etc. http://wiki.apache.org/solr/TermVectorComponent?action=3Ddiff&rev1=3D15&rev= 2=3D16 -------------------------------------------------- = =3D=3D Enabling the TVC =3D=3D =3D=3D=3D Changes required in solrconfig.xml =3D=3D=3D - You need to enable the TermVectorComponent in your solr configuration: + You need to enable the TermVectorComponent in your solr configuration (th= is is already in the example solrconfig.xml): = {{{ @@ -32, +32 @@ }}} - =3D=3D=3D HTTP Requests =3D=3D=3D + =3D=3D=3D Example Requests =3D=3D=3D - {{{http://localhost:8983/solr/select/?q=3D*%3A*&version=3D2.2&start=3D0&r= ows=3D10&indent=3Don&qt=3Dtvrh&tv=3Dtrue}}} + In the example schema, the "includes" field has term vectors enabled. Th= e following example HTTP request + asks for the term vectors of all documents with something in the includes= field. = + [[http://localhost:8983/solr/select/?qt=3Dtvrh&q=3Dincludes:[*+TO+*]&fl= =3Did|http://localhost:8983/solr/select/?&qt=3Dtvrh&q=3Dincludes:[* TO *]&f= l=3Did]] + = - In the example, the component is associated with a request handler named = tvrh, but you can associate it with any !RequestHandler. To turn on the co= mponent for a request, add the {{{tv=3Dtrue}}} parameter (or add it to your= !RequestHandler defaults configuration). + In the example server, the component is associated with a request handler= named tvrh, but you can associate it with any !RequestHandler. To turn on= the component for a request, add the {{{tv=3Dtrue}}} parameter (or add it = to your !RequestHandler defaults configuration). = Example output: See TermVectorComponentExampleEnabled. = =3D=3D Options =3D=3D - {{{http://localhost:8983/solr/select/?q=3D*%3A*&version=3D2.2&start=3D0&r= ows=3D10&indent=3Don&qt=3Dtvrh&tv=3Dtrue&tv.tf=3Dtrue&tv.df=3Dtrue&tv.posit= ions&tv.offsets=3Dtrue}}} - = * tv.tf - Return document term frequency info per term in the document. * tv.df - Return the Document Frequency (DF) of the term in the collecti= on. 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. Requires the parameters = tv.tf and tv.df to be "true". This can be expensive. (not shown in example = output) + * tv.all - If true, turn on extra information (tv.tf, tv.df, etc) + * tv.fl - ([[Solr3.1]]) Provides the list of fields to get term vectors = for (defaults to fl) + * tv.docIds - List of Lucene document ids (not the Solr Unique Key) to g= et term vectors for. = - Alternatively, a shortcut for all options on is: + An example HTTP request using these options: = + [[http://localhost:8983/solr/select/?qt=3Dtvrh&q=3Dincludes:[*+TO+*]&fl= =3Did&tv.all=3Dtrue|http://localhost:8983/solr/select/?qt=3Dtvrh&q=3Dinclud= es:[* TO *]&fl=3Did&tv.all=3Dtrue]] - * tv.all=3Dtrue - = - Example output: See TermVectorComponentExampleOptions. - = - Schema requirements see: FieldOptionsByUseCase. = =3D=3D=3D Per Field Options =3D=3D=3D - With https://issues.apache.org/jira/browse/SOLR-1556, it is now possible = to specify per field options, similar to the way per field options work in = faceting, as in + ([Solr3.1]) Options may be specified per-field, similar to the way per fi= eld options work in faceting, as in = * f.fieldName.tv.tf - Turns on Term Frequency for the fieldName specifie= d. - * Similar for all the other options above + * Similar for all the other options that are applicable to single fields = '''''If you specify f.fieldName you must also explicitly declare &tv.fl o= r &fl''''' = @@ -80, +80 @@ }}} If you do not specify per field options but still specify a field, it wil= l assume the general options. = - =3D=3D Other Options =3D=3D - * tv.fl - List of fields to get TV information from. Optional. If not = specified, the fl parameter is used. - * As of https://issues.apache.org/jira/browse/SOLR-1556, If the field d= oes not exist, an exception is thrown - * tv.docIds - List of Lucene document ids (not the Solr Unique Key) to g= et term vectors for. - = =3D=3D Warnings =3D=3D - https://issues.apache.org/jira/browse/SOLR-1556 - = If a request field does not support the options specified, warnings will = be returned indicating that the field does not support that option. There = are three types of warnings: = 1. noTermVector - The field does not store term vectors @@ -99, +92 @@ =3D=3D SolrJ =3D=3D Neither the SolrQuery class nor the QueryResponse class offer specific me= thod calls to set TermVectorComponent parameters or get the "termVectors" o= utput. However, there is a patch for it: [[https://issues.apache.org/jira/b= rowse/SOLR-949|SOLR-949]]. = - =3D=3D History =3D=3D - [[https://issues.apache.org/jira/browse/SOLR-651|SOLR-651]] covers the de= velopment history. -=20