You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Xavier Schepler <xa...@sciences-po.fr> on 2011/01/18 10:43:59 UTC

Local param tag voodoo ?

Hey,

here are my needs :

- a query that has tagged and untagged contents
- facets that ignore the tagged contents

I tryed :

q=({!tag=toExclude} ignored)  taken into account
q={tag=toExclude v='ignored'} take into account

Both resulted in a error.

Is this possible or do I have to try another way ?

Re: Local param tag voodoo ?

Posted by Xavier SCHEPLER <xa...@sciences-po.fr>.
You're right the second query didn't result in an error but neither gave the expected result.
I'm gone to have a look at the link you gave me.
Thanks !

> ----------------------------------------
> From: Markus Jelsma <ma...@openindex.io>
> Sent: Tue Jan 18 21:31:52 CET 2011
> To: <so...@lucene.apache.org>
> Subject: Re: Local param tag voodoo ?
> 
> 
> Hi,
> 
> You get an error because LocalParams need to be in the beginning of a 
> parameter's value. So no parenthesis first. The second query should not give an 
> error because it's a valid query.
> 
> Anyway, i assume you're looking for :
> http://wiki.apache.org/solr/SimpleFacetParameters#Multi-
> Select_Faceting_and_LocalParams
> 
> Cheers,
> 
> > Hey,
> > 
> > here are my needs :
> > 
> > - a query that has tagged and untagged contents
> > - facets that ignore the tagged contents
> > 
> > I tryed :
> > 
> > q=({!tag=toExclude} ignored)  taken into account
> > q={tag=toExclude v='ignored'} take into account
> > 
> > Both resulted in a error.
> > 
> > Is this possible or do I have to try another way ?


--------------------------------------------------------------------------
Tous les courriers électroniques émis depuis la messagerie
de Sciences Po doivent respecter des conditions d'usages.
Pour les consulter rendez-vous sur
http://www.ressources-numeriques.sciences-po.fr/confidentialite_courriel.htm

Re: Local param tag voodoo ?

