Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 18055 invoked from network); 20 Dec 2006 00:12:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Dec 2006 00:12:11 -0000 Received: (qmail 26341 invoked by uid 500); 20 Dec 2006 00:12:17 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 26020 invoked by uid 500); 20 Dec 2006 00:12:15 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 26008 invoked by uid 99); 20 Dec 2006 00:12:15 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Dec 2006 16:12:15 -0800 X-ASF-Spam-Status: No, hits=3.2 required=10.0 tests=HTML_MESSAGE,HTML_OBFUSCATE_05_10 X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [69.50.2.12] (HELO ex8.myhostedexchange.com) (69.50.2.12) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Dec 2006 16:12:05 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C723CC.3389224E" Subject: Scoring prefix query matches by matching word position Date: Tue, 19 Dec 2006 16:13:40 -0800 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Scoring prefix query matches by matching word position Thread-Index: Accjy7ObpLpvo077RJe6CXki5pVZBg== From: "Chima Echeruo" To: X-Virus-Checked: Checked by ClamAV on apache.org ------_=_NextPart_001_01C723CC.3389224E Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello, Given a prefix query such as "Jame*" and an index containing the following entries: Someone that is named James James Brown James Crown John James Mathew Jameson Jones Mathew Jamesville Dewitt Hank James I'd like Lucene to return the results in the following order: James Brown James Crown Jameson Jones Mathew Jamesville Dewitt Hank James Someone that is named James The score of a matching document should be inversely proportional to the position of the word in which the first prefix match occurred. So documents that matched on the first word should be ranked above matches in the second word and above matches in the third word etc... Items that matched on the same word position should then be sorted alphabetically. So far I've not been successful trying to get this behavior out of the stock Lucene query parsers and scorers. I'd appreciate any help in implementing this. The Similarity class does not provide information on where the match occurred so I cannot implement this logic there. -c ------_=_NextPart_001_01C723CC.3389224E--