Return-Path: X-Original-To: apmail-lucene-java-user-archive@www.apache.org Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 70D1A1002B for ; Tue, 11 Jun 2013 00:21:35 +0000 (UTC) Received: (qmail 72472 invoked by uid 500); 11 Jun 2013 00:21:33 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 72390 invoked by uid 500); 11 Jun 2013 00:21:33 -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 72382 invoked by uid 99); 11 Jun 2013 00:21:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Jun 2013 00:21:33 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of SRS0=1iqy21=P3=basetechnology.com=jack@yourhostingaccount.com designates 65.254.253.118 as permitted sender) Received: from [65.254.253.118] (HELO mailout14.yourhostingaccount.com) (65.254.253.118) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Jun 2013 00:21:28 +0000 Received: from mailscan11.yourhostingaccount.com ([10.1.15.11] helo=mailscan11.yourhostingaccount.com) by mailout14.yourhostingaccount.com with esmtp (Exim) id 1UmCKh-0007Dk-ER for java-user@lucene.apache.org; Mon, 10 Jun 2013 20:21:07 -0400 Received: from impout01.yourhostingaccount.com ([10.1.55.1] helo=impout01.yourhostingaccount.com) by mailscan11.yourhostingaccount.com with esmtp (Exim) id 1UmCKh-0003Rq-9l for java-user@lucene.apache.org; Mon, 10 Jun 2013 20:21:07 -0400 Received: from authsmtp08.yourhostingaccount.com ([10.1.18.8]) by impout01.yourhostingaccount.com with NO UCE id moM71l0020ASqTN01oM7a1; Mon, 10 Jun 2013 20:21:07 -0400 X-Authority-Analysis: v=2.0 cv=EJGEIilC c=1 sm=1 a=UdCbmyego4VUa/xJBgcoFg==:17 a=aQzbgH187woA:10 a=3jZET7lWBKwA:10 a=8nJEP1OIZ-IA:10 a=jvYhGVW7AAAA:8 a=nKR_Wm6o4E4A:10 a=mV9VRH-2AAAA:8 a=RDKU10Rojwiq3iHT5SsA:9 a=wPNLvfGTeEIA:10 a=EMlJoiak7gQA:10 a=88iI8knYSJUA:10 a=8amoANLqcXHyoDJd6jbCBw==:117 X-EN-OrigOutIP: 10.1.18.8 X-EN-IMPSID: moM71l0020ASqTN01oM7a1 Received: from 207-237-114-232.c3-0.nyr-ubr1.nyr.ny.cable.rcn.com ([207.237.114.232] helo=JackKrupansky) by authsmtp08.yourhostingaccount.com with esmtpa (Exim) id 1UmCKg-0002n0-OJ for java-user@lucene.apache.org; Mon, 10 Jun 2013 20:21:06 -0400 Message-ID: From: "Jack Krupansky" To: References: <90C106CDDFCF46CEA65F0E2B06A6927B@JackKrupansky> In-Reply-To: Subject: Re: Lucene Indexes explanantion Date: Mon, 10 Jun 2013 20:20:59 -0400 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 15.4.3555.308 X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3555.308 X-EN-UserInfo: e0a4b55451ed9f27313ebf02e3d4348d:fc4a93e1349e680c52bdd723c0ab3ef6 X-EN-AuthUser: jack@basetechnology.com Sender: "Jack Krupansky" X-EN-OrigIP: 207.237.114.232 X-EN-OrigHost: 207-237-114-232.c3-0.nyr-ubr1.nyr.ny.cable.rcn.com X-Virus-Checked: Checked by ClamAV on apache.org Your stored value could be very different from your indexed (searchable) value. You can also associate payloads with an indexed term. And there are DocValues as well. -- Jack Krupansky -----Original Message----- From: nikhil desai Sent: Monday, June 10, 2013 8:06 PM To: java-user@lucene.apache.org Subject: Re: Lucene Indexes explanantion Sure. Thanks Jack. I don't have much experience working with Lucene, however, here is what I am trying to resolve. I learned that the Custom attributes cannot be used for indexing or searching purposes. However I wanted the attributes to be used for indexing and searching. So I created custom attributes and inserted them as tokens into the tokenstream by assigning positionIncrement attribute to 0. Now since my new token stream has attributes(as tokens) and they are used while indexing, I can now search the document based on the attributes(tokens I newly inserted). However I still have an issue. And by the way I have a lot of attributes that I need to assign to an individual token. Ex: Sentence: "LinkedIn is famous" After passing through custom analyzer and few filters that I have written and appending Attributes to the tokens, the new Tokenstream we get is "LinkedIn Noun SocialSite famous JJ Positive" - (what that means is that LinkedIn is Noun and is also an Socialsite, famous is an adjective and also a Positive word, 'is' is removed as it does not make sense to index 'is') This is now definitely searchable based on Attributes(Here: Noun, SocialSite, JJ, Positive). However, since I have put this entire text "LinkedIn is famous" as a Field while adding a Document, when I search for say "SocialSite", I get a Document as an output which has "LinkedIn is famous" as one of the fields. However, is it possible to get only "LinkedIn" as output rather than an entire text? i.e Only the actual token(the token present in the original input) as output? Another example: if I search for say "Positive" I should get "famous" as output and not the entire "LinkedIn is famous". I know that if I put it as a Field in the document, I should be able to get it, but how do I add such a Field? because, only when the Tokens are passed through the filters we get to know what all Attributes would be attached to it, so while we do indexwriter.addDocument() we have no idea about the Attributes. The typical problem that I see is the indexing is done based on the new tokenstream which is good, but when it retrieves the Document, it has the older actual Tokenstream(or actual input) and that is what is given as output. Does that make any sense? Or I have a typical use case that does not go well with Lucene? Any help comments are appreciated. On Mon, Jun 10, 2013 at 1:32 PM, Jack Krupansky wrote: > Even though you've posted for Lucene, you might want to consider taking a > look at Solr because Solr has an Admin UI with an Analysis page which > gives > you a nice display of how index and query text is analyzed into tokens, > terms, and attributes - all of which Solr inherits from Lucene. > > And check out the unit tests for Lucene (and Solr) for indexing. Then you > can actually step through code and see it happen. > > Otherwise, google for blogs on various sub-topics of interest with > specific terms. > > OTOH... don't try diving too deeply until you've written and understood a > fair amount of Java code using Lucene. Otherwise, you won't have enough > context to understand or even ask intelligent questions. > > -- Jack Krupansky > > -----Original Message----- From: nikhil desai > Sent: Monday, June 10, 2013 1:24 PM > To: java-user@lucene.apache.org > Subject: Lucene Indexes explanantion > > > Hello, > > My first time post in this group. > > I have been using Lucene recently. I have a question. > > Where can I find a good explanation on Indexes. Or rather how indexing > (Not > really the mathematical aspect) happens in Lucene, what all > attributes(charTerm, Offset etc) come into play? And the way it is > implemented? I checked the "Lucene In Action" and could not find much on > actual indexing, what all classes etc are being used. > > Appreciate your help. > > Thanks > NIKHIL > > ------------------------------**------------------------------**--------- > 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