Posted by Yonik Seeley <yo...@lucidimagination.com>.
On Thu, Jan 20, 2011 at 4:59 AM, Xavier SCHEPLER
<xa...@sciences-po.fr> wrote:
> Ok,
> I tryed to use nested queries this way:
> wt=json&indent=true&fl=qFR&q=sarkozy _query_:"{!tag=test}chirac"&facet=true&facet.field={!ex=test}studyDescriptionId
> It resulted in this error:
> "facet_counts":{
>  "facet_queries":{},
>  "exception":"java.lang.NullPointerException\n\tat


There's currently no way to exclude part of a query... the things you
tag must be a top level "q" or "fq" query.

But this has uncovered a bug - we don't handle the case when
everything is excluded (all q and fq).

-Yonik
http://www.lucidimagination.com

Re: Local param tag voodoo ?

Posted by Xavier SCHEPLER <xa...@sciences-po.fr>.
Since it seems to be no voodoo available I did it on the client side.
I send a first request to get the facets and a second to get the documents and their highlighting.
It works well but requires more processing.

> ----------------------------------------
> From: Xavier SCHEPLER <xa...@sciences-po.fr>
> Sent: Thu Jan 20 10:59:40 CET 2011
> To: <so...@lucene.apache.org>
> Subject: Re: Local param tag voodoo ?
> 
> 
> Ok,
> I tryed to use nested queries this way:
> wt=json&indent=true&fl=qFR&q=sarkozy _query_:"{!tag=test}chirac"&facet=true&facet.field={!ex=test}studyDescriptionId
> It resulted in this error:
> "facet_counts":{
>   "facet_queries":{},
>   "exception":"java.lang.NullPointerException\n\tat org.apache.solr.request.SimpleFacets.parseParams(SimpleFacets.java:132)\n\tat org.apache.solr.request.SimpleFacets.getFacetFieldCounts(SimpleFacets.java:278)\n\tat org.apache.solr.request.SimpleFacets.getFacetCounts(SimpleFacets.java:166)\n\tat org.apache.solr.handler.component.FacetComponent.process(FacetComponent.java:72)\n\tat org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:195)\n\tat org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)\n\tat org.apache.solr.core.SolrCore.execute(SolrCore.java:1316)\n\tat org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:338)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:241)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)\n\tat org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)\n\tat org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)\n\tat org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)\n\tat org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)\n\tat org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)\n\tat org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)\n\tat org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)\n\tat org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)\n\tat java.lang.Thread.run(Thread.java:636)\n"}}
> 
> Then I tryed a simpler version:
> q={!tag=test}chirac&facet=true&facet.field={!ex=test}studyDescriptionId
> 
> It resulted in the same error.
> 
> 
> > ----------------------------------------
> > From: Jonathan Rochkind <ro...@jhu.edu>
> > Sent: Wed Jan 19 17:38:53 CET 2011
> > To: solr-user@lucene.apache.org <so...@lucene.apache.org>
> > Subject: Re: Local param tag voodoo ?
> > 
> > 
> > What query are you actually trying to do?  There's probably a way to do 
> > it, possibly using nested queries -- but not using illegal syntax like 
> > some of your examples!  If you explain what you want to do, someone may 
> > be able to tell you how.  From the hints in your last message, I suspect 
> > nested queries _might_ be helpful to you.
> > 
> > On 1/19/2011 3:46 AM, Xavier SCHEPLER wrote:
> > > Ok I was already at this point.
> > > My facetting system use exactly what is described in this page. I read it from the Solr 1.4 book. Otherwise I would'nt ask.
> > > The problem is that the filter queries doesn't affect the relevance score of the results so I want the terms in the main query.
> > >
> > >
> > >> ----------------------------------------
> > >> From: Markus Jelsma<ma...@openindex.io>
> > >> Sent: Tue Jan 18 21:31:52 CET 2011
> > >> To:<so...@lucene.apache.org>
> > >> Subject: Re: Local param tag voodoo ?
> > >>
> > >>
> > >> Hi,
> > >>
> > >> You get an error because LocalParams need to be in the beginning of a
> > >> parameter's value. So no parenthesis first. The second query should not give an
> > >> error because it's a valid query.
> > >>
> > >> Anyway, i assume you're looking for :
> > >> http://wiki.apache.org/solr/SimpleFacetParameters#Multi-
> > >> Select_Faceting_and_LocalParams
> > >>
> > >> Cheers,
> > >>
> > >>> Hey,
> > >>>
> > >>> here are my needs :
> > >>>
> > >>> - a query that has tagged and untagged contents
> > >>> - facets that ignore the tagged contents
> > >>>
> > >>> I tryed :
> > >>>
> > >>> q=({!tag=toExclude} ignored)  taken into account
> > >>> q={tag=toExclude v='ignored'} take into account
> > >>>
> > >>> Both resulted in a error.
> > >>>
> > >>> Is this possible or do I have to try another way ?
> > >
> > > --------------------------------------------------------------------------
> > > Tous les courriers électroniques émis depuis la messagerie
> > > de Sciences Po doivent respecter des conditions d'usages.
> > > Pour les consulter rendez-vous sur
> > > http://www.ressources-numeriques.sciences-po.fr/confidentialite_courriel.htm
> 
> 
> --------------------------------------------------------------------------
> Tous les courriers électroniques émis depuis la messagerie
> de Sciences Po doivent respecter des conditions d'usages.
> Pour les consulter rendez-vous sur
> http://www.ressources-numeriques.sciences-po.fr/confidentialite_courriel.htm


--------------------------------------------------------------------------
Tous les courriers électroniques émis depuis la messagerie
de Sciences Po doivent respecter des conditions d'usages.
Pour les consulter rendez-vous sur
http://www.ressources-numeriques.sciences-po.fr/confidentialite_courriel.htm

Re: Local param tag voodoo ?

