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 8B1786A11 for ; Sat, 2 Jul 2011 18:21:44 +0000 (UTC) Received: (qmail 88971 invoked by uid 500); 2 Jul 2011 18:21:41 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 88791 invoked by uid 500); 2 Jul 2011 18:21:40 -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 88783 invoked by uid 99); 2 Jul 2011 18:21:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Jul 2011 18:21:39 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of sokolov@ifactory.com designates 68.236.111.2 as permitted sender) Received: from [68.236.111.2] (HELO camelot.ifactory.com) (68.236.111.2) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Jul 2011 18:21:31 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by camelot.ifactory.com (Postfix) with ESMTP id 3BCEA192000D; Sat, 2 Jul 2011 14:20:53 -0400 (EDT) Received: from camelot.ifactory.com ([127.0.0.1]) by localhost (camelot.ifactory.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id V22Oyt3J0RKd; Sat, 2 Jul 2011 14:20:52 -0400 (EDT) Received: from [192.168.1.4] (pool-108-7-217-216.bstnma.fios.verizon.net [108.7.217.216]) by camelot.ifactory.com (Postfix) with ESMTPSA id 163B6192000A; Sat, 2 Jul 2011 14:20:52 -0400 (EDT) Message-ID: <4E0F6180.7000207@ifactory.com> Date: Sat, 02 Jul 2011 14:20:48 -0400 From: Michael Sokolov User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 To: solr-user@lucene.apache.org CC: Spyros Kapnissis Subject: Re: Match only documents which contain all query terms References: <1309564220.44663.YahooMailNeo@web120215.mail.ne1.yahoo.com> In-Reply-To: <1309564220.44663.YahooMailNeo@web120215.mail.ne1.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org I believe you should be able to get results ordered so that the documents you want will always come first, so you can truncate the results efficiently on the client side. You could also try a regexp query (untested): a b c -/~(a|b|c)/ -Mike On 7/1/2011 7:50 PM, Spyros Kapnissis wrote: > Hello to all, > > > Is it possible that I can make solr return only documents that contain all or most of my query terms for a specific field? Or will I need some post-processing on the results? > > So, for example, if I search for (a b c), I would like the following documents returned: > > a b c > a' c b (where a' is a stem for example) > > but not > x y a b c z > > Thanks, > Spyros