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 Nicholas Swarr <NS...@glgroup.com> on 2012/08/29 17:44:51 UTC

Hierarchical faceting and filter query exclusions

We're using Solr 4.0 Beta, testing the hierarchical faceting support to see if it's a good fit to facet on taxonomies.  One issue we've encountered is that we can't apply filter exclusions to the hierarchical facets so as to preserve facet count with multi-select.  I haven't been able to locate or otherwise determine if there's documentation that would outline how this is done.  We've tried a few things with local params but it appears those aren't parsed with the facet.pivot argument.  I found this ticket related to that:

https://issues.apache.org/jira/browse/SOLR-2255

Could anyone offer some insight or guidance on this?

Thanks,
Nick
This e-mail message, and any attachments, is intended only for the use of the individual or entity identified in the alias address of this message and may contain information that is confidential, privileged and subject to legal restrictions and penalties regarding its unauthorized disclosure and use. Any unauthorized review, copying, disclosure, use or distribution is strictly prohibited. If you have received this e-mail message in error, please notify the sender immediately by reply e-mail and delete this message, and any attachments, from your system. Thank you.



Re: Hierarchical faceting and filter query exclusions

Posted by Nicholas Swarr <NS...@glgroup.com>.
Tanguy, thanks for the confirmation!  We found the same issue with facet.missing parameter as well. 

Sent from my iPad

On Aug 30, 2012, at 10:18 AM, "Tanguy Moal" <ta...@gmail.com> wrote:

