Hi Dave, 

Thanks for your suggestion, I was under the impression that you could do it in 
one-search approach. But if that’s not possible I will try to divide into two 
searches. 

Is the best way to do this through Solrj? 

Best regards

Martin


Internal - KMD A/S

-----Original Message-----
From: Dave <hastings.recurs...@gmail.com> 
Sent: 26. februar 2019 05:39
To: solr-user@lucene.apache.org
Subject: Re: MLT and facetting

Use the mlt to get the queries to use for getting facets in a two search 
approach

> On Feb 25, 2019, at 10:18 PM, Zheng Lin Edwin Yeo <edwinye...@gmail.com> 
> wrote:
> 
> Hi Martin,
> 
> I think there are some pictures which are not being sent through in 
> the email.
> 
> Do send your query that you are using, and which version of Solr you 
> are using?
> 
> Regards,
> Edwin
> 
>> On Mon, 25 Feb 2019 at 20:54, Martin Frank Hansen (MHQ) <m...@kmd.dk> wrote:
>> 
>> Hi,
>> 
>> 
>> 
>> I am trying to combine the mlt functionality with facets, but Solr 
>> throws
>> org.apache.solr.common.SolrException: ":"Unable to compute facet 
>> ranges, facet context is not set".
>> 
>> 
>> 
>> What I am trying to do is quite simple, find similar documents using 
>> mlt and group these using the facet parameter. When using mlt and 
>> facets separately everything works fine, but not when combining the 
>> functionality.
>> 
>> 
>> 
>> 
>> 
>> {
>> 
>>  "responseHeader":{
>> 
>>    "status":500,
>> 
>>    "QTime":109},
>> 
>>  "match":{"numFound":1,"start":0,"docs":[
>> 
>>      {
>> 
>>        "Journalnummer":" 00759",
>> 
>>        "id":"6512815"  },
>> 
>>  "response":{"numFound":602234,"start":0,"docs":[
>> 
>>      {
>> 
>>        "Journalnummer":" 00759",
>> 
>>        "id":"6512816",
>> 
>>      {
>> 
>>        "Journalnummer":" 00759",
>> 
>>        "id":"6834653"
>> 
>>      {
>> 
>>        "Journalnummer":" 00739",
>> 
>>        "id":"6202373"
>> 
>>      {
>> 
>>        "Journalnummer":" 00739",
>> 
>>        "id":"6748105"
>> 
>> 
>> 
>>      {
>> 
>>        "Journalnummer":" 00803",
>> 
>>        "id":"7402155"
>> 
>>  },
>> 
>>  "error":{
>> 
>>    "metadata":[
>> 
>>      "error-class","org.apache.solr.common.SolrException",
>> 
>>      "root-error-class","org.apache.solr.common.SolrException"],
>> 
>>    "msg":"Unable to compute facet ranges, facet context is not set",
>> 
>>    "trace":"org.apache.solr.common.SolrException: Unable to compute 
>> facet ranges, facet context is not set\n\tat 
>> org.apache.solr.handler.component.RangeFacetProcessor.getFacetRangeCo
>> unts(RangeFacetProcessor.java:66)\n\tat
>> org.apache.solr.handler.component.FacetComponent.getFacetCounts(Facet
>> Component.java:331)\n\tat 
>> org.apache.solr.handler.component.FacetComponent.getFacetCounts(Facet
>> Component.java:295)\n\tat 
>> org.apache.solr.handler.MoreLikeThisHandler.handleRequestBody(MoreLik
>> eThisHandler.java:240)\n\tat 
>> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandl
>> erBase.java:199)\n\tat 
>> org.apache.solr.core.SolrCore.execute(SolrCore.java:2541)\n\tat
>> org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:709)\n
>> \tat 
>> org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:515)\n\ta
>> t 
>> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilte
>> r.java:377)\n\tat 
>> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilte
>> r.java:323)\n\tat 
>> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(Servlet
>> Handler.java:1634)\n\tat 
>> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java
>> :533)\n\tat 
>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.j
>> ava:146)\n\tat 
>> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.jav
>> a:548)\n\tat 
>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper
>> .java:132)\n\tat 
>> org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandl
>> er.java:257)\n\tat 
>> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandl
>> er.java:1595)\n\tat 
>> org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandl
>> er.java:255)\n\tat 
>> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandl
>> er.java:1317)\n\tat 
>> org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandle
>> r.java:203)\n\tat 
>> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:
>> 473)\n\tat 
>> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandle
>> r.java:1564)\n\tat 
>> org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandle
>> r.java:201)\n\tat 
>> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandle
>> r.java:1219)\n\tat 
>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.j
>> ava:144)\n\tat 
>> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(Cont
>> extHandlerCollection.java:219)\n\tat
>> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerColl
>> ection.java:126)\n\tat 
>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper
>> .java:132)\n\tat 
>> org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandle
>> r.java:335)\n\tat 
>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper
>> .java:132)\n\tat 
>> org.eclipse.jetty.server.Server.handle(Server.java:531)\n\tat
>> org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:352)\n\t
>> at 
>> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.jav
>> a:260)\n\tat 
>> org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(Abstra
>> ctConnection.java:281)\n\tat 
>> org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)\n\t
>> at 
>> org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)\
>> n\tat 
>> org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhat
>> YouKill.java:333)\n\tat 
>> org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWh
>> atYouKill.java:310)\n\tat 
>> org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatW
>> hatYouKill.java:168)\n\tat 
>> org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouK
>> ill.java:126)\n\tat 
>> org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.r
>> un(ReservedThreadExecutor.java:366)\n\tat
>> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPoo
>> l.java:762)\n\tat 
>> org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool
>> .java:680)\n\tat java.lang.Thread.run(Thread.java:748)\n",
>> 
>>    "code":500}}
>> 
>> 
>> 
>> 
>> 
>> In the above example I would like to facet on Journalnummer, thus 
>> grouping several documents based on Journalnummer.
>> 
>> 
>> 
>> Hope someone can help me, and thanks in advance.
>> 
>> 
>> 
>> Best regards
>> 
>> 
>> 
>> Martin
>> 
>> Beskyttelse af dine personlige oplysninger er vigtig for os. Her 
>> finder du KMD’s Privatlivspolitik 
>> <http://www.kmd.dk/Privatlivspolitik>, der fortæller, hvordan vi behandler 
>> oplysninger om dig.
>> 
>> Protection of your personal data is important to us. Here you can 
>> read KMD’s Privacy Policy <http://www.kmd.net/Privacy-Policy> 
>> outlining how we process your personal data.
>> 
>> Vi gør opmærksom på, at denne e-mail kan indeholde fortrolig information.
>> Hvis du ved en fejltagelse modtager e-mailen, beder vi dig venligst 
>> informere afsender om fejlen ved at bruge svarfunktionen. Samtidig 
>> beder vi dig slette e-mailen i dit system uden at videresende eller kopiere 
>> den.
>> Selvom e-mailen og ethvert vedhæftet bilag efter vores overbevisning 
>> er fri for virus og andre fejl, som kan påvirke computeren eller 
>> it-systemet, hvori den modtages og læses, åbnes den på modtagerens 
>> eget ansvar. Vi påtager os ikke noget ansvar for tab og skade, som er 
>> opstået i forbindelse med at modtage og bruge e-mailen.
>> 
>> Please note that this message may contain confidential information. 
>> If you have received this message by mistake, please inform the 
>> sender of the mistake by sending a reply, then delete the message 
>> from your system without making, distributing or retaining any copies 
>> of it. Although we believe that the message and any attachments are 
>> free from viruses and other errors that might affect the computer or 
>> it-system where it is received and read, the recipient opens the message at 
>> his or her own risk.
>> We assume no responsibility for any loss or damage arising from the 
>> receipt or use of this message.
>> 

Reply via email to