lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Giorgi Jvaridze <giorgi.jvari...@gmail.com>
Subject Tagging and Excluding Filters with date range facets
Date Tue, 05 Mar 2013 14:15:07 GMT
Hi all,

I want to use date range facet and I want to allow user to select several
facet values.
So I added date range facet with 'ex' LocalParam
.addDateRangeFacet("{!ex=motion_date}motion_date", start, end, "+1MONTH")

But when I query it like this
/select?q=target_name%3Ablabla&rows=25&facet=true&facet.mincount=1&facet.limit=10&facet.range=%7B%21ex%3Dmotion_date%7Dmotion_date&f.{!ex=motion_date}motion_date.facet.range.start=2010-02-01T14%3A00%3A13.016Z&f.{!ex=motion_date}motion_date.facet.range.end=2014-02-01T14%3A00%3A13.016Z&f.{!ex=motion_date}motion_date.facet.range.gap=%2B1MONTH&wt=javabin&version=2

solr throws exception

org.apache.solr.client.solrj.SolrServerException: Error executing query
at
org.apache.solr.client.solrj.request.QueryRequest.process(QueryRequest.java:98)
 at org.apache.solr.client.solrj.SolrServer.query(SolrServer.java:301)

Caused by: java.lang.IllegalArgumentException: Illegal character in query
at index 160:
http://solrserver:8983/solr/select?q=target_name%3Ablabla&rows=25&facet=true&facet.mincount=1&facet.limit=10&facet.range=%7B%21ex%3Dmotion_date%7Dmotion_date&f.{!ex=motion_date}motion_date.facet.range.start=2010-02-01T14%3A00%3A13.016Z&f.{!ex=motion_date}motion_date.facet.range.end=2014-02-01T14%3A00%3A13.016Z&f.{!ex=motion_date}motion_date.facet.range.gap=%2B1MONTH&wt=javabin&version=2
 at java.net.URI.create(URI.java:859)
at org.apache.http.client.methods.HttpGet.<init>(HttpGet.java:69)
 at
org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:224)
at
org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:181)
 at
org.apache.solr.client.solrj.request.QueryRequest.process(QueryRequest.java:90)
... 35 more
Caused by: java.net.URISyntaxException: Illegal character in query at index
160:
http://solrserver:8983/solr/select?q=target_name%3Ablabla&rows=25&facet=true&facet.mincount=1&facet.limit=10&facet.range=%7B%21ex%3Dmotion_date%7Dmotion_date&f.{!ex=motion_date}motion_date.facet.range.start=2010-02-01T14%3A00%3A13.016Z&f.{!ex=motion_date}motion_date.facet.range.end=2014-02-01T14%3A00%3A13.016Z&f.{!ex=motion_date}motion_date.facet.range.gap=%2B1MONTH&wt=javabin&version=2
 at java.net.URI$Parser.fail(URI.java:2829)
at java.net.URI$Parser.checkChars(URI.java:3002)
 at java.net.URI$Parser.parseHierarchical(URI.java:3092)
at java.net.URI$Parser.parse(URI.java:3034)
 at java.net.URI.<init>(URI.java:595)
at java.net.URI.create(URI.java:857)
 ... 39 more

I think it's because of addDateRangeFacet method
instead of adding query parameter this
way: f.{!ex=motion_date}motion_date.facet.range.start. it should remove
LocalParam and add to query param like f.motion_date.facet.range.start

Can you confirm this behavior as Bug?

Thanks,
Giorgi

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message