Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

"Unable to range facet" error in HUE

"Unable to range facet" error in HUE

Explorer

We are using Cloudera Search on CDH 5.1. The Hue dashboard that is used for accessing collections is throwing the below error:-

 

Unable to range facet on field:my_field_name{type=string,properties=indexed,stored,omitNorms,omitTermFreqAndPositions,sortMissingLast}

 

The field has string datatype in schema.xml and another field with exact same definition in schema.xml can be range faceted without any issues. We have tried reconfiguring the instansdir, deletedocs and repopulate the collections etc. with no luck.

 

Can you help out.

 

Thanks

10 REPLIES 10

Re: "Unable to range facet" error in HUE

It seems that the error comes at the Solr level.

After getting the error, could you get the Solr query from the /logs page
of Hue and try it on the Solr UI directly?

e.g.

http://127.0.0.1:8983/solr/$COLLECTION_NAME/select?user.name=hue&doAs=romain&q=%2A%3A%2A&wt=json&row...
....

[05/Nov/2014 00:09:18 -0800] connectionpool DEBUG "GET
/solr/log_analytics_demo/select?user.name=hue&doAs=romain&q=%2A%3A%2A&wt=json&rows=40&start=0&facet=true&facet.mincount=0&facet.limit=10&facet.field=%7B%21ex%3Dcountry_code3%7Dcountry_code3&f.country_code3.facet.limit=101&f.country_code3.facet.mincount=1&facet.field=%7B%21ex%3Dextension%7Dextension&f.extension.facet.limit=11&f.extension.facet.mincount=0&facet.field=%7B%21ex%3Dcountry_name%7Dcountry_name&f.country_name.facet.limit=11&f.country_name.facet.minc


Romain

Re: "Unable to range facet" error in HUE

Explorer

Thanks for the reply. Checked this, for some reason Hue is firing off the facet ranges thinking this field is a DATE where as it has clearly been defined in schema.xml as a STRING. And query executed without any issues in SOLR.

 

