Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 91C66200C1F for ; Sat, 18 Feb 2017 12:33:56 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 903FF160B66; Sat, 18 Feb 2017 11:33:56 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B2B14160B63 for ; Sat, 18 Feb 2017 12:33:55 +0100 (CET) Received: (qmail 74927 invoked by uid 500); 18 Feb 2017 11:33:49 -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 74915 invoked by uid 99); 18 Feb 2017 11:33:49 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 Feb 2017 11:33:49 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id A2FF9183A61 for ; Sat, 18 Feb 2017 11:33:48 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.43 X-Spam-Level: * X-Spam-Status: No, score=1.43 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id RQ5DbMz48VJh for ; Sat, 18 Feb 2017 11:33:46 +0000 (UTC) Received: from mail-qk0-f170.google.com (mail-qk0-f170.google.com [209.85.220.170]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 54C0A5FAF1 for ; Sat, 18 Feb 2017 11:33:45 +0000 (UTC) Received: by mail-qk0-f170.google.com with SMTP id s186so64494418qkb.1 for ; Sat, 18 Feb 2017 03:33:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=zgBbOMc+RicAE1YWUu2BaF6U+hq/F67QbX31VEep24Q=; b=Q7LyqEx3HrnnOgTZBINTvnlK9sagoGEiGrpAaFG6JaUUU0t5+O4oy73AIEtIBLg8Ma TMtMF7308J5UOT5JDtV83w+J7vfeYGryBJs7VuUcfExoz12aFZdST4lqSuw7StPT/CGx YwSzprwNFOo1ehMf4nV9rIRrT5dy6PZ668iUgT790ApqY2HkyB09zgPTU7Zj7/ZTSI4g yqkuaxtUR+pzGOUI+4xOhdKu3NwfUSuhoQx+YI6Z1anOhvvcW5U1kvnUI1bxQsnBVtFw 78ueUBC8GNhuZWUQsixeTL6kCTOrgFdgaLgKpw5KUYhpPhUyq6+0l9zLwNQPe7VJpk2a IK8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=zgBbOMc+RicAE1YWUu2BaF6U+hq/F67QbX31VEep24Q=; b=XhuiZK9GGdbzpueXvIofTvIFaS8+iQPLrNvgJx4+yFDS1WKJs3JWM7Fy5i0DRnwsW+ vFPACM0sUhVpKjmbkNSrhr3bbrQEsC3CBUHI0EglbJMg+Y4Q9274ep+0uNH+xFPoDaqt 0msYbq92z9gd27wQWxVXzIAIW2xRGIWBdxM3UjgkcqiHGZBOZyPW+ezjSgUbpcIG/M2X jhM6qE+lr6iiu7SutzfQvF+awYaJT32VJ+lHGfeMx/dHEmjXD0o1/OXAXpE2/Z33e+Uq qFFlx89PdwurNVuKGf3TyyTggEWr7iA+UrSxiuhdHp2oh5tKk/AS4x4AmTt4jgomzER+ s+RQ== X-Gm-Message-State: AMke39lHT7O/vMb/Abha4fDL1xZwHPWQD+dvt/FPDvwf6qqKmwPtOfZpPPholJ8d5ZHmZ9VniPZSgeJ1lg0UBw== X-Received: by 10.55.128.66 with SMTP id b63mr13370296qkd.297.1487417621619; Sat, 18 Feb 2017 03:33:41 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.142.71 with HTTP; Sat, 18 Feb 2017 03:33:21 -0800 (PST) In-Reply-To: References: From: Chitra R Date: Sat, 18 Feb 2017 17:03:21 +0530 Message-ID: Subject: Re: Numeric Ranges Faceting To: Michael McCandless Cc: Lucene Users Content-Type: multipart/alternative; boundary=94eb2c06654cf82de50548cc664f archived-at: Sat, 18 Feb 2017 11:33:56 -0000 --94eb2c06654cf82de50548cc664f Content-Type: text/plain; charset=UTF-8 Hi, RangeFaceting computation was working fine while adding numeric Ranges in DrillDownQuery. And this is not my issue. My question is, I need to compute string facets (via SortedSetDocValuesFacetCounts) using drill sideways search by adding numeric Ranges in DrillDownQuery... This case only throws an exception. Is it possible?? And I know, Drillsideways search retains previous level facets and its count and it will be achieved by taking dimensions from drilldownQuery. In my case, "price" is the dimension which was indexed as numericDocValuesField and added in drilldownQuery. So only it was throwing an exception when I search through drillsideways search. Am I right or missed anything? Kindly help me to solve my issue. Regards, Chitra On Sat, Feb 18, 2017 at 4:29 PM, Michael McCandless < lucene@mikemccandless.com> wrote: > Hi, > > I think you are close! All you need to do is make a subclass of > DrillSideways and override the buildFacetsResults method to do the > range faceting on your numeric dims. > > I just pushed an improvement to RangeFacetsExample.java showing how to > do this: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/1e4463e3 > > Mike McCandless > > http://blog.mikemccandless.com > > > On Fri, Feb 17, 2017 at 11:15 AM, Chitra R wrote: > > Hey, > > I have indexed "author","module_id" fields as > > SortedSetDocValuesFacetField and "time", "price","salary" fields as > > NumericDocValuesField. > > > > My Category looks like: > > > > *module_id > > -> author > > *price > > > > module_id and price are parent categories. After selecting any one of the > > facets from module_id, sub-category ie "author" field will be shown. > > > > Use-case: > > > > 1. I have received path values from user as "module_id:1" and "price:100 > TO > > 500" and also need to perform drillsideways search. > > > > initializing drilldown query > > > >> DrillDownQuery drillDownQuery = new DrillDownQuery(facetsConfig, > >> userGivenSearchQuery); > >> drillDownQuery.add("module_id","1"); > >> drillDownQuery.add("price",NumericRangeQuery.newDoubleRange("price", > >> 100.0, 200.0, range.minInclusive, range.maxInclusive)); > > > > > > hits and facets computation > > > >> DrillSideways sideways = new DrillSideways(searcher, facetsConfig, > >> docValuesReaderState); > >> DrillSideways.DrillSidewaysResult drillResult = > >> sideways.search(drillDownQuery, booleanFilter, null, 10, sort, > doDocScore, > >> doMaxScore); > >> int totalHits = drillResult.hits.totalHits(); --> it show accurate > total > >> hits documents > >> List facetResult = drillResult.facets.getAllDims(10) --> > this > >> line throws an exception. > > > > > > Exception > > > >> > >> > >> > >> java.lang.IllegalArgumentException: dimension "price" was not indexed > >> > >> at > >> org.apache.lucene.facet.sortedset.SortedSetDocValuesFacetCounts. > getTopChildren(SortedSetDocValuesFacetCounts.java:91) > >> > >> at org.apache.lucene.facet.MultiFacets.getAllDims(MultiFacets.java:74) > > > > > > > > Am I did anything wrong??? > > > > > > Kindly post your suggestions. > > > > Thanks, > > Chitra > > > > > > > > On Fri, Feb 17, 2017 at 9:11 PM, Michael McCandless > > wrote: > >> > >> Hi, how are you instantiating your MultiFacets? You should be passing > >> e.g. a LongRangeFacetCounts instance for your "time" dimension, which > >> should prevent that exception. > >> > >> For DrillSideways, I think you must subclass, and then override > >> buildFacetResult to compute your range facets, because that class > >> assumes it's either indexed facets or sorted set doc values facets. > >> > >> Mike McCandless > >> > >> http://blog.mikemccandless.com > >> > >> > >> On Fri, Feb 17, 2017 at 9:14 AM, Chitra R > wrote: > >> > Any suggestions???? Kindly help me to move forward. > >> > > >> > Regards, > >> > Chitra > >> > > >> > On Wed, Feb 15, 2017 at 9:23 PM, Chitra R > wrote: > >> >> > >> >> Hi, > >> >> Thanks for the suggestion. But in the case of drill > >> >> sideways > >> >> search, retrieving allDimensions (using Facets.getAllDimension()) > threw > >> >> an > >> >> exception which is shown below... > >> >> > >> >> 1. While opening DocValuesReaderState, global ordinals and ordinals > >> >> Range > >> >> map will be computed for '$facets' field only. > >> >> 2. NumericDocValuesField never indexes under '$ facets' so ordinal > >> >> RangeMap will be null for the numeric field ie 'time'. > >> >> > >> >>>> java.lang.IllegalArgumentException: dimension "time" was not > indexed > >> >>>> > >> >>>> at > >> >>>> > >> >>>> org.apache.lucene.facet.sortedset.SortedSetDocValuesFacetCounts. > getTopChildren(SortedSetDocValuesFacetCounts.java:91) > >> >>>> > >> >>>> t org.apache.lucene.facet.MultiFacets.getAllDims( > MultiFacets.java:74) > >> >> > >> >> > >> >> In my use case, > >> >> > >> >> Both string pathTraversed and Numeric PathTraversedRanges will occur. > >> >> And both faceted search and drill sideways search will be used. > >> >> > >> >> So how can I add path-traversed numericRanges? > >> >> > >> >> Am I missed anything? > >> >> > >> >> > >> >> Kindly post your suggestions. > >> >> > >> >> > >> >> Regards, > >> >> Chitra > >> >> > >> >> On Wed, Feb 15, 2017 at 3:28 PM, Michael McCandless > >> >> wrote: > >> >>> > >> >>> Hi, have a look at the RangeFacetsExample.java under the lucene/demo > >> >>> module... it shows how to do this. > >> >>> > >> >>> Mike McCandless > >> >>> > >> >>> http://blog.mikemccandless.com > >> >>> > >> >>> > >> >>> On Tue, Feb 14, 2017 at 12:07 PM, Chitra R > >> >>> wrote: > >> >>> > Hi, > >> >>> > We have planned to implement both string and numeric faceting > >> >>> > using > >> >>> > docvalues field. > >> >>> > > >> >>> > For string faceting, we have added pathtraversed dimensions in > >> >>> > drilldownquery. But for numeric faceting , how and where can we > add > >> >>> > pathtraversed ranges during nextlevel faceted search.? > >> >>> > And which is the better way to add pathtraversed ranges > >> >>> > ( ie adding pathtraversed ranges in numericRangeQuery or > >> >>> > adding pathtraversed ranges in filter).??Or Any other solution.??? > >> >>> > > >> >>> > Thanks & Regards, > >> >>> > Chitra > >> >>> > > >> >>> > > >> >>> > Sent from my iPhone > >> >>> > > >> >>> > ------------------------------------------------------------ > --------- > >> >>> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > >> >>> > For additional commands, e-mail: java-user-help@lucene.apache.org > >> >>> > > >> >> > >> >> > >> > > > > > > --94eb2c06654cf82de50548cc664f--