> You are correct, it doesn't work :
> 
> Queries like :
> http://localhost:8983/solr/collection1/select?q=*:*&facet=on&facet.pivot={!ex=a_tag}field1,field2&facet.limit=5&rows=0&fq={!tag=a_tag}field3:"filter"
> result in the following response :
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <response>
> <lst name="responseHeader">
>  <int name="status">400</int>
>  <int name="QTime">1</int>
>  <lst name="params">
>   <str name="facet">on</str>
>   <str name="q">*:*</str>
>   <str name="facet.limit">5</str>
>   <str name="facet.pivot">{!ex=a_tag}field1,field2</str>
>   <str name="fq">{!tag=a_tag}field3:"filter"</str>
>   <str name="rows">0</str>
>  </lst>
> </lst>
> <result name="response" numFound="7520" start="0"></result>
> <lst name="error">
>  <str name="msg">undefined field: "{!ex=a_tag}field1"</str>
>  <int name="code">400</int>
> </lst>
> </response>
> 
> Seems like that face.pivot didn't expect the {!ex } local params and died
> horribly (not even fully repeated: the ',field2' part is missing in the
> error message)
> 
> Don't know if that's supposed to be supported.
> 
> I've got another funny one : facet pivoting doesn't work when missing
> values are faceted :
> Queries like :
> http://localhost:8983/solr/collection1/select?q=*:*&facet=on&facet.pivot=field1,field2&facet.limit=5&facet.missing=on&rows=0result
> in the following error :
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <response>
> <lst name="responseHeader">
>  <int name="status">500</int>
>  <int name="QTime">3</int>
>  <lst name="params">
>   <str name="facet.missing">on</str>
>   <str name="facet">on</str>
>   <str name="indent">on</str>
>   <str name="q">*:*</str>
>   <str name="facet.limit">5</str>
>   <str name="facet.pivot">field1,field2</str>
>   <str name="rows">0</str>
>  </lst>
> </lst>
> <result name="response" numFound="190527" start="0"></result>
> <lst name="error">
>  <str name="trace">java.lang.NullPointerException at
> org.apache.solr.schema.FieldType.readableToIndexed(FieldType.java:376) at
> org.apache.solr.handler.component.PivotFacetHelper.doPivots(PivotFacetHelper.java:109)
> at
> org.apache.solr.handler.component.PivotFacetHelper.doPivots(PivotFacetHelper.java:126)
> at
> org.apache.solr.handler.component.PivotFacetHelper.process(PivotFacetHelper.java:85)
> at
> org.apache.solr.handler.component.FacetComponent.process(FacetComponent.java:90)
> at
> org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:206)
> at
> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
> at
> org.apache.solr.core.SolrCore.execute(SolrCore.java:1656) at
> org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:454)
> at
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:275)
> at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331)
> at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:477)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
> at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:521)
> at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
> at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
> at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:965)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
> at
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
> at
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
> at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
> at
> org.eclipse.jetty.server.Server.handle(Server.java:349) at
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:449)
> at
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:910)
> at
> org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634) at
> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230) at
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:76)
> at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
> at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
> at
> java.lang.Thread.run(Thread.java:722)
>  </str>
>  <int name="code">500</int>
> </lst>
> </response>
> 
> Here also, I don't know if that's supposed to be supported, but it
> obviously isn't.
> Worst, it results in an horrible 500 response with a stack instead of a
> clean 400 + message : "sorry, facet.missing can't be turned on with
> facet.pivot. Search again better :)"
> 
> Regards,
> 
> --
> Tanguy
> 
> 2012/8/30 Nicholas Swarr <NS...@glgroup.com>
> 
>> Thanks, Erick. I have looked at the documentation at length and done a
>> number of tests. I don't see a way to do exclusions with hierarchical
>> facets.
>> 
>> Thanks,
>> Nick
>> 
>> 
>> On Aug 29, 2012, at 9:50 PM, "Erick Erickson" <er...@gmail.com>
>> wrote:
>> 
>>> See "Tagging and excluding filters" here:
>>> http://lucidworks.lucidimagination.com/display/solr/Faceting
>>> 
>>> 
>>> Best
>>> Erick
>>> 
>>> 
>>> On Wed, Aug 29, 2012 at 11:44 AM, Nicholas Swarr <NS...@glgroup.com>
>> wrote:
>>>> We're using Solr 4.0 Beta, testing the hierarchical faceting support to
>> see if it's a good fit to facet on taxonomies.  One issue we've encountered
>> is that we can't apply filter exclusions to the hierarchical facets so as
>> to preserve facet count with multi-select.  I haven't been able to locate
>> or otherwise determine if there's documentation that would outline how this
>> is done.  We've tried a few things with local params but it appears those
>> aren't parsed with the facet.pivot argument.  I found this ticket related
>> to that:
>>>> 
>>>> https://issues.apache.org/jira/browse/SOLR-2255
>>>> 
>>>> Could anyone offer some insight or guidance on this?
>>>> 
>>>> Thanks,
>>>> Nick
>>>> This e-mail message, and any attachments, is intended only for the use
>> of the individual or entity identified in the alias address of this message
>> and may contain information that is confidential, privileged and subject to
>> legal restrictions and penalties regarding its unauthorized disclosure and
>> use. Any unauthorized review, copying, disclosure, use or distribution is
>> strictly prohibited. If you have received this e-mail message in error,
>> please notify the sender immediately by reply e-mail and delete this
>> message, and any attachments, from your system. Thank you.
>>>> 
>>>> 
>>> 
>> 
>> This e-mail message, and any attachments, is intended only for the use of
>> the individual or entity identified in the alias address of this message
>> and may contain information that is confidential, privileged and subject to
>> legal restrictions and penalties regarding its unauthorized disclosure and
>> use. Any unauthorized review, copying, disclosure, use or distribution is
>> strictly prohibited. If you have received this e-mail message in error,
>> please notify the sender immediately by reply e-mail and delete this
>> message, and any attachments, from your system. Thank you.
>> 
>> 
>> 

This e-mail message, and any attachments, is intended only for the use of the individual or entity identified in the alias address of this message and may contain information that is confidential, privileged and subject to legal restrictions and penalties regarding its unauthorized disclosure and use. Any unauthorized review, copying, disclosure, use or distribution is strictly prohibited. If you have received this e-mail message in error, please notify the sender immediately by reply e-mail and delete this message, and any attachments, from your system. Thank you.



Re: Hierarchical faceting and filter query exclusions

Posted by Tanguy Moal <ta...@gmail.com>.
You are correct, it doesn't work :

Queries like :
http://localhost:8983/solr/collection1/select?q=*:*&facet=on&facet.pivot={!ex=a_tag}field1,field2&facet.limit=5&rows=0&fq={!tag=a_tag}field3:"filter"
result in the following response :