{"responseHeader":{"status":400,"QTime":2,"params":{"facet":"true","facet.limit":"10","facet.range":["{!ex=year}year","{!ex=chiro_action_type}chiro_action_type"],"f.year.facet.range.end":"2000","f.chiro_action_type.facet.range.gap":"+1YEARS","hl":"true","f.chiro_action_type.facet.mincount":"0","fl":"chiro_action_type,chiro_url,doc_type,matched_name,month_year,year,id","f.year.facet.range.gap":"100","doAs":"admin","f.month_year.facet.mincount":"0","facet.field":"{!ex=month_year}month_year","f.year.facet.range.start":"1000","facet.mincount":"0","f.chiro_action_type.facet.range.start":"1970-01-01T00:00:00Z","f.year.facet.mincount":"0","hl.fl":"*","wt":"json","rows":"10","hl.snippets":"3 HTTP/1.1","start":"0","user.name":"hue","q":"*:*","f.chiro_action_type.facet.range.end":"2050-01-01T01:00:00Z","f.month_year.facet.limit":"11"}},"response":{"numFound":15,"start":0,"docs":[{"id":"http://www.chiro.ca.gov/enforcement/january_2014.pdf_46a9751d0f19d6660185d55591f4866c","matched_name... Hill","chiro_url":"http://www.chiro.ca.gov/enforcement/january_2014.pdf","chiro_action_type":"ACCUSATIONS FILED","doc_type":"alerts_chiro","year":2014,"month_year":"jan-2014"},{"id":"http://www.chiro.ca.gov/enforcement/feb_2014.pdf_c8d8c99448a38243148a72df285ad417","matched_name":"B... Smith","chiro_url":"http://www.chiro.ca.gov/enforcement/feb_2014.pdf","chiro_action_type":"DISCIPLINARY ACTIONS","doc_type":"alerts_chiro","year":2014,"month_year":"feb-2014"},{"id":"http://www.chiro.ca.gov/enforcement/january_2014.pdf_6e067734f61115182f016d6b2deb8578","matched_name... Montgomery","chiro_url":"http://www.chiro.ca.gov/enforcement/january_2014.pdf","chiro_action_type":"ACCUSATIONS FILED","doc_type":"alerts_chiro","year":2014,"month_year":"jan-2014"},{"id":"http://www.chiro.ca.gov/enforcement/march_2014.pdf_7c95c0acc36ab2db6bc8e6207d6aa45a","matched_name":... Amini","chiro_url":"http://www.chiro.ca.gov/enforcement/march_2014.pdf","chiro_action_type":"ACCUSATIONS FILED","doc_type":"alerts_chiro","year":2014,"month_year":"mar-2014"},{"id":"http://www.chiro.ca.gov/enforcement/april_2014.pdf_a6b49f5918781777656fe86ccade4522","matched_name":... Ringer","chiro_url":"http://www.chiro.ca.gov/enforcement/april_2014.pdf","chiro_action_type":"ACCUSATIONS FILED","doc_type":"alerts_chiro","year":2014,"month_year":"apr-2014"},{"id":"http://www.chiro.ca.gov/enforcement/june_2014.pdf_6273c14f168e99fb751964623a92d61a","matched_name":"... Oksenendler","chiro_url":"http://www.chiro.ca.gov/enforcement/june_2014.pdf","chiro_action_type":"PETITION FOR EARLY TERMINATION OF PROBATION","doc_type":"alerts_chiro","year":2014,"month_year":"jun-2014"},{"id":"http://www.chiro.ca.gov/enforcement/july_2014.pdf_a8a4ef86604a367578b62216f2db3fb2","matched_name":"... Morello","chiro_url":"http://www.chiro.ca.gov/enforcement/july_2014.pdf","chiro_action_type":"ACCUSATIONS FILED","doc_type":"alerts_chiro","year":2014,"month_year":"jul-2014"},{"id":"http://www.chiro.ca.gov/enforcement/may_2014.pdf_9bdec2542ee02477e4edf2bf0a1102d7","matched_name":"P... Krynen","chiro_url":"http://www.chiro.ca.gov/enforcement/may_2014.pdf","chiro_action_type":"ACCUSATIONS FILED","doc_type":"alerts_chiro","year":2014,"month_year":"may-2014"},{"id":"http://www.chiro.ca.gov/enforcement/january_2014.pdf_d62dcc94f598f060806fdbef0e5cdb17","matched_name... Jung","chiro_url":"http://www.chiro.ca.gov/enforcement/january_2014.pdf","chiro_action_type":"ACCUSATIONS FILED","doc_type":"alerts_chiro","year":2014,"month_year":"jan-2014"},{"id":"http://www.chiro.ca.gov/enforcement/april_2014.pdf_4d7259cf12fee83010fecef6f7fac7c6","matched_name":... James","chiro_url":"http://www.chiro.ca.gov/enforcement/april_2014.pdf","chiro_action_type":"DISCIPLINARY ACTIONS","doc_type":"alerts_chiro","year":2014,"month_year":"apr-2014"}]},"error":{"msg":"Unable to range facet on field:chiro_action_type{type=string,properties=indexed,stored,omitNorms,omitTermFreqAndPositions,sortMissingLast}","code":400}}

Re: "Unable to range facet" error in HUE

Explorer

Romain,

 

Can you please help out here. for some reason a field that is defined as STRING in my schema is being send for "date" range faceting from HUE. If try to facet from SOLR GUI on the same field it works without any issues.

 

Thanks

Re: "Unable to range facet" error in HUE

Explorer

So here is what I found our digging deeper into the logs:-

 

I tried to facet  (that worked) with a similar string field namely match_year and checked the logs, everything went fine as shown below:-

 

[07/Nov/2014 08:02:04 -0800] connectionpool DEBUG "GET /solr/qa_webcr_chiro/select?user.name=hue&doAs=admin&q=%2A%3A%2A&wt=json&rows=10&start=0&facet=true&facet.mincount=0&facet.limit=10&facet.field=%7B%21ex%3Dyear%7Dyear&f.year.facet.limit=11&f.year.facet.mincount=0&facet.field=%7B%21ex%3Ddoc_type%7Ddoc_type&f.doc_type.facet.limit=11&f.doc_type.facet.mincount=0&facet.field=%7B%21ex%3Dmonth_year%7Dmonth_year&f.month_year.facet.limit=11&f.month_year.facet.mincount=0&fl=chiro_action_type%2Cchiro_url%2Cdoc_type%2Cmatched_name%2Cmonth_year%2Cyear%2Cid&hl=true&hl.fl=%2A&hl.snippets=3 HTTP/1.1" 200 None
[07/Nov/2014 08:02:04 -0800] connectionpool DEBUG Setting read timeout to None
[07/Nov/2014 08:02:04 -0800] connectionpool INFO Starting new HTTP connection (1): zcdh4-c1n1
[07/Nov/2014 08:02:04 -0800] access INFO 10.1.11.168 admin - "POST /search/search HTTP/1.1"
[07/Nov/2014 08:02:04 -0800] resource DEBUG GET Got response: {"responseHeader":{"status":0,"Q...
[07/Nov/2014 08:02:04 -0800] connectionpool DEBUG "GET /solr/qa_webcr_chiro/select?user.name=hue&doAs=admin&q=%2A%3A%2A&wt=json&rows=0&stats=true&stats.field=month_year HTTP/1.1" 200 None

 

When I tried to do the same with the other string field that was erroring out, the below where the logs:-

 

[07/Nov/2014 08:05:43 -0800] connectionpool DEBUG "GET /solr/qa_webcr_chiro/select?user.name=hue&doAs=admin&q=%2A%3A%2A&wt=json&rows=10&start=0&facet=true&facet.mincount=0&facet.limit=10&facet.field=%7B%21ex%3Dmonth_year%7Dmonth_year&f.month_year.facet.limit=6&f.month_year.facet.mincount=0&facet.field=%7B%21ex%3Dyear%7Dyear&f.year.facet.limit=11&f.year.facet.mincount=0&facet.field=%7B%21ex%3Ddoc_type%7Ddoc_type&f.doc_type.facet.limit=11&f.doc_type.facet.mincount=0&facet.range=%7B%21ex%3Dchiro_action_type%7Dchiro_action_type&f.chiro_action_type.facet.range.start=1970-01-01T00%3A00%3A00Z&f.chiro_action_type.facet.range.end=2050-01-01T01%3A00%3A00Z&f.chiro_action_type.facet.range.gap=%2B1YEARS&f.chiro_action_type.facet.mincount=0&fl=chiro_action_type%2Cchiro_url%2Cdoc_type%2Cmatched_name%2Cmonth_year%2Cyear%2Cid&hl=true&hl.fl=%2A&hl.snippets=3 HTTP/1.1" 400 None
[07/Nov/2014 08:05:43 -0800] connectionpool DEBUG Setting read timeout to None
[07/Nov/2014 08:05:43 -0800] connectionpool INFO Starting new HTTP connection (1): zcdh4-c1n1
[07/Nov/2014 08:05:43 -0800] access INFO 10.1.11.168 admin - "POST /search/search HTTP/1.1"

 

[07/Nov/2014 08:05:42 -0800] api ERROR Bad date: time data 'PETITION FOR REINSTATEMENT' does not match format '%Y-%m-%dT%H:%M:%SZ'
[07/Nov/2014 08:05:42 -0800] api ERROR Bad date: time data 'ACCUSATIONS FILED' does not match format '%Y-%m-%dT%H:%M:%SZ'

 

[07/Nov/2014 08:05:42 -0800] resource DEBUG GET Got response: {"responseHeader":{"status":0,"Q...
[07/Nov/2014 08:05:42 -0800] connectionpool DEBUG "GET /solr/qa_webcr_chiro/select?user.name=hue&doAs=admin&q=%2A%3A%2A&wt=json&rows=0&stats=true&stats.field=chiro_action_type HTTP/1.1" 200 None

 

 

For some reason teh API is treating this field as a date (differently) from what is happening with the month_year field whereas the schema.xml has both as string fields as shown below:-

 

<field name="month_year" type="string" indexed="true" stored="true"/>
<field name="chiro_action_type" type="string" indexed="true" stored="true"/>

 

Please advice as soon as you can.

 

Thanks

Highlighted

Re: "Unable to range facet" error in HUE

New Contributor

Hi All,

 

We just ran across this exact problem.  We have two fields indexed as string and one facets just fine in Hue, the other generates this facet range error.

 

We are using the CDH5.1.3 parcel at the moment.  Does anyone know if this has been fixed in the CDH5.2.1 release?  Or is there a workaround that will prevent Hue from issuing the wrong facet query for this field?

 

Thanks!

Re: "Unable to range facet" error in HUE

This is very probably:
https://github.com/cloudera/hue/commit/c1bce4b06eba957f31e50cd19457f5f92c099d85#diff-ea33637c5f647a1...

This one is in C5.2

It makes Hue think that some fields were dates instead of strings.

We also recently slightly improved the regexp to support milliseconds:
https://github.com/cloudera/hue/commit/9afc8dabcfc55070f5386197cb8f90c59347ae0c

This one is in C5.4

Romain

Re: "Unable to range facet" error in HUE

New Contributor

Hello,

 

Any identified workaround to this behavior before 5.2?

On my side it seems randomly reproducible upon collection creation but 100% reproducible on a new dashboard based on a collection that might have this issue.

So a workaroung might be to regenerate collection without 100% garuantee to not reproduce it moreover people do not want to play lotery when generating collections, I guess :)

 

Cheers,

Karim

Re: "Unable to range facet" error in HUE

You can check that the min value of the field you are faceting in does not
contain a 'T' and it will work fine.

The best is still to upgrade :)

Romain

Re: "Unable to range facet" error in HUE

New Contributor

Hi Romain,

 

What do you mean by "min" value for a STRING field type?

Is that whatever the field content is, if there is a "T" in on of the word of the field we are trying to faceting in, the problem will occur?

If my facet contain {"CISCO", "HUAWEI", "ALCATEL", "FORTINET"}, is that supposed to raise the bug?

Because I've got another STRING field type that contain values with T and the facet is doing well {"FORTIGATExxC","SAR77x"....} (and this is not the only STRING field type that supposed to containts "T" but yet works as expected).

 

Regards,

Karim