Return-Path: Delivered-To: apmail-lucene-solr-user-archive@locus.apache.org Received: (qmail 65248 invoked from network); 27 Apr 2008 22:59:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Apr 2008 22:59:54 -0000 Received: (qmail 32026 invoked by uid 500); 27 Apr 2008 22:59:53 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 31994 invoked by uid 500); 27 Apr 2008 22:59:53 -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 31983 invoked by uid 99); 27 Apr 2008 22:59:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 27 Apr 2008 15:59:53 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [208.69.42.181] (HELO radix.cryptio.net) (208.69.42.181) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 27 Apr 2008 22:59:01 +0000 Received: by radix.cryptio.net (Postfix, from userid 1007) id C2C5671C2A0; Sun, 27 Apr 2008 15:59:21 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by radix.cryptio.net (Postfix) with ESMTP id BF8A771C0B0 for ; Sun, 27 Apr 2008 15:59:21 -0700 (PDT) Date: Sun, 27 Apr 2008 15:59:21 -0700 (PDT) From: Chris Hostetter To: solr-user@lucene.apache.org Subject: Re: Enhancing the query language In-Reply-To: <16824860.post@talk.nabble.com> Message-ID: References: <16824860.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Checked: Checked by ClamAV on apache.org : currently the solr query language is not enough for our needs. : I understand it is possible to add our own customized query parse to the : system, but I was wondering if anybody have done that and if there is any : idea to share how and from where to start. In Solr 1.2, you'd need to write your own custom RequestHandler and put whatever parsing logic you want in it (but you'd need to cut/paste everything else from one of the existing RequestHandlers to do anything useful once you parse the query. With the solr trunk, you can just write a QParserPlugin and configure it in solrconfig.xml. QParserPlugin isn't very well documented yet, but if you start by looking at the LuceneQParserPlugin as an example. As for the type of query you are describing... : paragraphs proximity i.e. (termsgroup1) near/n (termgroup2) termsgroup1 : n paragraph apart from termgroup2 : finding terms for number of times i.e. atleast/n abcd in text abcd : should show up atleast n times ...near/n can be implemented using Lucene's SpanNearQuery (where your termgroups are just SpanOrQueries). atleast/n should be doable using SpanNotQuery, which makes sure that two span queries don't "overlap" .. so if you make n SpanTermQuery objects for abcd, you can nest them all in a big chain of SpanNotQueries. (allthough there's probably a much more efficient way to accomplish the same thing if you wrote your own custom subclass of TermQuery and made it only match if the term freq is greater then n) -Hoss