Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 91816 invoked from network); 3 Oct 2006 10:20:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 3 Oct 2006 10:20:16 -0000 Received: (qmail 78748 invoked by uid 500); 3 Oct 2006 10:20:11 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 78261 invoked by uid 500); 3 Oct 2006 10:20:09 -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 78206 invoked by uid 99); 3 Oct 2006 10:20:09 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Oct 2006 03:20:09 -0700 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests=MSGID_FROM_MTA_HEADER Received: from [213.165.64.20] ([213.165.64.20:45496] helo=mail.gmx.net) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id 66/EA-29668-D2932254 for ; Tue, 03 Oct 2006 03:19:52 -0700 Message-ID: <66.EA.29668.D2932254@idunn.apache.osuosl.org> Received: (qmail invoked by alias); 03 Oct 2006 10:17:16 -0000 Received: from p508C6955.dip.t-dialin.net (EHLO daywalker2) [80.140.105.85] by mail.gmx.net (mp022) with SMTP; 03 Oct 2006 12:17:16 +0200 X-Authenticated: #8738313 From: "Renzo Scheffer" To: Subject: AW: get terms by positions Date: Tue, 3 Oct 2006 12:14:03 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook, Build 11.0.5510 In-Reply-To: <200610030004.20401.nicolas.lalevee@anyware-tech.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 Thread-Index: AcbmbsyYlcTGpLFdQ823S2G1VhePNwAYuMsQ X-Y-GMX-Trusted: 0 X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I try to get back a list of all left or right neighbours of a = searchterm. Then I will count them to get back the Information, how often a specific word is used as neighbour of the searchterm. I know that the results are variable according to the used Analyzer/Filter. It's just an experiment = and first I'll try to find out if it is possible to do something like that = with Lucene. Renzo -----Urspr=FCngliche Nachricht----- Von: Nicolas Lalev=E9e [mailto:nicolas.lalevee@anyware-tech.com]=20 Gesendet: Dienstag, 3. Oktober 2006 00:04 An: java-user@lucene.apache.org Betreff: Re: get terms by positions Le Lundi 02 Octobre 2006 23:06, Renzo Scheffer a =E9crit=A0: > Hi, > > > > can anybody be so kind to tell me if it is possible to search a Term = by its > position? > > > > I search a term (for excample "soccer") and get back the DocId's and > positions as follows: > > > > > > TermPositions termPos =3D reader.termPositions(new > Term("contents","soccer")); > > while(termPos.next()){ > > int freq =3D termPos.freq(); > > for(int i=3D0; i > > > int docNumber =3D termPos.doc(); > > int position =3D termPos.nextPosition(); > > System.out.println("DocId: "+docNumber+"; Pos:"+position); > > } > > > > > > > > Output: > > > > DocId: 0; Pos: 1 > > DocId: 0; Pos: 4 > > DocId: 0; Pos: 7 > > DocId: 1; Pos: 3 > > DocId: 1; Pos: 7 > > > > Now I try to get back terms, one position before/after "soccer". I > considered to take the > > Position and increase or decrease it. But I can't find a way to get = back a > term, according to the given Position. > > Can anybody help me? > I think this is a non-sense to try to find a term. In Lucene, you search with=20 a term, you are not trying to get some. Basically, in Lucene, you have a list=20 of term pointing on documents, not the reverse. Maybe if you explain why you are trying to do that, we can find a better = way to do it. Nicolas --------------------------------------------------------------------- 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