Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 17867 invoked from network); 18 Nov 2008 17:37:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Nov 2008 17:37:50 -0000 Received: (qmail 47492 invoked by uid 500); 18 Nov 2008 17:37:51 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 47452 invoked by uid 500); 18 Nov 2008 17:37:51 -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 47441 invoked by uid 99); 18 Nov 2008 17:37:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Nov 2008 09:37:51 -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 easy.lin@gmail.com designates 64.233.182.188 as permitted sender) Received: from [64.233.182.188] (HELO nf-out-0910.google.com) (64.233.182.188) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Nov 2008 17:36:28 +0000 Received: by nf-out-0910.google.com with SMTP id g16so1526785nfd.15 for ; Tue, 18 Nov 2008 09:37:11 -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=NUA4v91fPkupsdIh4yYWH8x+qBoiwrePCh9iK2p09pw=; b=czP7D1hRrkVhf1KqBYX44go9FJjOo+YAPcT8BOIAuc7tDVy3Czhgr+yxN/iBZvXglK KgP4oVpMQLwpbz3Qj5eJlfZSAXHtLZQdoWXvG8qJ/2Ezn/v5ySOHQMUfVRZMqlNIMuBD W/2kj9hTeY+Hgxl2czb3jhjQ8/cvUcKJIGYec= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=gZ8l+y2lsn3Fe6z75lArI9DxHCXHVM8S3iPRXt0jRjFInL8VZuerByGdJUf2Wx4dbG iOjBIuZ+RP5cS+bku50971xFRzBkWMGSosyT6sUw1q00qqWxh5t+06+TTXrg8krwV3jl jYRgUkNDNTLSMBSKfW9SIOaOvZQC5YpPi4AZE= Received: by 10.86.95.20 with SMTP id s20mr145779fgb.39.1227029830531; Tue, 18 Nov 2008 09:37:10 -0800 (PST) Received: by 10.86.86.16 with HTTP; Tue, 18 Nov 2008 09:37:10 -0800 (PST) Message-ID: Date: Tue, 18 Nov 2008 18:37:10 +0100 From: "T. H. Lin" To: java-user@lucene.apache.org Subject: can I set Boost to the term while indexing? MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_44992_22837623.1227029830545" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_44992_22837623.1227029830545 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I would like to store a set of keywords in a single field of a document. for example I have now three keywords: "One", "Two" and "Three" and I am going to add them into a document. At first, is this code correct? /****************************************************************/ String[] keyword = new String[]{"One", "Two", "Three"}; for (int i = 0; i < keyword.length; i++) { Field f = new Field("field_name", keyword[i], Field.Store.NO, Field.Index.UN_TOKENIZED, TermVector.YES); doc.add(f); } indexWriter.addDocument(doc); /***************************************************************/ when searching, We can set Boost for a query term. the question is... Can I set Boost for every keyword/term while indexing? from the example above. I may set those keywords. i.e. "One", "Two" and "Three", with different "Weight/Boost/Relavance..." while indexing. and the same "term" may have different "Weight/Boost/Relavance..." in different document. can I do this? thanks. :-) ------=_Part_44992_22837623.1227029830545--