Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 4796 invoked from network); 17 Nov 2008 13:01:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Nov 2008 13:01:54 -0000 Received: (qmail 7966 invoked by uid 500); 17 Nov 2008 13:01:55 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 7938 invoked by uid 500); 17 Nov 2008 13:01:55 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 7927 invoked by uid 99); 17 Nov 2008 13:01:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Nov 2008 05:01:55 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of aditigupta20@gmail.com designates 209.85.142.186 as permitted sender) Received: from [209.85.142.186] (HELO ti-out-0910.google.com) (209.85.142.186) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Nov 2008 13:00:33 +0000 Received: by ti-out-0910.google.com with SMTP id b8so1697796tic.11 for ; Mon, 17 Nov 2008 05:01:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=OiZU3n+EtOemNkK+w83VliNkvM7PfBybqZDeGRJNwYI=; b=aKGaHwwFpx5Y/enmGLwdCJRg21agE/MkmynMKdYManFwCUvPmP54ELojZ8nXjDfbfL 6icNIIGbIHJVECzwSZbjDs3W/LopDXKxuDJBJM+CQ7ovIvOzoUryqjpVawYV2bJHTxve pTOmYkUo0jj4dxrNwuOtWBBQJ6tiYOwnHOkTo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=uBE9319CBTo8m/eoi/dfBMvp3XvB/RN0TGKFV6YTAdAhEGH/Tlh5UF5vZqDgwwPDp6 h1B2maHjUzCJYJDwfouVh6T+uLtcW+VJaQ/DUbBzUV/GKD9Nwl+c7R8AZCACtzyZaHO3 b+4uUyD/oesG6Eh3GPmuVjWZWwiW299A7XdT4= Received: by 10.110.5.3 with SMTP id 3mr5140647tie.46.1226926867810; Mon, 17 Nov 2008 05:01:07 -0800 (PST) Received: by 10.110.50.16 with HTTP; Mon, 17 Nov 2008 05:01:07 -0800 (PST) Message-ID: <6fc71b230811170501k6531ed88kb194cf83278b3358@mail.gmail.com> Date: Mon, 17 Nov 2008 18:31:07 +0530 From: "Aditi Goyal" To: java-user@lucene.apache.org Subject: Searching across multiple fields MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_58014_8149375.1226926867812" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_58014_8149375.1226926867812 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, Lets say I have an index with the following fields: field1, field2, field3 and field4 where all the fields can have same values. Now I want to search a document where "basket" and "apple" are part of the whole document but "orange" is not. I have tried using MultiFieldQueryParser but it is not showing correct results. I typed the command ("basket" AND "apple") NOT "orange" for the MultiFieldQueryParser query = lucene.MultiFieldQueryParser.parse(command, fields, shoulds, analyzer ) hits = self.searcher.search(query) Am I doing something wrong? Please help. Thanks, Aditi ------=_Part_58014_8149375.1226926867812--