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 70C6EDBDE for ; Fri, 2 Nov 2012 14:59:14 +0000 (UTC) Received: (qmail 14675 invoked by uid 500); 2 Nov 2012 14:59:12 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 14578 invoked by uid 500); 2 Nov 2012 14:59:12 -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 14206 invoked by uid 99); 2 Nov 2012 14:59:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Nov 2012 14:59:12 +0000 Date: Fri, 2 Nov 2012 14:59:12 +0000 (UTC) From: "Michael McCandless (JIRA)" To: dev@lucene.apache.org Message-ID: <369388227.60535.1351868352581.JavaMail.jiratomcat@arcas> In-Reply-To: <446058856.49945.1351684633165.JavaMail.jiratomcat@arcas> Subject: [jira] [Commented] (LUCENE-4517) Suggesters: allow to pass a user-defined predicate/filter to the completion searcher 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-4517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13489458#comment-13489458 ] Michael McCandless commented on LUCENE-4517: -------------------------------------------- Maybe, instead of pushing Predicate all the way down to TopNSearcher, since it already has the acceptResult filtering, we could just pass it to the suggester and it consults the predicate? Or maybe we add an acceptResult method to AnalyzingSuggester and the app can subclass & override that? I think to deal w/ the queue depth issue ... we should expose (expert) control over this, eg make the queue depth "multiplier" a setter/ctor arg/protected member. This way the app that subclasses could also pass in a larger queue depth. > Suggesters: allow to pass a user-defined predicate/filter to the completion searcher > ------------------------------------------------------------------------------------ > > Key: LUCENE-4517 > URL: https://issues.apache.org/jira/browse/LUCENE-4517 > Project: Lucene - Core > Issue Type: New Feature > Reporter: Oliver Christ > Attachments: Lucene-trunk-20121026-AnalyzingSuggester.patch > > > As a user, I'd like to be able to specify a > filter during completion lookup which further determines whether some completion should be considered or not. Assume, for example, that I have a suggestion engine for book titles. In my current search, I'm only interested in computer science books, but I can't/don't want to maintain separate WFSTs for each subject area. > Given some completion candidate, the filter would be called (with a key and/or the completion string as a parameter) to determine whether or not the completion candidate should be added to the result queue. > Note: > Adding a filter/predicate to the AnalyzingSuggester is simple, > as TopNSearcher<> already uses acceptResult() to test whether some completion should be added - that can be overridden in a derived searcher class which simply calls the predicate. Ideally the suggesters would access some kind of factory to instantiate the searcher to be used (instead of hardwiring it in). > *Discussion on java-user:* > Mike McCandless: > Exactly! One gotchya is you have to be careful about the maxQueueDepth, because if your acceptResult accepts too few results then the queue may have pruned away paths that would have led to a valid topN path ... > We may also invert all of these FST based suggests, and expose building blocks for apps to build up custom suggesters. There are many use cases we need to accommodate and we have a ways to converge on a clear API here ... -- 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