Posted by Xavier SCHEPLER <xa...@sciences-po.fr>.
Ok,
I tryed to use nested queries this way:
wt=json&indent=true&fl=qFR&q=sarkozy _query_:"{!tag=test}chirac"&facet=true&facet.field={!ex=test}studyDescriptionId
It resulted in this error:
"facet_counts":{
  "facet_queries":{},
  "exception":"java.lang.NullPointerException\n\tat org.apache.solr.request.SimpleFacets.parseParams(SimpleFacets.java:132)\n\tat org.apache.solr.request.SimpleFacets.getFacetFieldCounts(SimpleFacets.java:278)\n\tat org.apache.solr.request.SimpleFacets.getFacetCounts(SimpleFacets.java:166)\n\tat org.apache.solr.handler.component.FacetComponent.process(FacetComponent.java:72)\n\tat org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:195)\n\tat org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)\n\tat org.apache.solr.core.SolrCore.execute(SolrCore.java:1316)\n\tat org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:338)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:241)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)\n\tat org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)\n\tat org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)\n\tat org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)\n\tat org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)\n\tat org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)\n\tat org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)\n\tat org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)\n\tat org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)\n\tat java.lang.Thread.run(Thread.java:636)\n"}}

Then I tryed a simpler version:
q={!tag=test}chirac&facet=true&facet.field={!ex=test}studyDescriptionId

It resulted in the same error.


> ----------------------------------------
> From: Jonathan Rochkind <ro...@jhu.edu>
> Sent: Wed Jan 19 17:38:53 CET 2011
> To: solr-user@lucene.apache.org <so...@lucene.apache.org>
> Subject: Re: Local param tag voodoo ?
> 
> 
> What query are you actually trying to do?  There's probably a way to do 
> it, possibly using nested queries -- but not using illegal syntax like 
> some of your examples!  If you explain what you want to do, someone may 
> be able to tell you how.  From the hints in your last message, I suspect 
> nested queries _might_ be helpful to you.
> 
> On 1/19/2011 3:46 AM, Xavier SCHEPLER wrote:
> > Ok I was already at this point.
> > My facetting system use exactly what is described in this page. I read it from the Solr 1.4 book. Otherwise I would'nt ask.
> > The problem is that the filter queries doesn't affect the relevance score of the results so I want the terms in the main query.
> >
> >
> >> ----------------------------------------
> >> From: Markus Jelsma<ma...@openindex.io>
> >> Sent: Tue Jan 18 21:31:52 CET 2011
> >> To:<so...@lucene.apache.org>
> >> Subject: Re: Local param tag voodoo ?
> >>
> >>
> >> Hi,
> >>
> >> You get an error because LocalParams need to be in the beginning of a
> >> parameter's value. So no parenthesis first. The second query should not give an
> >> error because it's a valid query.
> >>
> >> Anyway, i assume you're looking for :
> >> http://wiki.apache.org/solr/SimpleFacetParameters#Multi-
> >> Select_Faceting_and_LocalParams
> >>
> >> Cheers,
> >>
> >>> Hey,
> >>>
> >>> here are my needs :
> >>>
> >>> - a query that has tagged and untagged contents
> >>> - facets that ignore the tagged contents
> >>>
> >>> I tryed :
> >>>
> >>> q=({!tag=toExclude} ignored)  taken into account
> >>> q={tag=toExclude v='ignored'} take into account
> >>>
> >>> Both resulted in a error.
> >>>
> >>> Is this possible or do I have to try another way ?
> >
> > --------------------------------------------------------------------------
> > Tous les courriers électroniques émis depuis la messagerie
> > de Sciences Po doivent respecter des conditions d'usages.
> > Pour les consulter rendez-vous sur
> > http://www.ressources-numeriques.sciences-po.fr/confidentialite_courriel.htm


--------------------------------------------------------------------------
Tous les courriers électroniques émis depuis la messagerie
de Sciences Po doivent respecter des conditions d'usages.
Pour les consulter rendez-vous sur
http://www.ressources-numeriques.sciences-po.fr/confidentialite_courriel.htm

Re: Local param tag voodoo ?

Posted by Jonathan Rochkind <ro...@jhu.edu>.
What query are you actually trying to do?  There's probably a way to do 
it, possibly using nested queries -- but not using illegal syntax like 
some of your examples!  If you explain what you want to do, someone may 
be able to tell you how.  From the hints in your last message, I suspect 
nested queries _might_ be helpful to you.

