Return-Path: Delivered-To: apmail-lucene-solr-commits-archive@minotaur.apache.org Received: (qmail 71475 invoked from network); 12 Jun 2009 15:39:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Jun 2009 15:39:40 -0000 Received: (qmail 97625 invoked by uid 500); 12 Jun 2009 15:39:52 -0000 Delivered-To: apmail-lucene-solr-commits-archive@lucene.apache.org Received: (qmail 97548 invoked by uid 500); 12 Jun 2009 15:39:52 -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 97529 invoked by uid 99); 12 Jun 2009 15:39:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Jun 2009 15:39:52 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.130] (HELO eos.apache.org) (140.211.11.130) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Jun 2009 15:39:50 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id 80E26118BB for ; Fri, 12 Jun 2009 15:39:29 +0000 (GMT) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Apache Wiki To: solr-commits@lucene.apache.org Date: Fri, 12 Jun 2009 15:39:29 -0000 Message-ID: <20090612153929.22454.53715@eos.apache.org> Subject: [Solr Wiki] Update of "FilterQueryGuidance" by ShalinMangar 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 change notification. The following page has been changed by ShalinMangar: http://wiki.apache.org/solr/FilterQueryGuidance The comment on the change is: Added notes on analysis, scoring and faceting ------------------------------------------------------------------------------ Anyway, we need to analyze, to decompose the queries we want our system to handle. We'll then know the query parts and the frequency of the various combinations, and we'll then see what are good filter query candidates. + + == Analysis, Scoring and Faceting == + + Each field type in Solr can define a index-time and query-time analyzer. When a query is specified through the 'q' parameter, it is parsed and the token is analyzed through the query-time analyzer for that field's type. For example, 'string' type fields are not analyzer but 'text' type fields are analyzed. However, any query specified as a filter query through the 'fq' parameter is *not* analyzed regardless of the field's type. Therefore, filter queries are best suited for filtering on exact matches or range searches. If you need to filter but the search query needs to be analyzed, it should be specified through the 'q' parameter. + + Filter queries, as the name suggest, are used for filtering (or drilling down) the result set. Therefore, the results of a filter does not need to be ordered and hence it does not participate in the scoring. Queries specified in the 'q' parameter contribute to the scores. + + Filter queries are great for filtering result sets based on facets. Faceting is performed on the indexed tokens and therefore the value of any facet can be directly used in the 'fq' parameter since it does not need to be analyzed. == An example to illustrate the greater efficiency obtainable by filtering ==