Hi,

Yonik, thank you for explaining me the reason of the issue. The workarounds
you suggested are working fine.
Kranti, your suggestion was also good :-)

Thanks a lot!



On 21 March 2014 20:00, Kranti Parisa <kranti.par...@gmail.com> wrote:

> My example should also work, am I missing something?
>
> &q=({!join from=inner_id to=outer_id fromIndex=othercore
> v=$joinQuery})&joinQuery=(city:"Stara Zagora" AND prod:214)
>
> Thanks,
> Kranti K. Parisa
> http://www.linkedin.com/in/krantiparisa
>
>
>
> On Fri, Mar 21, 2014 at 2:11 PM, Yonik Seeley <yo...@heliosearch.com>
> wrote:
>
> > Correct.  This is only a limitation of embedding a local-params style
> > subquery within lucene syntax.
> > The parser, not knowing the syntax of the embedded query, currently
> > assumes the query text ends at whitespace or other special punctuation
> > such as ")".
> >
> > Original:
> > (({!join from=inner_id to=outer_id fromIndex=othercore}city:"Stara
> > Zagora")) AND (prod:214)
> >
> > Some possible workarounds that should work:
> > &q={!join from=inner_id to=outer_id fromIndex=othercore}city:"Stara
> Zagora"
> > &fq=prod:214
> >
> > &q=({!join from=inner_id to=outer_id fromIndex=othercore
> > v='city:"Stara Zagora"'} AND prod:214)
> >
> > &q=({!join from=inner_id to=outer_id fromIndex=othercore v=$jq} AND
> > prod:214)
> > &jq=city:"Stara Zagora"
> >
> >
> > -Yonik
> > http://heliosearch.org - solve Solr GC pauses with off-heap filters
> > and fieldcache
> >
> >
> > On Fri, Mar 21, 2014 at 1:54 PM, Jack Krupansky <j...@basetechnology.com
> >
> > wrote:
> > > I suspect that this is a bug in the implementation of the parsing of
> > > embedded nested query parsers . That's a fairly new feature compared to
> > > non-embedded nested query parsers - maybe Yonik could shed some light.
> > This
> > > may date from when he made a copy of the Lucene query parser for Solr
> and
> > > added the parsing of embedded nested query parsers to the grammar. It
> > seems
> > > like the embedded nested query parser is only being applied to a
> single,
> > > white space-delimited term, and not respecting the fact that the term
> is
> > a
> > > quoted phrase.
> > >
> > > -- Jack Krupansky
> > >
> > > -----Original Message----- From: Marcin Rzewucki
> > > Sent: Thursday, March 20, 2014 5:19 AM
> > > To: solr-user@lucene.apache.org
> > > Subject: Re: join and filter query with AND
> > >
> > >
> > > Nope. There is no line break in the string and it is not feed from
> file.
> > > What else could be the reason ?
> > >
> > >
> > >
> > > On 19 March 2014 17:57, Erick Erickson <erickerick...@gmail.com>
> wrote:
> > >
> > >> It looks to me like you're feeding this from some
> > >> kind of text file and you really _do_ have a
> > >> line break after "Stara
> > >>
> > >> Or have a line break in the string you paste into the URL
> > >> or something similar.
> > >>
> > >> Kind of shooting in the dark though.
> > >>
> > >> Erick
> > >>
> > >> On Wed, Mar 19, 2014 at 8:48 AM, Marcin Rzewucki <mrzewu...@gmail.com
> >
> > >> wrote:
> > >> > Hi,
> > >> >
> > >> > I have the following issue with join query parser and filter query.
> > For
> > >> > such query:
> > >> >
> > >> > <str name="q">*:*</str>
> > >> > <str name="fq">
> > >> > (({!join from=inner_id to=outer_id fromIndex=othercore}city:"Stara
> > >> > Zagora")) AND (prod:214)
> > >> > </str>
> > >> >
> > >> > I got error:
> > >> > <lst name="error">
> > >> > <str name="msg">
> > >> > org.apache.solr.search.SyntaxError: Cannot parse 'city:"Stara':
> > Lexical
> > >> > error at line 1, column 12. Encountered: <EOF> after : "\"Stara"
> > >> > </str>
> > >> > <int name="code">400</int>
> > >> > </lst>
> > >> >
> > >> > Stack:
> > >> > DEBUG - 2014-03-19 13:35:20.825;
> > >> org.eclipse.jetty.servlet.ServletHandler;
> > >> > chain=SolrRequestFilter->default
> > >> > DEBUG - 2014-03-19 13:35:20.826;
> > >> > org.eclipse.jetty.servlet.ServletHandler$CachedChain; call filter
> > >> > SolrRequestFilter
> > >> > ERROR - 2014-03-19 13:35:20.828;
> org.apache.solr.common.SolrException;
> > >> > org.apache.solr.common.SolrException: >
> > >> > org.apache.solr.search.SyntaxError:
> > >> > Cannot parse 'city:"Stara': Lexical error at line 1, column 12.  E
> > >> > ncountered: <EOF> after : "\"Stara"
> > >> >         at
> > >> >
> > >>
> > >>
> >
> org.apache.solr.handler.component.QueryComponent.prepare(QueryComponent.java:179)
> > >> >         at
> > >> >
> > >>
> > >>
> >
> org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:193)
> > >> >         at
> > >> >
> > >>
> > >>
> >
> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
> > >> >         at org.apache.solr.core.SolrCore.execute(SolrCore.java:1916)
> > >> >         at
> > >> >
> > >>
> > >>
> >
> org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:780)
> > >> >         at
> > >> >
> > >>
> > >>
> >
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:427)
> > >> >         at
> > >> >
> > >>
> > >>
> >
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:217)
> > >> >         at
> > >> >
> > >>
> > >>
> >
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)
> > >> >         at
> > >> >
> > >>
> >
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455)
> > >> >         at
> > >> >
> > >>
> > >>
> >
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
> > >> >         at
> > >> >
> > >>
> > >>
> >
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
> > >> >         at
> > >> >
> > >>
> > >>
> >
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
> > >> >         at
> > >> >
> > >>
> > >>
> >
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)
> > >> >         at
> > >> >
> > >> >
> > org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)
> > >> >         at
> > >> >
> > >>
> > >>
> >
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
> > >> >         at
> > >> >
> > >>
> > >>
> >
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)
> > >> >         at
> > >> >
> > >>
> > >>
> >
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
> > >> >         at
> > >> >
> > >>
> > >>
> >
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
> > >> >         at
> > >> >
> > >>
> > >>
> >
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
> > >> >         at
> > >> >
> > >>
> > >>
> >
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
> > >> >         at org.eclipse.jetty.server.Server.handle(Server.java:364)
> > >> >         at
> > >> >
> > >>
> > >>
> >
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
> > >> >         at
> > >> >
> > >>
> > >>
> >
> org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:53)
> > >> >         at
> > >> >
> > >>
> > >>
> >
> org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:942)
> > >> >         at
> > >> >
> > >>
> > >>
> >
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1004)
> > >> >         at
> > >> org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:640)
> > >> >         at
> > >> >
> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
> > >> >         at
> > >> >
> > >>
> > >>
> >
> org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:72)
> > >> >         at
> > >> >
> > >>
> > >>
> >
> org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:264)
> > >> >         at
> > >> >
> > >>
> > >>
> >
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
> > >> >         at
> > >> >
> > >>
> > >>
> >
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
> > >> >         at java.lang.Thread.run(Thread.java:744)
> > >> > Caused by: org.apache.solr.search.SyntaxError: Cannot parse
> > >> 'city:"Stara':
> > >> > Lexical error at line 1, column 12.  Encountered: <EOF> after : >
> > >> > "\"Stara"
> > >> >         at
> > >> >
> > >>
> > >>
> >
> org.apache.solr.parser.SolrQueryParserBase.parse(SolrQueryParserBase.java:159)
> > >> >         at
> > >> org.apache.solr.search.LuceneQParser.parse(LuceneQParser.java:50)
> > >> >         at org.apache.solr.search.QParser.getQuery(QParser.java:141)
> > >> >         at
> > >> >
> > >>
> > >>
> >
> org.apache.solr.search.JoinQParserPlugin$1.parse(JoinQParserPlugin.java:93)
> > >> >         at org.apache.solr.search.QParser.getQuery(QParser.java:141)
> > >> >         at
> > >> >
> > >>
> > >>
> >
> org.apache.solr.parser.SolrQueryParserBase.getLocalParams(SolrQueryParserBase.java:832)
> > >> >         at
> > >> org.apache.solr.parser.QueryParser.Clause(QueryParser.java:212)
> > >> >         at >
> > >> > org.apache.solr.parser.QueryParser.Query(QueryParser.java:107)
> > >> >         at
> > >> org.apache.solr.parser.QueryParser.Clause(QueryParser.java:189)
> > >> >         at >
> > >> > org.apache.solr.parser.QueryParser.Query(QueryParser.java:139)
> > >> >         at
> > >> org.apache.solr.parser.QueryParser.Clause(QueryParser.java:189)
> > >> >         at >
> > >> > org.apache.solr.parser.QueryParser.Query(QueryParser.java:107)
> > >> >         at
> > >> >
> org.apache.solr.parser.QueryParser.TopLevelQuery(QueryParser.java:96)
> > >> >         at
> > >> >
> > >>
> > >>
> >
> org.apache.solr.parser.SolrQueryParserBase.parse(SolrQueryParserBase.java:152)
> > >> >        at
> > >> org.apache.solr.search.LuceneQParser.parse(LuceneQParser.java:50)
> > >> >         at org.apache.solr.search.QParser.getQuery(QParser.java:141)
> > >> >         at
> > >> >
> > >>
> > >>
> >
> org.apache.solr.handler.component.QueryComponent.prepare(QueryComponent.java:168)
> > >> >         ... 31 more
> > >> > Caused by: org.apache.solr.parser.TokenMgrError: Lexical error at
> > line >
> > >> > 1,
> > >> > column 12.  Encountered: <EOF> after : "\"Stara"
> > >> >         at
> > >> >
> > >>
> > >>
> >
> org.apache.solr.parser.QueryParserTokenManager.getNextToken(QueryParserTokenManager.java:1197)
> > >> >         at
> > >> org.apache.solr.parser.QueryParser.jj_ntk(QueryParser.java:579)
> > >> >         at
> > >> org.apache.solr.parser.QueryParser.Clause(QueryParser.java:174)
> > >> >         at >
> > >> > org.apache.solr.parser.QueryParser.Query(QueryParser.java:107)
> > >> >         at
> > >> >
> org.apache.solr.parser.QueryParser.TopLevelQuery(QueryParser.java:96)
> > >> >         at
> > >> >
> > >>
> > >>
> >
> org.apache.solr.parser.SolrQueryParserBase.parse(SolrQueryParserBase.java:152)
> > >> >         ... 47 more
> > >> >
> > >> > But the below query works fine:
> > >> > <str name="q">*:*</str>
> > >> > <arr name="fq">
> > >> > <str>
> > >> > {!join from=inner_id to=outer_id fromIndex=othercore}city:"Stara
> > Zagora"
> > >> > </str>
> > >> > <str>prod:214</str>
> > >> > </arr>
> > >> >
> > >> > What is wrong ? Is it AND operator ?
> > >> > The only workaround I found is to skip double quotes and use
> question
> > >> mark
> > >> > instead of space:
> > >> > <str name="q">*:*</str>
> > >> > <str name="fq">
> > >> > (({!join from=inner_id to=outer_id
> > >> fromIndex=othercore}city:Stara?Zagora))
> > >> > AND (prod:214)
> > >> > </str>
> > >> >
> > >> > Then it works, but it's not the best solution. Any other ideas ?
> > >> > I kindly appreciate your help. Thanks.
> > >> >
> > >> > Regards.
> > >>
> > >
> >
>

Reply via email to