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 99916104B6 for ; Mon, 10 Feb 2014 15:49:27 +0000 (UTC) Received: (qmail 3274 invoked by uid 500); 10 Feb 2014 15:49:19 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 3186 invoked by uid 500); 10 Feb 2014 15:49:18 -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 3174 invoked by uid 99); 10 Feb 2014 15:49:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Feb 2014 15:49:18 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jebarlin@gmail.com designates 209.85.220.44 as permitted sender) Received: from [209.85.220.44] (HELO mail-pa0-f44.google.com) (209.85.220.44) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Feb 2014 15:49:10 +0000 Received: by mail-pa0-f44.google.com with SMTP id kq14so6337312pab.31 for ; Mon, 10 Feb 2014 07:48:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=lMe+S7zCXoSo4ybrzWZgeMBFjCBIrQfNVhzyy8SbVqk=; b=di4wisogbHFdGTcfnZUt3012FP4WYsv1u0D1hyw9OGcyWgCwqUOgS46egDs7PBere2 fxTeTA3E3y4US1H+Lij4ho4pLn6VW6+NTDuDqG2t37gSH961TE+5mRU0aIGlHoJ9R+Qj IQy51+ALsR3CkRJ8fAKOxBFm/4HfhmYkljT7ohH0s+EdT0dh0t9yHdOn0SzDqABiXApD cSXhGpQ/sLAv/+VlGk/PunTmm/SxcasDXJA5PLurZDcoW1thEnXiQqWYupxr8OjRTvb6 I43EHT/HBiwGQvk7uFrkZygeuhw+DvGun2cYy1ISAkT7WJd8kr/+zawrvYfgtR5dSttf 8hhA== MIME-Version: 1.0 X-Received: by 10.68.178.66 with SMTP id cw2mr37965120pbc.89.1392047328816; Mon, 10 Feb 2014 07:48:48 -0800 (PST) Received: by 10.68.178.3 with HTTP; Mon, 10 Feb 2014 07:48:48 -0800 (PST) In-Reply-To: References: Date: Tue, 11 Feb 2014 00:48:48 +0900 Message-ID: Subject: Re: Regarding DrillDown search From: Jebarlin Robertson To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary=047d7b6da9728b73a704f20f4609 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b6da9728b73a704f20f4609 Content-Type: text/plain; charset=ISO-8859-1 Hi Shai, Yeah exactly the same way I want to display. Then I will do the same way of stored field. It is not about lack of creativity, I might have not explained you in the proper way :) Thank you for all the support :) On Tue, Feb 11, 2014 at 12:23 AM, Shai Erera wrote: > What you want sounds like grouping more like faceting? > > So e.g. if you have an Author field with values A1, A2, A3, and the user > searches for 'love', > then if I understand correctly, you want to display something like: > > Author/A1 > Doc1 > Doc2 > Author/A2 > Doc3 > Doc4 > Author/A3 > Doc5 > Doc6 > > Is that right? > > > Where's today your result page looks like this: > > Facets Results > ------ ----------- > Author Doc1_Title > A1 (4) Doc1_Highlight > A2 (3) ++++ > A3 (1) Doc2_Title > Doc2_Highlight > +++ > ... > > (Forgive my lack of creativity :)). > > If you're not interested in join, and just want to add to each document its > Author facet in the results pane, then I suggest you add another stored > field (only stored, not indexed) with the category value. And then you > could display: > > Facets Results > ------ ----------- > Author Doc1_Title > A1 (4) Doc1_Highlight > A2 (3) Author: A1 > A3 (1) ++++ > Doc2_Title > Doc2_Highlight > Author: A2 > +++ > ... > > Did I understand properly? > > Shai > > On Mon, Feb 10, 2014 at 4:51 PM, Jebarlin Robertson >wrote: > > > Hi Shai, > > > > Thanks for the explanation :) > > > > For my requirement, I just want to display the list of resulted documents > > to the user. > > In Facet search case also, I already have the resulted documents list in > > TopDoc and the FacetResults have only the count of documents contributed > to > > each Catagory, > > > > According to my understanding, > > > > Suppose I query for the word "Love", Now I do Facet Search and gets 4 > > (Files) documents as matched results from TopScoreDocCollector as TopDocs > > and I will get the FacetResult from the FacetCollector. > > And the FacetResultsNode gives me only the values of the category and the > > count of how many documents falls under same category (May be by Author > or > > other provided categories ) among the 4 resulted documents only. > > > > I feel, It will be good if I get the category association with the > resulted > > documents, as I have the document list already from TopScoreDocCollector. > > > > I can do DrillDown Search also by selecting each category, But in my > case I > > just want to display the 4 documents result first and then category wise, > > suppose 2 documents by the same Author etc.... > > > > As per my requirement, I am doing DrillDown Search by asking the user to > > provide such as title of the docment, author of the document, etc... as > > advanced search option. > > > > --- > > Jebarlin Robertson.R > > > > > > > > On Mon, Feb 10, 2014 at 10:30 PM, Shai Erera wrote: > > > > > Ahh I see ... so given a single FacetResultNode, you would like to know > > > which documents contributed to its weight (count in your case). This is > > not > > > available immediately, that's why you need to do a drill-down query. So > > if > > > you return the user a list of categories, when he clicks one of them, > you > > > perform a drill-down query on that category and retrieve all the > > associated > > > documents. > > > > > > May I ask why do you need to know the list of documents given a > > > FacetResultNode? > > > > > > Basically in the 3.6 API it's kind of not so simple to do what you want > > in > > > one-pass, but in the 4.x API (especially the upcoming 4.7) it should be > > > very easy -- when you traverse the list of matching documents, besides > > only > > > reading the list of categories associated with it, you also store a map > > > Category -> List. This isn't very cheap though ... > > > > > > So I guess it would be good if I understand why do you need to know > which > > > documents contributed to which category, before the results are > returned > > to > > > the user. > > > > > > Shai > > > > > > > > > On Mon, Feb 10, 2014 at 3:16 PM, Jebarlin Robertson < > jebarlin@gmail.com > > > >wrote: > > > > > > > Hi Shai, > > > > > > > > Thanks, > > > > > > > > I am using the same way of BooleanQuery only with list of PrefixQuery > > > only. > > > > I think I confused you sorry :) . > > > > > > > > I am using the same above code to get the result of documents. I am > > > getting > > > > the TopDocs and retrieving the Documents also, If I don't even try > that > > > for > > > > the basic you will kill me :D. > > > > But my question was different, from the List of FacetResult I am > > getting > > > > only the counts or no of hits of Document in each category after > > > iterating > > > > the list. > > > > I believe that the getLevel() of FacetNode returns the no of hits or > no > > > of > > > > documents falls into the particular Category. > > > > I need to know which are the documents are falling under the same > > > category > > > > from the FacetResult Object also. > > > > > > > > I hope you will understand my question :) > > > > > > > > Thank you :) > > > > > > > > -- > > > > Jebarlin > > > > > > > > > > > > > > > > On Mon, Feb 10, 2014 at 9:09 PM, Shai Erera > wrote: > > > > > > > > > Hi > > > > > > > > > > You will need to build a BooleanQuery which comprises a list of > > > > > PrefixQuery. The relation between each PrefixQuery should be OR or > > AND, > > > > as > > > > > you see fit (I believe OR?). > > > > > > > > > > In order to get documents' attributes you should execute > > > > searcher.search() > > > > > w/ e.g. MultiCollector which wraps a FacetsCollector and > > > > > TopScoreDocCollector. Then after .search() finished, you should > pull > > > the > > > > > facet results from the FacetsCollector instance and the document > > > results > > > > > from the TopScoreDocCollector instance. Something like (I hope it > > > > compiles > > > > > in 3.6! :)): > > > > > > > > > > TopScoreDocCollector tsdc = TopScoreDocCollector.create(...); > > > > > FacetsCollector fc = FacetsCollector.create(...); > > > > > searcher.search(query, MultiCollector.wrap(tsdc, fc)); > > > > > > > > > > List facetResults = fc.getFacetResults(); > > > > > TopDocs topDocs = tsdc.topDocs(); > > > > > > > > > > Something like that.. > > > > > > > > > > Shai > > > > > > > > > > > > > > > On Mon, Feb 10, 2014 at 1:57 PM, Jebarlin Robertson < > > > jebarlin@gmail.com > > > > > >wrote: > > > > > > > > > > > Dear Shai, > > > > > > > > > > > > Thank you for the quick response :) > > > > > > > > > > > > I have checked with PrefixQuery and term, it is working fine, > But I > > > > > think I > > > > > > cannot pass multiple Category path in it. I am calling the > > > > > > DrillDown.term() method 'N' number of times based on the number > of > > > > > Category > > > > > > Path list. > > > > > > > > > > > > And I have one more question, When I get the FacetResult, I am > > > getting > > > > > only > > > > > > the count of documents matched with the Category Path. > > > > > > Is there anyway to get the Document object also along with the > > count > > > to > > > > > > know the file names For ex. Files (file names -title Field in > > > Document) > > > > > > which have the same Author from the FacetResult. I have read some > > > > > articles > > > > > > for the same from one of your answer I believe. > > > > > > In that you have explained like this "Categories will be listed > to > > > the > > > > > user > > > > > > and when the user clicks the category we have to do DrillDown > > search > > > to > > > > > get > > > > > > further result. > > > > > > I just want to know if we can get the document names as well in > the > > > > first > > > > > > Facet query search itself, when we get the count (no of hits) of > > > > > documents > > > > > > along with the FacetResult. Is there any solution available > already > > > or > > > > > what > > > > > > I can do for that. > > > > > > > > > > > > Kindly Guide me :) > > > > > > > > > > > > Thank you for All your Support. > > > > > > > > > > > > Regards, > > > > > > Jebarlin.R > > > > > > > > > > > > > > > > > > On Mon, Feb 10, 2014 at 1:28 PM, Shai Erera > > > wrote: > > > > > > > > > > > > > Hi > > > > > > > > > > > > > > If you want to drill-down on first name only, then you have > > several > > > > > > > options: > > > > > > > > > > > > > > 1) Index Author/First, Author/Last, Author/First_Last as facets > > on > > > > the > > > > > > > document. This is the faster approach, but bloats the index. > > Also, > > > if > > > > > you > > > > > > > index the author Author/Jebarlin, Author/Robertson and > > > > > > > Author/Jebarlin_Robertson, it still won't allow you to execute > a > > > > query > > > > > > > Author/Jebar. > > > > > > > > > > > > > > 2) You should modify the query to be a PrefixQuery, as if the > > user > > > > > chose > > > > > > to > > > > > > > search Author/Jeral*. You can do that with DrillDown.term() to > > > > create a > > > > > > > Term($facets, Author/Jeral) (NOTE: you shouldn't pass '*' as > part > > > of > > > > > the > > > > > > > CategoryPath) and then construct your own PrefixQuery with that > > > Term. > > > > > > > > > > > > > > Hope that helps, > > > > > > > Shai > > > > > > > > > > > > > > > > > > > > > On Mon, Feb 10, 2014 at 6:21 AM, Jebarlin Robertson < > > > > > jebarlin@gmail.com > > > > > > > >wrote: > > > > > > > > > > > > > > > Dear Shai, > > > > > > > > > > > > > > > > I have one doubt in DrillDown search, when I search with a > > > > > CategoryPath > > > > > > > of > > > > > > > > author, it is giving me the result if I give the accurate > full > > > name > > > > > > only. > > > > > > > > Is there any way to get the result even if I give the first > or > > > last > > > > > > name. > > > > > > > > Can you help me to search like (*contains* the word in Facet > > > > search), > > > > > > if > > > > > > > > the latest API supports or any other APIs. > > > > > > > > > > > > > > > > Thank You > > > > > > > > > > > > > > > > -- > > > > > > > > Thanks & Regards, > > > > > > > > Jebarlin Robertson.R > > > > > > > > GSM: 91-9538106181. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > Thanks & Regards, > > > > > > Jebarlin Robertson.R > > > > > > GSM: 91-9538106181. > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > Thanks & Regards, > > > > Jebarlin Robertson.R > > > > GSM: 91-9538106181. > > > > > > > > > > > > > > > -- > > Thanks & Regards, > > Jebarlin Robertson.R > > GSM: 91-9538106181. > > > -- Thanks & Regards, Jebarlin Robertson.R GSM: 91-9538106181. --047d7b6da9728b73a704f20f4609--