Note. It seems like it's addressed already
https://issues.apache.org/jira/browse/SOLR-12330
https://gitbox.apache.org/repos/asf?p=lucene-solr.git;a=commitdiff;h=bf69a40#patch2



On Sat, Oct 5, 2019 at 10:43 AM Andrea Gazzarini <a.gazzar...@sease.io>
wrote:

> Hi, problem should be caused by missing surrounding curly brackets.
> That is, your query is
>
> json.facet=prod:{type:terms,field:product,mincount:1,limit:8}
>
> instead it should be
>
> json.facet=*{*prod:{type:terms,field:product,mincount:1,limit:8}*}*
>
> that causes the wrong interpretation of the "json/facet" parameter
> (String instead of Map)
>
> Cheers,
> Andrea
>
> On 04/10/2019 22:55, Mikhail Khludnev wrote:
> > Gosh, obviously. see the clue
> >
> https://github.com/apache/lucene-solr/blob/7d3dcd220f92f25a997cf1559a91b6d9e1b57c6d/solr/core/src/java/org/apache/solr/search/facet/FacetModule.java#L78
> >
> > On Fri, Oct 4, 2019 at 10:47 PM Webster Homer <
> > webster.ho...@milliporesigma.com> wrote:
> >
> >> Sometimes it comes back in the reply
> >> "java.lang.ClassCastException: java.lang.String cannot be cast to
> >> java.util.Map\n\tat
> >>
> org.apache.solr.search.facet.FacetModule.prepare(FacetModule.java:78)\n\tat
> >>
> org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:269)\n\tat
> >>
> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:177)\n\tat
> >> org.apache.solr.core.SolrCore.execute(SolrCore.java:2503)\n\tat
> >>
> org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:710)\n\tat
> >> org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:516)\n\tat
> >>
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:382)\n\tat
> >>
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:326)\n\tat
> >>
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1751)\n\tat
> >>
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582)\n\tat
> >>
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)\n\tat
> >>
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)\n\tat
> >>
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)\n\tat
> >>
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)\n\tat
> >>
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512)\n\tat
> >>
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)\n\tat
> >>
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)\n\tat
> >>
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)\n\tat
> >>
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)\n\tat
> >>
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)\n\tat
> >>
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)\n\tat
> >>
> org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:335)\n\tat
> >>
> org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:169)\n\tat
> >>
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)\n\tat
> >> org.eclipse.jetty.server.Server.handle(Server.java:534)\n\tat
> >> org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)\n\tat
> >>
> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)\n\tat
> >> org.eclipse.jetty.io
> .AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283)\n\tat
> >> org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108)\n\tat
> >> org.eclipse.jetty.io
> .SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)\n\tat
> >>
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)\n\tat
> >>
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)\n\tat
> >>
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)\n\tat
> >>
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)\n\tat
> >>
> org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)\n\tat
> >> java.lang.Thread.run(Thread.java:748)\n",
> >>
> >> -----Original Message-----
> >> From: Mikhail Khludnev <m...@apache.org>
> >> Sent: Friday, October 04, 2019 2:28 PM
> >> To: solr-user <solr-user@lucene.apache.org>
> >> Subject: Re: json.facet throws ClassCastException
> >>
> >> Hello, Webster.
> >>
> >> Have you managed to capture stacktrace?
> >>
> >> On Fri, Oct 4, 2019 at 8:24 PM Webster Homer <
> >> webster.ho...@milliporesigma.com> wrote:
> >>
> >>> I'm trying to understand what is wrong with my query or collection.
> >>>
> >>> I have a functioning solr schema and collection. I'm running Solr 7.2
> >>>
> >>> When I run with a facet.field it works, but if I change it to use a
> >>> json.facet it throws a class cast exception.
> >>>
> >>> json.facet=prod:{type:terms,field:product,mincount:1,limit:8}
> >>>
> >>> java.lang.String cannot be cast to java.util.Map
> >>>
> >>> The product field is defined as
> >>> <field name="product" type="lowercase" indexed="true" stored="true" />
> >>>
> >>> And lowercase is defined as:
> >>> <fieldType name="lowercase" class="solr.TextField"
> >>> positionIncrementGap="100">
> >>>        <analyzer>
> >>>          <tokenizer class="solr.KeywordTokenizerFactory"/>
> >>>          <filter class="solr.LowerCaseFilterFactory" />
> >>>        </analyzer>
> >>>      </fieldType>
> >>>
> >>> I don't have enough information to understand what its complaining
> about.
> >>>
> >>> Thanks
> >>> This message and any attachment are confidential and may be privileged
> >>> or otherwise protected from disclosure. If you are not the intended
> >>> recipient, you must not copy this message or attachment or disclose
> >>> the contents to any other person. If you have received this
> >>> transmission in error, please notify the sender immediately and delete
> >>> the message and any attachment from your system. Merck KGaA,
> >>> Darmstadt, Germany and any of its subsidiaries do not accept liability
> >>> for any omissions or errors in this message which may arise as a
> >>> result of E-Mail-transmission or for damages resulting from any
> >>> unauthorized changes of the content of this message and any attachment
> >>> thereto. Merck KGaA, Darmstadt, Germany and any of its subsidiaries do
> >>> not guarantee that this message is free of viruses and does not accept
> >>> liability for any damages caused by any virus transmitted therewith.
> >>> Click
> >>
> https://clicktime.symantec.com/3PY123Hgama5ijEbuQtFbzf6H2?u=http%3A%2F%2Fwww.merckgroup.com%2Fdisclaimer
> >> to access the German, French, Spanish and Portuguese versions of this
> >> disclaimer.
> >>
> >> --
> >> Sincerely yours
> >> Mikhail Khludnev
> >> This message and any attachment are confidential and may be privileged
> or
> >> otherwise protected from disclosure. If you are not the intended
> recipient,
> >> you must not copy this message or attachment or disclose the contents to
> >> any other person. If you have received this transmission in error,
> please
> >> notify the sender immediately and delete the message and any attachment
> >> from your system. Merck KGaA, Darmstadt, Germany and any of its
> >> subsidiaries do not accept liability for any omissions or errors in this
> >> message which may arise as a result of E-Mail-transmission or for
> damages
> >> resulting from any unauthorized changes of the content of this message
> and
> >> any attachment thereto. Merck KGaA, Darmstadt, Germany and any of its
> >> subsidiaries do not guarantee that this message is free of viruses and
> does
> >> not accept liability for any damages caused by any virus transmitted
> >> therewith. Click http://www.merckgroup.com/disclaimer to access the
> >> German, French, Spanish and Portuguese versions of this disclaimer.
> >>
> >
>
>

-- 
Sincerely yours
Mikhail Khludnev

Reply via email to