Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 87463 invoked from network); 28 Dec 2010 20:11:38 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 28 Dec 2010 20:11:38 -0000 Received: (qmail 44866 invoked by uid 500); 28 Dec 2010 20:11:36 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 44791 invoked by uid 500); 28 Dec 2010 20:11:35 -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 44774 invoked by uid 99); 28 Dec 2010 20:11:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Dec 2010 20:11:35 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of alertli@gmail.com designates 209.85.161.48 as permitted sender) Received: from [209.85.161.48] (HELO mail-fx0-f48.google.com) (209.85.161.48) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Dec 2010 20:11:26 +0000 Received: by fxm2 with SMTP id 2so9293154fxm.35 for ; Tue, 28 Dec 2010 12:11:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:cc:content-type; bh=31ydFnk9pX4n0s0MTzJ1I0Kh+oDZ73MEoKBJpeNeYHI=; b=Ew4C5ndzLhDif1Qa+6zOYqo6Zz2Vt6yLaVCYfCqoQG6ZXpiaZsDyApYfWge3Z2WsF2 k09epO1Amyu5B91y3y00sMvD1HVd09uCq1PKTs4/ruD+DGnsMPY9dG9EFBQ1qGnEzJmh 5rsUJR/JDBQKAFIERdctXq/5YYFMjJPcMtQik= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=GB4kEZtL5mWMsby/j8USdugOeINYIiAI6ws5VBPBVibqxXId5cOChTwiFp7nueOc1f h0nER/CrkoedkFW/VJx62qeinR0FdDEJG9Zji1JSV0FZLKbQ7aBIfFI3f3Lb3Qn+Huoi 5PlZkfqRFq6PZB2gVFbYLFq2orZDjlFBgCLOg= MIME-Version: 1.0 Received: by 10.223.101.138 with SMTP id c10mr5513121fao.120.1293567066307; Tue, 28 Dec 2010 12:11:06 -0800 (PST) Received: by 10.223.104.141 with HTTP; Tue, 28 Dec 2010 12:11:06 -0800 (PST) Date: Tue, 28 Dec 2010 15:11:06 -0500 Message-ID: Subject: relevant score calculation From: Qi Li To: java-user@lucene.apache.org Cc: "java-user-help@lucene.apache.org" Content-Type: multipart/alternative; boundary=20cf304341f87afe1c04987e0d36 X-Virus-Checked: Checked by ClamAV on apache.org --20cf304341f87afe1c04987e0d36 Content-Type: text/plain; charset=ISO-8859-1 Happy Holidays ! Test case doc1 : test -- one two three doc2 : test, one two three doc3 : one two three Search query : "one two three" by QueryParser and StandardAnalyzer Question: why all of three documents have the same score? I really want the doc3 has higher score because it is an exact match and short. Can anybody explain this? I will appreciate a lot Here is my code and its output public class Test { public static void main(String[] args){ test(); } private static void test(){ String[] contents = {"test -- one two three", "test, one two three", "one two three"}; Directory dir = new RAMDirectory(); try { IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(Version.LUCENE_30), IndexWriter.MaxFieldLength.UNLIMITED); for (int i=0; i