Return-Path: X-Original-To: apmail-lucene-solr-user-archive@minotaur.apache.org Delivered-To: apmail-lucene-solr-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5D626176E7 for ; Wed, 8 Apr 2015 23:41:27 +0000 (UTC) Received: (qmail 66783 invoked by uid 500); 8 Apr 2015 23:41:22 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 66713 invoked by uid 500); 8 Apr 2015 23:41:22 -0000 Mailing-List: contact solr-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-user@lucene.apache.org Delivered-To: mailing list solr-user@lucene.apache.org Received: (qmail 66701 invoked by uid 99); 8 Apr 2015 23:41:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Apr 2015 23:41:22 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of apache@elyograg.org designates 166.70.79.219 as permitted sender) Received: from [166.70.79.219] (HELO frodo.elyograg.org) (166.70.79.219) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Apr 2015 23:40:55 +0000 Received: from localhost (localhost [127.0.0.1]) by frodo.elyograg.org (Postfix) with ESMTP id A153BAC8E for ; Wed, 8 Apr 2015 17:40:31 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=elyograg.org; h= content-transfer-encoding:content-type:content-type:in-reply-to :references:subject:subject:mime-version:user-agent:from:from :date:date:message-id:received:received; s=mail; t=1428536431; bh=taiwwxp2qY+aTDlmYc5d6K0eQz2lbsT7ehSPWlNNKJo=; b=aEQGV8g4cchH V2xiTvixAPYKNKe0DjaYIGONEx8llggw3v5eAKw1pRL7grPGjRAYDu9pPM8zYJ0o TzD95hA46lX+ZVWcbZFv8PnwchR8O/dDAPyyAHI9L76T/pqNrlMxrNeiMzft5Oah mnZX2JTBbZlxC5pF1RsAnjBFVHSdLfM= X-Virus-Scanned: Debian amavisd-new at frodo.elyograg.org Received: from frodo.elyograg.org ([127.0.0.1]) by localhost (frodo.elyograg.org [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id YB8dsIowa3v3 for ; Wed, 8 Apr 2015 17:40:31 -0600 (MDT) Received: from [10.2.0.108] (client175.mainstreamdata.com [209.63.42.175]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: elyograg@elyograg.org) by frodo.elyograg.org (Postfix) with ESMTPSA id E2C56AC8C for ; Wed, 8 Apr 2015 17:40:30 -0600 (MDT) Message-ID: <5525BC6D.1070804@elyograg.org> Date: Wed, 08 Apr 2015 17:40:29 -0600 From: Shawn Heisey User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: solr-user@lucene.apache.org Subject: Re: omitTermFreqAndPositions issue References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On 4/8/2015 5:06 PM, Ryan Josal wrote: > The error: > IllegalStateException: field "foo" indexed without position data; cannot > run PhraseQuery. > > It would actually be ok for us to index position data but there isn't an > option for that without term frequencies. No TF is important for us when > it comes to searching product titles. > > I should say that only a small fraction of user queries contained quoted > phrases that trigger this error, so it works much of the time, but we'd > also like to continue supporting user quoted phrase queries. > > So how can I index a field without TF and use it in edismax qf? If you omit positions, you can't do phrase queries. As far as I know, there is no option in Solr to omit only frequencies and not positions. I think there is a way that you can achieve what you want, though. What you are looking for is filters. The fq parameter (filter query) will restrict the result set to only entries that match the query, but will not affect the relevancy score *at all*. Here is an example of a filter query that restricts the results to items that are in stock, assuming you have the appropriate schema: fq=inStock:true Queries specified in fq will default to the lucene query parser, but you can override that if you need to. This query would be equivalent to the previous one, but it would be parsed using edismax: fq={!edismax}inStock:true Here's another example of a useful filter, using yet another query parser: fq={!terms f=userId}bob,alice,susan Remember, the reason I have suggested filters is that they do not influence score. https://cwiki.apache.org/confluence/display/solr/Common+Query+Parameters#CommonQueryParameters-Thefq%28FilterQuery%29Parameter Thanks, Shawn