Return-Path: Delivered-To: apmail-lucene-solr-user-archive@minotaur.apache.org Received: (qmail 77684 invoked from network); 19 Jan 2011 15:19:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 19 Jan 2011 15:19:42 -0000 Received: (qmail 86274 invoked by uid 500); 19 Jan 2011 15:19:38 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 85935 invoked by uid 500); 19 Jan 2011 15:19:35 -0000 Mailing-List: contact solr-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-user@lucene.apache.org Delivered-To: mailing list solr-user@lucene.apache.org Received: (qmail 85927 invoked by uid 99); 19 Jan 2011 15:19:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Jan 2011 15:19:34 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jrbrock@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; Wed, 19 Jan 2011 15:19:26 +0000 Received: by fxm2 with SMTP id 2so1021513fxm.35 for ; Wed, 19 Jan 2011 07:19:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=DPFbHm54cOZgXNqlZM+T94vZRgL5Nv0/VAloq0j+ERI=; b=pI1RzdT46ojHsYKbqE3GchSLWKcdisVLSbApPiBBvDKakJm08nvR27s7JRmSxkjr7z Iu0G3CHykB7BJ9aQ+Q5WNsm1GEqivhujr6vla98ldBEWJpc7ni8JpcU6Og+UAvI5MBO9 WxZHP7Zt/bq7rZQdQnGH/eZJj4hhWjCPogAkU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=ft1/c+RkQKCA7vfsAKzXcCcHLo1N99nZEVhzucq0NhQAdFioNyIi9cYtu5XlRCZ037 9ltS80mtGOaSmE4KM7bS1nh2i8IMGEuj+T9cvNVhZzsY2oo+zOPLJqdf99Lw+FKeB+Oc iSvZB2DCcM86em4lIRqBLmHN1fGTGTWtdI/RA= MIME-Version: 1.0 Received: by 10.223.83.8 with SMTP id d8mr804944fal.94.1295450345996; Wed, 19 Jan 2011 07:19:05 -0800 (PST) Received: by 10.223.113.7 with HTTP; Wed, 19 Jan 2011 07:19:05 -0800 (PST) Date: Wed, 19 Jan 2011 10:19:05 -0500 Message-ID: Subject: facet or filter based on user's history From: Jon Brock To: solr-user@lucene.apache.org Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org Hi, I'm looking for ideas on how to make an efficient facet query on a user's history with respect to the catalog of documents (something like "Read document already: yes / no"). The catalog is around 100k titles and there are several thousand users. Of course, each user has a different history, many having read fewer than 500 titles, but some heavy users having read perhaps 50k titles. Performance is not terribly important right now so all I did was bump up the boolean query limit and put together a big string of document id's that the user has read. The first query is slow but once it's in the query cache it's fine. I would like to find a better way of doing it though. What type of solr plugin would be best suited to helping in this situation? I could make a function plugin that provides something like hasHadBefore() - true/false, but would that be efficient for faceting and filtering? Another idea is a QParserPlugin that looks for a field like hasHadBefore:userid and somehow substitutes in the list of docs. But I'm not sure how a new parser plugin would interact with the existing parser. Can solr use a parser plugin to only handle one field, and leave all the other fields to the default parser? Thanks, Jon