From general-return-537-apmail-lucene-general-archive=lucene.apache.org@lucene.apache.org Mon Sep 10 16:17:25 2007 Return-Path: Delivered-To: apmail-lucene-general-archive@www.apache.org Received: (qmail 14154 invoked from network); 10 Sep 2007 16:17:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Sep 2007 16:17:24 -0000 Received: (qmail 27342 invoked by uid 500); 10 Sep 2007 16:17:17 -0000 Delivered-To: apmail-lucene-general-archive@lucene.apache.org Received: (qmail 27098 invoked by uid 500); 10 Sep 2007 16:17:16 -0000 Mailing-List: contact general-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: general@lucene.apache.org Delivered-To: mailing list general@lucene.apache.org Received: (qmail 27087 invoked by uid 99); 10 Sep 2007 16:17:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Sep 2007 09:17:16 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of kohan.massoud@gmail.com designates 64.233.166.179 as permitted sender) Received: from [64.233.166.179] (HELO py-out-1112.google.com) (64.233.166.179) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Sep 2007 16:17:14 +0000 Received: by py-out-1112.google.com with SMTP id d32so4226646pye for ; Mon, 10 Sep 2007 09:16:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=CETZG0qPytO+O5DmjdKRoX02mphxK3G4mAUuO6feUig=; b=V9fSRmathuM+XsBdWctaRD+s9qd33PuIBsOAbigPjexUHZRgtPjThVWUdY8Ly2JdgAm+7rZF8ghFZWLiBM+ZVZ6SccTfUIv/xOFei1ClQJAsArlKptRhrp480LZ2S6udZAuOMlBB00PlsCVp3XX5iBexhH5Yfps5J6peeY1yDzM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type; b=GJtDRCQjBhiWqjmy+WTl0T5ze8E8yWlvb29oaMzBkVVaIrK9smOZxey4f/zSGvgXO2GIR8rQFKYrUv0dRPely0+HNf1YLmwOcdv1K3x24EGNM9iNQ2nlL6AO3NeAr7NQDvr9ersz/xQQIa9whmkWvq3udKcESiBYBBs5FN8RSLA= Received: by 10.64.10.2 with SMTP id 2mr9796626qbj.1189441012199; Mon, 10 Sep 2007 09:16:52 -0700 (PDT) Received: by 10.64.253.14 with HTTP; Mon, 10 Sep 2007 09:16:52 -0700 (PDT) Message-ID: <60f15f3e0709100916r437b4945jc5a5ed57387707d8@mail.gmail.com> Date: Mon, 10 Sep 2007 09:16:52 -0700 From: M.K To: general@lucene.apache.org Subject: Implement a filter to the search results MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_9319_5126914.1189441012170" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_9319_5126914.1189441012170 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi All, I have a search form which has an input area for key search and also three optional select boxs *Catagory, Department and Year. * My question is how can I filter the results if users select a category or a department or a year or a combination of them. *index *: IndexWriter indexWriter = *new* IndexWriter(API.*getRootPath*() + "\\data\\LUCENE", *new* StandardAnalyzer(),true); Document document = *new* Document(); document.add(Field.*Text*("text", docText)); document.add(Field.*UnIndexed*("department", depart)); document.add(Field.*UnIndexed*("category", courseId)); document.add(Field.*UnIndexed*("year", year)); indexWriter.addDocument(document); indexWriter.close(); *search: * *Searcher searcher = new IndexSearcher(API.getRootPath() + "/data/LUCENE/"); Analyzer analyzer = new StandardAnalyzer();* * Query query = QueryParser.parse(request.getParameter("query"), "text", analyzer); Hits hits = searcher.search(query);* I do not konw how implement a filter to the results of the search for catgory or year or department. Thanks, Massoud ------=_Part_9319_5126914.1189441012170--