Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C4485F6E9 for ; Sat, 13 Apr 2013 21:20:18 +0000 (UTC) Received: (qmail 11238 invoked by uid 500); 13 Apr 2013 21:20:16 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 11143 invoked by uid 500); 13 Apr 2013 21:20:16 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 11080 invoked by uid 99); 13 Apr 2013 21:20:16 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 13 Apr 2013 21:20:16 +0000 Date: Sat, 13 Apr 2013 21:20:16 +0000 (UTC) From: "Erick Erickson (JIRA)" To: dev@lucene.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (LUCENE-1853) SubPhraseQuery for matching and scoring sub phrase matches. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LUCENE-1853?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13631172#comment-13631172 ] Erick Erickson commented on LUCENE-1853: ---------------------------------------- SPRING_CLEANING_2013 JIRAS Anyone want to comment whether this is still valid? Doubtless the patch is, at best, a guide. > SubPhraseQuery for matching and scoring sub phrase matches. > ----------------------------------------------------------- > > Key: LUCENE-1853 > URL: https://issues.apache.org/jira/browse/LUCENE-1853 > Project: Lucene - Core > Issue Type: Improvement > Components: core/search > Environment: Lucene/Java > Reporter: Preetam Rao > Priority: Minor > Attachments: LUCENE-1853.patch, LUCENE-1853.patch > > > The goal is to give more control via configuration when searching using user entered queries against multiple fields where sub phrases have special significance. > For a query like "homes in new york with swimming pool", if a document's field matches only "new york" it should get scored and it should get scored higher than two separate matches "new" and "york". Also, a 3 word sub phrase match must gets scored considerably higher than a 2 word sub phrase match. (boost factor should be configurable) > Using shingles for this use case, means each field of each document needs to be indexed as shingles of all (1..N)-grams as well as the query. (Please correct me if I am wrong.) > The query could also support > - ignoring of idf and/or field norms, (so that factors outside the document don't influence scoring) > - consider only the longest match (for example match on "new york" is scored and considered rather than "new" furniture and "york" city) > - ignore duplicates ("new york" appearing twice or thrice does not make any difference) > This kind of query could be combined with DisMax query. For example, something like solr's dismax request handler can be made to use this query where we run a user query as it is against all fields and configure each field with above configurations. > I have also attached a patch with comments and test cases in case, my description is not clear enough. Would appreciate alternatives or feedback. > Example Usage: > > // sub phrase config > SubPhraseQuery.SubPhraseConfig conf = new SubPhraseQuery.SubPhraseConfig(); > conf.ignoreIdf = true; > conf.ignoreFieldNorms = true; > conf.matchOnlyLongest = true; > conf.ignoreDuplicates = true; > conf.phraseBoost = 2; > // phrase query as usual > SubPhraseQuery pq = new SubPhraseQuery(); > pq.add(new Term("f", term)); > pq.add(new Term("f", term)); > pq.setSubPhraseConf(conf); > Hits hits = searcher.search(pq); > -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org