Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 90753 invoked from network); 15 Sep 2008 01:15:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Sep 2008 01:15:35 -0000 Received: (qmail 11309 invoked by uid 500); 15 Sep 2008 01:15:24 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 11281 invoked by uid 500); 15 Sep 2008 01:15:24 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 11270 invoked by uid 99); 15 Sep 2008 01:15:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 Sep 2008 18:15:24 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of markrmiller@gmail.com designates 209.85.217.13 as permitted sender) Received: from [209.85.217.13] (HELO mail-gx0-f13.google.com) (209.85.217.13) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Sep 2008 01:14:25 +0000 Received: by gxk6 with SMTP id 6so15251618gxk.5 for ; Sun, 14 Sep 2008 18:14:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=pM/nP0ymPQgA3OvFRQ+uhO8qx6Z6X8P/jjmc2a+ECl4=; b=vNm71iQaw/GrXfz9pA0N8KnhAO/l+isOJqm3tjPmNhiZD5rEZa3GWZqzEuCX7XN+Uf /vgD7sdAQ7gJ+7g9j8H3rYU8p6XxtiuQhh7Bx7Z7MOL34kKKLHYjkHIobUzyEx6Vto4O ohV1GS2wU+4QY9RZPmNzvC0V/8ITfLLFQEwp8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=acdhvZ8Ad5pV8xHrNY9WbeHy0nMe3vT5Pr/K8kMS1NoyH5sz0WSy5n8X/cXc9Qm0p9 RYC81CC8/FxW4YMr90yZjlJ2t0ORQfO0rlrTBvBUQ9uG7BzKksgr1hTdoC8YtcDvvsvh +sIWMGocsUFMc6iVNmL3x9QqRoribr3K7cZwI= Received: by 10.90.100.20 with SMTP id x20mr8856927agb.107.1221441296505; Sun, 14 Sep 2008 18:14:56 -0700 (PDT) Received: from ?192.168.1.100? ( [68.198.57.217]) by mx.google.com with ESMTPS id 18sm22158425agb.12.2008.09.14.18.14.55 (version=SSLv3 cipher=RC4-MD5); Sun, 14 Sep 2008 18:14:55 -0700 (PDT) Message-ID: <48CDB70E.3040501@gmail.com> Date: Sun, 14 Sep 2008 21:14:54 -0400 From: Mark Miller User-Agent: Thunderbird 2.0.0.16 (X11/20080725) MIME-Version: 1.0 To: java-user@lucene.apache.org Subject: Re: SpanQuery problem References: <49606.1221440699@ontrenet.com> In-Reply-To: <49606.1221440699@ontrenet.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org This doesn't really make sense - you define a document with the same field multiple times, then say you want to search documents, you but you seem to want the results to be fields from that document you defined? Do you want a search that returns documents or fields? darren@ontrenet.com wrote: > Thanks Paul. I will study your response more, as I don't fully understand it yet - specifically "You'll need to expand the prefix into indexed terms". > > But what I want to do is so simple I'm surprised it cannot be done. > > You are saying that I cannot find all fields across all documents that begin with a string or space bounded word? Consider 1 document with: > > word: blue car > word: red car > word: car door > word: car wheel > > Using whitespace analyzer I simply want to query all fields in all documents > where 'car' is the at the very front of the field. > > word: car door > word: car wheel > > This cannot be done? I don't want to retrieve all of them and prune the results myself because it will consume lots of resources. > > thanks so much! > > Darren > > On Sun Sep 14 16:36 , Paul Elschot sent:Op Sunday 14 September 2008 19:36:38 schreef Darren Govoni: > >> Hi, >> I am seeing odd behavior with SpanNearQuery. >> >> The problem is that with multiple fields, all fields beyond the first >> one 'car' are not seen by the span. I didn't think the span meant to >> sets of the same field, but rather to terms within a given field. >> >> Document 1. 1 field (word) >> >> word: car >> word: cars >> word: cars wash >> word: cars lot >> >> >> SpanNearyQuery with slop of 0. Wrapped by SpanFirstQuery with slop of >> 1. Term query within is "word","cars*". No results found. >> > > There is no SpanPrefixQuery for cars* in Lucene. You'll need to > expand the prefix into indexed terms to create a SpanOrQuery > yourself. This is fairly straightforward from PrefixQuery and > SpanOrQuery. > Alternatively, have a look at the surround query parser in contrib > for a working example. > > Regards, > Paul Elschot > > >> If I remove the first field word: car, it works. Also, if I increase >> the slop, it will return results from only the first amount of fields >> in the slop rather than terms within the field value. >> >> Is what I am seeing the correct behavior? Doesn't seem like it. >> >> What I am trying to do is span _within_ EACH field and match phrases >> that begin with "cars*". Shouldn't be too hard to do I thought. >> >> Darren >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org >> For additional commands, e-mail: java-user-help@lucene.apache.org >> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org