<?xml version="1.0" encoding="UTF-8"?>
<response>
 <lst name="responseHeader">
  <int name="status">400</int>
  <int name="QTime">1</int>
  <lst name="params">
   <str name="facet">on</str>
   <str name="q">*:*</str>
   <str name="facet.limit">5</str>
   <str name="facet.pivot">{!ex=a_tag}field1,field2</str>
   <str name="fq">{!tag=a_tag}field3:"filter"</str>
   <str name="rows">0</str>
  </lst>
 </lst>
 <result name="response" numFound="7520" start="0"></result>
 <lst name="error">
  <str name="msg">undefined field: "{!ex=a_tag}field1"</str>
  <int name="code">400</int>
 </lst>
</response>

Seems like that face.pivot didn't expect the {!ex } local params and died
horribly (not even fully repeated: the ',field2' part is missing in the
error message)

Don't know if that's supposed to be supported.

I've got another funny one : facet pivoting doesn't work when missing
values are faceted :
Queries like :
http://localhost:8983/solr/collection1/select?q=*:*&facet=on&facet.pivot=field1,field2&facet.limit=5&facet.missing=on&rows=0result
in the following error :

<?xml version="1.0" encoding="UTF-8"?>
<response>
 <lst name="responseHeader">
  <int name="status">500</int>
  <int name="QTime">3</int>
  <lst name="params">
   <str name="facet.missing">on</str>
   <str name="facet">on</str>
   <str name="indent">on</str>
   <str name="q">*:*</str>
   <str name="facet.limit">5</str>
   <str name="facet.pivot">field1,field2</str>
   <str name="rows">0</str>
  </lst>
 </lst>
 <result name="response" numFound="190527" start="0"></result>
 <lst name="error">
  <str name="trace">java.lang.NullPointerException at
org.apache.solr.schema.FieldType.readableToIndexed(FieldType.java:376) at
org.apache.solr.handler.component.PivotFacetHelper.doPivots(PivotFacetHelper.java:109)
at
org.apache.solr.handler.component.PivotFacetHelper.doPivots(PivotFacetHelper.java:126)
at
org.apache.solr.handler.component.PivotFacetHelper.process(PivotFacetHelper.java:85)
at
org.apache.solr.handler.component.FacetComponent.process(FacetComponent.java:90)
at
org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:206)
at
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
at
org.apache.solr.core.SolrCore.execute(SolrCore.java:1656) at
org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:454)
at
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:275)
at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331)
at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:477)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:521)
at
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
at
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
at
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:965)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
at
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
at
org.eclipse.jetty.server.Server.handle(Server.java:349) at
org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:449)
at
org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:910)
at
org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634) at
org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230) at
org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:76)
at
org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
at
org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
at
java.lang.Thread.run(Thread.java:722)
  </str>
  <int name="code">500</int>
 </lst>
</response>

Here also, I don't know if that's supposed to be supported, but it
obviously isn't.
Worst, it results in an horrible 500 response with a stack instead of a
clean 400 + message : "sorry, facet.missing can't be turned on with
facet.pivot. Search again better :)"

Regards,

--
Tanguy

2012/8/30 Nicholas Swarr <NS...@glgroup.com>

> Thanks, Erick. I have looked at the documentation at length and done a
> number of tests. I don't see a way to do exclusions with hierarchical
> facets.
>
> Thanks,
> Nick
>
>
> On Aug 29, 2012, at 9:50 PM, "Erick Erickson" <er...@gmail.com>
> wrote:
>
> > See "Tagging and excluding filters" here:
> > http://lucidworks.lucidimagination.com/display/solr/Faceting
> >
> >
> > Best
> > Erick
> >
> >
> > On Wed, Aug 29, 2012 at 11:44 AM, Nicholas Swarr <NS...@glgroup.com>
> wrote:
> >> We're using Solr 4.0 Beta, testing the hierarchical faceting support to
> see if it's a good fit to facet on taxonomies.  One issue we've encountered
> is that we can't apply filter exclusions to the hierarchical facets so as
> to preserve facet count with multi-select.  I haven't been able to locate
> or otherwise determine if there's documentation that would outline how this
> is done.  We've tried a few things with local params but it appears those
> aren't parsed with the facet.pivot argument.  I found this ticket related
> to that:
> >>
> >> https://issues.apache.org/jira/browse/SOLR-2255
> >>
> >> Could anyone offer some insight or guidance on this?
> >>
> >> Thanks,
> >> Nick
> >> This e-mail message, and any attachments, is intended only for the use
> of the individual or entity identified in the alias address of this message
> and may contain information that is confidential, privileged and subject to
> legal restrictions and penalties regarding its unauthorized disclosure and
> use. Any unauthorized review, copying, disclosure, use or distribution is
> strictly prohibited. If you have received this e-mail message in error,
> please notify the sender immediately by reply e-mail and delete this
> message, and any attachments, from your system. Thank you.
> >>
> >>
> >
>
> This e-mail message, and any attachments, is intended only for the use of
> the individual or entity identified in the alias address of this message
> and may contain information that is confidential, privileged and subject to
> legal restrictions and penalties regarding its unauthorized disclosure and
> use. Any unauthorized review, copying, disclosure, use or distribution is
> strictly prohibited. If you have received this e-mail message in error,
> please notify the sender immediately by reply e-mail and delete this
> message, and any attachments, from your system. Thank you.
>
>
>

