Return-Path: X-Original-To: apmail-lucene-solr-user-archive@minotaur.apache.org Delivered-To: apmail-lucene-solr-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 47E2D18449 for ; Thu, 24 Mar 2016 20:02:33 +0000 (UTC) Received: (qmail 39153 invoked by uid 500); 24 Mar 2016 20:02:29 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 39070 invoked by uid 500); 24 Mar 2016 20:02:29 -0000 Mailing-List: contact solr-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-user@lucene.apache.org Delivered-To: mailing list solr-user@lucene.apache.org Received: (qmail 38947 invoked by uid 99); 24 Mar 2016 20:02:28 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Mar 2016 20:02:28 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 754A0C021F for ; Thu, 24 Mar 2016 20:02:28 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.179 X-Spam-Level: * X-Spam-Status: No, score=1.179 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, 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] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=griddynamics.com Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id s7MGSBO9FSE6 for ; Thu, 24 Mar 2016 20:02:24 +0000 (UTC) Received: from mail-lf0-f52.google.com (mail-lf0-f52.google.com [209.85.215.52]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTPS id 3C1265F478 for ; Thu, 24 Mar 2016 20:02:24 +0000 (UTC) Received: by mail-lf0-f52.google.com with SMTP id q73so40548194lfe.2 for ; Thu, 24 Mar 2016 13:02:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=griddynamics.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=GbFu5XfGYb4A6wQfdwPdFemwJn20Au48jMlOqqgYp5c=; b=I4NOEB1i3WILcHm6ZS6CQ5kooAKlc8f/DUZW8WpcYur7IDihzqXXkXOEXNEuxSYnD1 3HqpoNSx4YD+7Qf6nY3SbLSkXroo0njT8wdp28iHWRhv/boQa4hzT3q+Fb+pDBS9zLZB mV8YeuuBnlCJnj41wNHRqtkinksSYDRuhzZJI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=GbFu5XfGYb4A6wQfdwPdFemwJn20Au48jMlOqqgYp5c=; b=BPeBDC5AZJtjUx6c+kfLMNgMTCQnxHhl243Fi+t/yqF9G6e0KysCz2glmGjrnHr+UI WlfSJHUAHDSZVoTWLhZnAUPOESBtQrnW5zrXUkR6Jbdt4bBq3wMMwqH49/AskUsBAw/B M8QeCAPdrAAKWE3k33zilcu0AxIVF4XLIOb8fuyJ2nPVylrX9G1Aofq8iw2yRVR84LvH l0arqQn7FGA+qIvMiuigRsIzGKeoPfu+ZI6A58Ch+J230S5zsawpYG6e1HGVN6TRXLoP lBLfA0H2gP1IENIMaSbBgxzPncC30l/d5q1gt8J0h6cM983nCHMUiJXW69XYNGJVIaX6 Z1Gw== X-Gm-Message-State: AD7BkJIU5Hn5Liuyxu171qpLhecVWuUoeAtP5qqaKQvLap4FLKzBKiWkfYLYZWD9uHOj5Um0IscP3jcR6r2/0EU+ X-Received: by 10.25.154.193 with SMTP id c184mr4333172lfe.69.1458849736866; Thu, 24 Mar 2016 13:02:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.114.186.167 with HTTP; Thu, 24 Mar 2016 13:01:37 -0700 (PDT) In-Reply-To: <1331597138.40536302.1458840708127.JavaMail.zimbra@redhat.com> References: <1445888039.39811500.1458762833401.JavaMail.zimbra@redhat.com> <189252143.39821468.1458763767562.JavaMail.zimbra@redhat.com> <1108400994.39850639.1458767763278.JavaMail.zimbra@redhat.com> <659130681.39989122.1458822205883.JavaMail.zimbra@redhat.com> <1331597138.40536302.1458840708127.JavaMail.zimbra@redhat.com> From: Mikhail Khludnev Date: Thu, 24 Mar 2016 23:01:37 +0300 Message-ID: Subject: Re: SyntaxError - Block Join Parent Query To: solr-user Content-Type: multipart/alternative; boundary=001a114022c658d887052ed0ec2e --001a114022c658d887052ed0ec2e Content-Type: text/plain; charset=UTF-8 On Thu, Mar 24, 2016 at 8:31 PM, Charles Sanders wrote: > I tried this on another machine with a clean index. I was able to get the > query to work. Thank you. > > Couple of related questions. > 1) I was able to get this to work on a single shard machine. But I am not > able to get this query to work on Solr with two shards (SorlCloud). Any > reason why this does not work with SolrCloud? > I hardly imagine. Show me your debugQuery=true output. > 2) The query pattern you supplied does not appear in the documentation. Do > you know of any reason why the information in the documentation does not > work and does not mention your pattern? > > https://cwiki.apache.org/confluence/display/solr/Other+Parsers#OtherParsers-BlockJoinQueryParsers Just nobody wrote it there, but anybody can, and somebody wrote at some other places http://blog.griddynamics.com/2013/12/grandchildren-and-siblings-with-block.html?q=block+join https://cwiki.apache.org/confluence/display/solr/Local+Parameters+in+Queries > > > Thanks again. > > > ----- Original Message ----- > > From: "Mikhail Khludnev" > To: "solr-user" > Sent: Thursday, March 24, 2016 11:31:11 AM > Subject: Re: SyntaxError - Block Join Parent Query > > I suggest to add debugQuery=true and fl=*,[child ...] doc transformer. And > come back with response. > > On Thu, Mar 24, 2016 at 3:23 PM, Charles Sanders > wrote: > > > Ah yes. Thank you. Made the correction and I do not get the SyntaxError. > > However, it does not apply the child filter. The query should return only > > TestParent4. But it is returning TestParent2, TestParent3 and > TestParent4. > > All of these meet the parent portion of the query (+blue). But only > > TestParent4 should meet the child portion of the query. > > > > q=+blue +{!parent > > which="documentKind:TestParent"v=$childq}&childq=portal_product:("red > hat") > > > > > > { > > "responseHeader":{ > > "status":0, > > "QTime":15, > > "params":{ > > "indent":"true", > > "q":" blue {!parent which=\"documentKind:TestParent\"v=$childq}", > > "childq":"portal_product:(\"red hat\")", > > "wt":"json"}}, > > "response":{"numFound":2733,"start":0,"maxScore":3.0138793,"docs":[ > > { > > "documentKind":"TestParent", > > "uri":"https://ping/pong/testparent4", > > "view_uri":"https://ping/pong/testparent4", > > "id":"TestParent4", > > "allTitle":"blue", > > "sortTitle":"blue", > > "_version_":1529622873461751808, > > "_root_":["https://ping/pong/testparent4"], > > "timestamp":"2016-03-23T19:40:48.211Z", > > "language":"en"}, > > { > > "documentKind":"TestParent", > > "uri":"https://ping/pong/testparent3", > > "view_uri":"https://ping/pong/testparent3", > > "id":"TestParent3", > > "allTitle":"blue", > > "sortTitle":"blue", > > "_version_":1529622308758487040, > > "_root_":["https://ping/pong/testparent3"], > > "timestamp":"2016-03-23T19:31:49.668Z", > > "language":"en"}, > > { > > "documentKind":"TestParent", > > "uri":"https://ping/pong/testparent2", > > "view_uri":"https://ping/pong/testparent2", > > "id":"TestParent2", > > "allTitle":"blue", > > "sortTitle":"blue", > > "_version_":1529622293809987584, > > "_root_":["https://ping/pong/testparent2"], > > "timestamp":"2016-03-23T19:31:35.408Z", > > "language":"en"} > > > > ----- Original Message ----- > > > > From: "Mikhail Khludnev" > > To: "solr-user" > > Sent: Wednesday, March 23, 2016 5:34:31 PM > > Subject: Re: SyntaxError - Block Join Parent Query > > > > On Thu, Mar 24, 2016 at 12:16 AM, Charles Sanders > > wrote: > > > > > Thanks for the quick reply. But I'm not sure I understand. Did I do > > > something wrong?? > > > > > Absolutely > > 'portal_product"red hat")' > > You omit a colon and opening bracket after a field name, don't you? > > > > > > > > > > > > > > > > /select?q=+blue%20+{!parent%20which=%22documentKind:TestParent%22%20v=$childq}&childq=portal_product%22red%20hat%22) > > > > > > > > > > > > 400 > > > 2 > > > > > > > > > blue {!parent which="documentKind:TestParent" v=$childq} > > > > > > portal_product"red hat") > > > > > > > > > > > > > > > org.apache.solr.search.SyntaxError: Cannot parse 'portal_product"red > > > hat")': Encountered " ")" ") "" at line 1, column 23. Was expecting one > > of: > > > ... ... ... "+" ... "-" ... ... "(" > ... > > > "*" ... "^" ... ... ... ... > ... > > > ... ... "[" ... "{" ... ... > > ... > > > > > > 400 > > > > > > > > > > > > ----- Original Message ----- > > > > > > From: "Mikhail Khludnev" > > > To: "solr-user" > > > Sent: Wednesday, March 23, 2016 5:02:29 PM > > > Subject: Re: SyntaxError - Block Join Parent Query > > > > > > On Wed, Mar 23, 2016 at 11:09 PM, Charles Sanders > > > > wrote: > > > > > > > I'm getting a SyntaxError which I do not understand when I execute a > > > block > > > > join parent query. I'm running Solr5.2.1, with 2 shards. The problem > > > > appears to be in that portion of the query that filters the child > > > document. > > > > Any insight as to where I made the error is greatly appreciated. > > > > > > > > This query produces an error: > > > > q=+blue +{!parent > which="documentKind:TestParent"}portal_product:("red > > > > hat") > > > > -- should return TestParent4 > > > > > > > q=+blue +{!parent which="documentKind:TestParent" > > > v=$childq}&childq=portal_product:("red hat") > > > > > > > > > > However, this query works: > > > > q=+blue +{!parent which="documentKind:TestParent"}portal_product:rhel > > > > -- should return TestParent2 > > > > > > > > Sample data and schema information below: > > > > { > > > > "documentKind": "TestParent", > > > > "uri": "https://ping/pong/testparent1", > > > > "view_uri": "https://ping/pong/testparent1", > > > > "id": "TestParent1", > > > > "allTitle": "gold", > > > > "allText": "gold", > > > > "contents": "gold", > > > > "_childDocuments_": [ > > > > { > > > > "documentKind": "TestChild", > > > > "uri": "testchild1", > > > > "id": "testchild1", > > > > "portal_product_version": "6", > > > > "portal_product": "rhel" > > > > } > > > > ] > > > > } > > > > > > > > { > > > > "documentKind": "TestParent", > > > > "uri": "https://ping/pong/testparent2", > > > > "view_uri": "https://ping/pong/testparent2", > > > > "id": "TestParent2", > > > > "allTitle": "blue", > > > > "allText": "blue", > > > > "contents": "blue", > > > > "_childDocuments_": [ > > > > { > > > > "documentKind": "TestChild", > > > > "uri": "testchild2", > > > > "id": "testchild2", > > > > "portal_product_version": "6", > > > > "portal_product": "rhel" > > > > } > > > > ] > > > > } > > > > > > > > { > > > > "documentKind": "TestParent", > > > > "uri": "https://ping/pong/testparent3", > > > > "view_uri": "https://ping/pong/testparent3", > > > > "id": "TestParent3", > > > > "allTitle": "blue", > > > > "allText": "blue", > > > > "contents": "blue", > > > > "_childDocuments_": [ > > > > { > > > > "documentKind": "TestChild", > > > > "uri": "testchild3", > > > > "id": "testchild3", > > > > "portal_product_version": "3", > > > > "portal_product": "rhev" > > > > } > > > > ] > > > > } > > > > > > > > { > > > > "documentKind": "TestParent", > > > > "uri": "https://ping/pong/testparent4", > > > > "view_uri": "https://ping/pong/testparent4", > > > > "id": "TestParent4", > > > > "allTitle": "blue", > > > > "allText": "blue", > > > > "contents": "blue", > > > > "_childDocuments_": [ > > > > { > > > > "documentKind": "TestChild", > > > > "uri": "testchild4", > > > > "id": "testchild4", > > > > "portal_product_version": "3", > > > > "portal_product": "red hat" > > > > } > > > > ] > > > > } > > > > > > > > > > > required="true" /> > > > > > > > required="true"/> > > > > > > > > > > > > /> > > > > > > > multiValued="true" termVectors="true" /> > > > > > > > multiValued="true" termVectors="true" /> > > > > > > > stored="true"/> > > > > > stored="true"/> > > > > > > > > > > > > > > > > -- > > > Sincerely yours > > > Mikhail Khludnev > > > Principal Engineer, > > > Grid Dynamics > > > > > > > > > > > > > > > > > > > > > -- > > Sincerely yours > > Mikhail Khludnev > > Principal Engineer, > > Grid Dynamics > > > > > > > > > > > > > -- > Sincerely yours > Mikhail Khludnev > Principal Engineer, > Grid Dynamics > > > > > -- Sincerely yours Mikhail Khludnev Principal Engineer, Grid Dynamics --001a114022c658d887052ed0ec2e--