Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 56486 invoked from network); 26 Nov 2010 22:02:16 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 26 Nov 2010 22:02:16 -0000 Received: (qmail 81408 invoked by uid 500); 26 Nov 2010 22:02:10 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 81354 invoked by uid 500); 26 Nov 2010 22:02:10 -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 81346 invoked by uid 99); 26 Nov 2010 22:02:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Nov 2010 22:02:10 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,MIME_QP_LONG_LINE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of aminmc@gmail.com designates 74.125.82.48 as permitted sender) Received: from [74.125.82.48] (HELO mail-ww0-f48.google.com) (74.125.82.48) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Nov 2010 22:02:02 +0000 Received: by wwi17 with SMTP id 17so150837wwi.5 for ; Fri, 26 Nov 2010 14:01:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:references:in-reply-to :mime-version:content-transfer-encoding:content-type:message-id:cc :x-mailer:from:subject:date:to; bh=7zGUkstVsevfvuAufku0v2PT2AAmEBhVtixiMmmGmjw=; b=jl5LSJk4I9/CwQF8ZwZA9p7iorui62Db0WWbYmLsEKu8tWFeWrmOY/5v/hGqS47AUv ViIqxYX3hc2h5x28FOR4Y6IIUWspyps2b6AJkRRs9Z5osIC24kTqdlRs+5oRX8G0wA5T jHfktEZ7aduHXNUPlvmoeeqHvxL7rD0q7lTRw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=references:in-reply-to:mime-version:content-transfer-encoding :content-type:message-id:cc:x-mailer:from:subject:date:to; b=Ii0t8K5+yq8z1JznhynVt2EOKe/i4ZoYkcDBbXKv8JGeh67ou9ODQ/2AAjGLb3e5vE 2bHrKK5YwU5dZj5edKu4LYNL3EX/lyCcdyMRM4Gzz6Z/sE3/yXocnRlbCdzQWzZ5gyxe vkX2Z0Xnuwt64nXHDIjiG+MGzvbNnNto5PyoQ= Received: by 10.216.191.160 with SMTP id g32mr425109wen.18.1290808901272; Fri, 26 Nov 2010 14:01:41 -0800 (PST) Received: from [192.168.1.84] (host86-156-93-172.range86-156.btcentralplus.com [86.156.93.172]) by mx.google.com with ESMTPS id 7sm1152605wet.24.2010.11.26.14.01.39 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 26 Nov 2010 14:01:40 -0800 (PST) References: <50D99037-BFBE-4470-AD0B-40EF661530D9@gmail.com> <13D9053A-26BE-468C-A5CC-2327BC333D4B@gmail.com> In-Reply-To: Mime-Version: 1.0 (iPhone Mail 8B117) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: <53592900-5E33-48E9-A956-F1A74FCF4FBB@gmail.com> Cc: "java-user@lucene.apache.org" X-Mailer: iPhone Mail (8B117) From: Amin Mohammed-Coleman Subject: Re: TermRangeQuery Date: Fri, 26 Nov 2010 22:01:57 +0000 To: "java-user@lucene.apache.org" Essentially I'd like to construct a query which is almost like SQL in clause= . The lucene document contains the id and a string value. I'd like to get t= he string value based on the id key. The ids may range within 1000. Is this= possible to do? Thanks Amin Sent from my iPhone On 26 Nov 2010, at 20:18, Ian Lea wrote: > What sort of ranges are you trying to use? Maybe you could store a > separate field, just for these queries, with some normalized form of > the ids, with all numbers padded out to the same length etc. >=20 > -- > Ian. >=20 > On Fri, Nov 26, 2010 at 4:34 PM, Amin Mohammed-Coleman w= rote: >> Hi >>=20 >> Unfortunately my range query approach did not work. It seems to be rela= ted to the ids themselves. The list has ids that look this: >>=20 >>=20 >> ID-NYC-1234 >> ID-LND-1234 >> TX-NYC-1334 >> TX-NYC-BBC-123 >>=20 >> The ids may range from 90 to 1000. Is there another approach I could tak= e? I tried building a string with all the ids and set them against a field f= or example: >>=20 >> dataId: ID-NYC-123 dataId: ID-NYC-1234.... >>=20 >> but that's not a great approach I know... >>=20 >> any help would be appreciated. >>=20 >> Thanks >> Amin >>=20 >>=20 >>=20 >> On 26 Nov 2010, at 14:39, Ian Lea wrote: >>=20 >>> Absolutely, as long as your ids will sort as you expect. >>>=20 >>> I'm not clear what you mean by XDF-123 but if you've got >>>=20 >>> AAA-123 >>> AAA-124 >>> ... >>> ABC-123 >>> ABC-234 >>> etc. >>>=20 >>> then you'll be fine. If they don't sort so neatly you can use the >>> TermRangeQuery constructor that takes a Collator but note the >>> performance warning in the javadocs. >>>=20 >>>=20 >>> -- >>> Ian. >>>=20 >>>=20 >>> On Fri, Nov 26, 2010 at 2:18 PM, Amin Mohammed-Coleman wrote: >>>> Hi All >>>>=20 >>>> I was wondering whether I can use TermRangeQuery for my use case. I ha= ve a collection of ids (represented as XDF-123) and I would like to do a sea= rch for all the ids (might be in the range of 10000) and for each matching i= d I want to get the corresponding data that is stored in the index (for exam= ple the document contains id and string value). I am using a custom collect= or to collect that string value for each match. Is it ok to use a TermRange= Query for the ids rather than creating a massive query string? >>>>=20 >>>>=20 >>>> Thanks >>>> Amin >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org >>>> For additional commands, e-mail: java-user-help@lucene.apache.org >>>>=20 >>>>=20 >>>=20 >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org >>> For additional commands, e-mail: java-user-help@lucene.apache.org >>>=20 >>=20 >>=20 >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org >> For additional commands, e-mail: java-user-help@lucene.apache.org >>=20 >>=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org