Re: Hierarchical faceting and filter query exclusions

Posted by Nicholas Swarr <NS...@glgroup.com>.
Thanks, Erick. I have looked at the documentation at length and done a number of tests. I don't see a way to do exclusions with hierarchical facets.  

Thanks,
Nick


On Aug 29, 2012, at 9:50 PM, "Erick Erickson" <er...@gmail.com> wrote:

> See "Tagging and excluding filters" here:
> http://lucidworks.lucidimagination.com/display/solr/Faceting
> 
> 
> Best
> Erick
> 
> 
> On Wed, Aug 29, 2012 at 11:44 AM, Nicholas Swarr <NS...@glgroup.com> wrote:
>> We're using Solr 4.0 Beta, testing the hierarchical faceting support to see if it's a good fit to facet on taxonomies.  One issue we've encountered is that we can't apply filter exclusions to the hierarchical facets so as to preserve facet count with multi-select.  I haven't been able to locate or otherwise determine if there's documentation that would outline how this is done.  We've tried a few things with local params but it appears those aren't parsed with the facet.pivot argument.  I found this ticket related to that:
>> 
>> https://issues.apache.org/jira/browse/SOLR-2255
>> 
>> Could anyone offer some insight or guidance on this?
>> 
>> Thanks,
>> Nick
>> This e-mail message, and any attachments, is intended only for the use of the individual or entity identified in the alias address of this message and may contain information that is confidential, privileged and subject to legal restrictions and penalties regarding its unauthorized disclosure and use. Any unauthorized review, copying, disclosure, use or distribution is strictly prohibited. If you have received this e-mail message in error, please notify the sender immediately by reply e-mail and delete this message, and any attachments, from your system. Thank you.
>> 
>> 
> 

This e-mail message, and any attachments, is intended only for the use of the individual or entity identified in the alias address of this message and may contain information that is confidential, privileged and subject to legal restrictions and penalties regarding its unauthorized disclosure and use. Any unauthorized review, copying, disclosure, use or distribution is strictly prohibited. If you have received this e-mail message in error, please notify the sender immediately by reply e-mail and delete this message, and any attachments, from your system. Thank you.



Re: Hierarchical faceting and filter query exclusions

Posted by Erick Erickson <er...@gmail.com>.
See "Tagging and excluding filters" here:
http://lucidworks.lucidimagination.com/display/solr/Faceting


Best
Erick


On Wed, Aug 29, 2012 at 11:44 AM, Nicholas Swarr <NS...@glgroup.com> wrote:
> We're using Solr 4.0 Beta, testing the hierarchical faceting support to see if it's a good fit to facet on taxonomies.  One issue we've encountered is that we can't apply filter exclusions to the hierarchical facets so as to preserve facet count with multi-select.  I haven't been able to locate or otherwise determine if there's documentation that would outline how this is done.  We've tried a few things with local params but it appears those aren't parsed with the facet.pivot argument.  I found this ticket related to that:
>
> https://issues.apache.org/jira/browse/SOLR-2255
>
> Could anyone offer some insight or guidance on this?
>
> Thanks,
> Nick
> This e-mail message, and any attachments, is intended only for the use of the individual or entity identified in the alias address of this message and may contain information that is confidential, privileged and subject to legal restrictions and penalties regarding its unauthorized disclosure and use. Any unauthorized review, copying, disclosure, use or distribution is strictly prohibited. If you have received this e-mail message in error, please notify the sender immediately by reply e-mail and delete this message, and any attachments, from your system. Thank you.
>
>