On 1/19/2011 3:46 AM, Xavier SCHEPLER wrote:
> Ok I was already at this point.
> My facetting system use exactly what is described in this page. I read it from the Solr 1.4 book. Otherwise I would'nt ask.
> The problem is that the filter queries doesn't affect the relevance score of the results so I want the terms in the main query.
>
>
>> ----------------------------------------
>> From: Markus Jelsma<ma...@openindex.io>
>> Sent: Tue Jan 18 21:31:52 CET 2011
>> To:<so...@lucene.apache.org>
>> Subject: Re: Local param tag voodoo ?
>>
>>
>> Hi,
>>
>> You get an error because LocalParams need to be in the beginning of a
>> parameter's value. So no parenthesis first. The second query should not give an
>> error because it's a valid query.
>>
>> Anyway, i assume you're looking for :
>> http://wiki.apache.org/solr/SimpleFacetParameters#Multi-
>> Select_Faceting_and_LocalParams
>>
>> Cheers,
>>
>>> Hey,
>>>
>>> here are my needs :
>>>
>>> - a query that has tagged and untagged contents
>>> - facets that ignore the tagged contents
>>>
>>> I tryed :
>>>
>>> q=({!tag=toExclude} ignored)  taken into account
>>> q={tag=toExclude v='ignored'} take into account
>>>
>>> Both resulted in a error.
>>>
>>> Is this possible or do I have to try another way ?
>
> --------------------------------------------------------------------------
> Tous les courriers électroniques émis depuis la messagerie
> de Sciences Po doivent respecter des conditions d'usages.
> Pour les consulter rendez-vous sur
> http://www.ressources-numeriques.sciences-po.fr/confidentialite_courriel.htm

Re: Local param tag voodoo ?

Posted by Xavier SCHEPLER <xa...@sciences-po.fr>.
Ok I was already at this point.
My facetting system use exactly what is described in this page. I read it from the Solr 1.4 book. Otherwise I would'nt ask.
The problem is that the filter queries doesn't affect the relevance score of the results so I want the terms in the main query.


> ----------------------------------------
> From: Markus Jelsma <ma...@openindex.io>
> Sent: Tue Jan 18 21:31:52 CET 2011
> To: <so...@lucene.apache.org>
> Subject: Re: Local param tag voodoo ?
> 
> 
> Hi,
> 
> You get an error because LocalParams need to be in the beginning of a 
> parameter's value. So no parenthesis first. The second query should not give an 
> error because it's a valid query.
> 
> Anyway, i assume you're looking for :
> http://wiki.apache.org/solr/SimpleFacetParameters#Multi-
> Select_Faceting_and_LocalParams
> 
> Cheers,
> 
> > Hey,
> > 
> > here are my needs :
> > 
> > - a query that has tagged and untagged contents
> > - facets that ignore the tagged contents
> > 
> > I tryed :
> > 
> > q=({!tag=toExclude} ignored)  taken into account
> > q={tag=toExclude v='ignored'} take into account
> > 
> > Both resulted in a error.
> > 
> > Is this possible or do I have to try another way ?


--------------------------------------------------------------------------
Tous les courriers électroniques émis depuis la messagerie
de Sciences Po doivent respecter des conditions d'usages.
Pour les consulter rendez-vous sur
http://www.ressources-numeriques.sciences-po.fr/confidentialite_courriel.htm

Re: Local param tag voodoo ?

Posted by Markus Jelsma <ma...@openindex.io>.
Hi,

You get an error because LocalParams need to be in the beginning of a 
parameter's value. So no parenthesis first. The second query should not give an 
error because it's a valid query.

Anyway, i assume you're looking for :
http://wiki.apache.org/solr/SimpleFacetParameters#Multi-
Select_Faceting_and_LocalParams

Cheers,

> Hey,
> 
> here are my needs :
> 
> - a query that has tagged and untagged contents
> - facets that ignore the tagged contents
> 
> I tryed :
> 
> q=({!tag=toExclude} ignored)  taken into account
> q={tag=toExclude v='ignored'} take into account
> 
> Both resulted in a error.
> 
> Is this possible or do I have to try another way ?