Hi. Thanks for the great module. There is one problem. When choosing a type of "Slide" in the settings display widget I get an error

The widget does not support the term query type

Used by sorting on the field created by the module date 7.x-2.0-alpha4.
I use Facet API 7.x-1.0-beta8 & Apache Solr 7.x-1.0-beta11
I would be grateful for the help

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cpliakas’s picture

Category: bug » feature

This is by design, so changing to a feature request.

ohthehugemanatee’s picture

Status: Active » Closed (duplicate)

Actually, this isn't by design. It's a bug in FacetAPI, reported (with a patch offered) here. Basically the issue is that any widget that doesn't accept "term" throws this error mistakenly. Closing this ticket as a duplicate of http://drupal.org/node/1443340 .

cpliakas’s picture

ohthehugemanatee,

Thanks for the clarification and the cross-post.

Chris

julien’s picture

I'm also trying to make work this module, but it doesn't seem to work properly due to this facetapi bug which doesn't seem to be fixed at the moment.
I'm trying to set this widget on one field. but it keep saying :

The widget does not support the term query type

I also tried to add "term" to

        'query types' => array('numeric_range', 'term'),

in the facetapi_slider.module, the message disappear but the widget doesn't show up at all.
To me, this module doesn't work yet.

Sagar Ramgade’s picture

Hi,

I am also facing the same issue, I am using apachesolr 7.x-1.0-rc4 and facetapi 7.x-1.2. I also tried adding term in query types however if didn't work. Any update on this ?

cappadona’s picture

I'm also still running into this error with facetapi-7.x-1.2 and facetapi_slider-7.x-1.x-dev.

stone_d’s picture

I still got the same issue - any updates on this? :/

pinkonomy’s picture

Me to,when using Date facets and search api.

charlie charles’s picture

Issue summary: View changes

Any updates on this?

legolasbo’s picture

Status: Closed (duplicate) » Needs review
FileSize
2.97 KB

Marked #2296385: The widget does not support the term query type as a duplicate.

I've attached a patch which should fix this problem.

legolasbo’s picture

legolasbo’s picture

updated patch because it was relative to the wrong directory.

ShaneOnABike’s picture

I just tested this and it goes a little hairy carey with my decimal field... I think at the very least if there are missing ranges we need to set it to zero so we aren't getting loads of errors

Notice: Undefined index: #range_min in FacetapiWidgetSlider->execute() (line 86 of modules/patch/facetapi_slider/plugins/facetapi/widget_slider.inc).
Notice: Undefined index: #range_max in FacetapiWidgetSlider->execute() (line 87 of /modules/patch/facetapi_slider/plugins/facetapi/widget_slider.inc).
Notice: Undefined index: #global_range_min in FacetapiWidgetSlider->execute() (line 88 of /modules/patch/facetapi_slider/plugins/facetapi/widget_slider.inc).
Notice: Undefined index: #global_range_max in FacetapiWidgetSlider->execute() (line 89 of /modules/patch/facetapi_slider/plugins/facetapi/widget_slider.inc).
ShaneOnABike’s picture

Also I think we are better off checking field info based on the value type since it allows for more flexibility

     if($field_info['columns']['value']['type'] == 'int' ||
        $field_info['columns']['value']['type'] == 'numeric') {

I gave up though cause I everytime I used the slider it kept reseting back to the original value :/ and doesn't jive nice with pretty facetapi paths

3119999’s picture

For me patch #11 works perfect. Great work, thanks a lot!

basvredeling’s picture

#12 works (patchname refers to #11 btw). but I agree with ShaneOnABike that type switching would be more elegant.

devad’s picture

@ShaneOnABike #13, #14

I have exactly the same errors as #13 if I apply Slider display widget to aggregated field (minimum compare of two numeric fields).

If I apply Slider display widget to any numeric field directly patch #11 works nicely.

I have no idea how to solve this problem so that I can have Slider display widget at aggregated field.

     if($field_info['columns']['value']['type'] == 'int' ||
        $field_info['columns']['value']['type'] == 'numeric') {

Is this code a solution for me maybe? If yes, where should I insert this if statement? At what line in the patch/file?

Any help is appreciated. Thnx all.

legolasbo’s picture

@devad,

Currently the patch retreives the available min/max values from the database, not from solr. It should actually query solr for the min/max values.

devad’s picture

@legolasbo #18

I am using Facetapi Slider module with Search API Database Search as explained here, and it works nicely... except for aggregated fields.

And, yes... by the way... Apachesolr Search is listed at the top of project page as installation requirement, although it is not required by .info file.

Minimum requirement

Facetapi
Apachesolr Search

legolasbo’s picture

@devad,

I'm sorry, I meant to say Search API, not solr.

devad’s picture

@ShaneOnABike #14

I gave up though cause I everytime I used the slider it kept reseting back to the original value :/ and doesn't jive nice with pretty facetapi paths

Turning on FacetAPI Pretty Paths breaks slider in my case as well. It keeps resetting back to original values and it filters nothing.

Facet Slider (facetapi_slider) 7.x-1.0+0-dev
Facet API Pretty Paths (facetapi_pretty_paths) 7.x-1.4

drclaw’s picture

The patch in comment #12 works for me, however it includes come extra code that helps preserve the global min/max values on the slider range. This is a great addition to the module, but is a little out of scope of the original issue. I've separated that bit out and created a separate issue for it #2539390: Preserve Full Min/Max values for slider after filtering and re-rolled the patch for this task.

basvredeling’s picture

Status: Needs review » Reviewed & tested by the community

Patch from #22 is a no-brainer. Is small, works as prescribed. And should be committed promptly.

Will have a look at now #2539390: Preserve Full Min/Max values for slider after filtering. Splitting the issue up seems sensible.

GuyManDude’s picture

I just tried Patch 22 and I'm getting this error, similar to #13:

Notice: Undefined index: #range_min in FacetapiWidgetSlider->execute() (line 56 of /var/www/html/drupal-7.43-ecomm/sites/all/modules/facetapi_slider/plugins/facetapi/widget_slider.inc).
Notice: Undefined index: #range_max in FacetapiWidgetSlider->execute() (line 57 of /var/www/html/drupal-7.43-ecomm/sites/all/modules/facetapi_slider/plugins/facetapi/widget_slider.inc).
Notice: Undefined index: #global_range_min in FacetapiWidgetSlider->execute() (line 58 of /var/www/html/drupal-7.43-ecomm/sites/all/modules/facetapi_slider/plugins/facetapi/widget_slider.inc).
Notice: Undefined index: #global_range_max in FacetapiWidgetSlider->execute() (line 59 of /var/www/html/drupal-7.43-ecomm/sites/all/modules/facetapi_slider/plugins/facetapi/widget_slider.inc).

chegor’s picture

Status: Reviewed & tested by the community » Needs work

Confirming error from #24

capysara’s picture

I'm not sure what I'm doing wrong. Patch 11 worked for me, but when I applied Patch 22, the entire widget disappeared. I tried just adding 'term' to the code (in case I didn't use the patch correctly), but it still didn't work.

Sylvebois’s picture

Category: Feature request » Bug report
Priority: Normal » Major

I just got the same error as #13 and #24.
Perhaps, the problem come from those lines :

      // Only try this if we have a number field to work with.
      $field_names = explode(':', $facet['field']);
      $field_name = $field_names[count($field_names)-1];
      $field_info = field_info_field($field_name);
      if($field_info['module'] == 'number'){

I choose "amount_decimal" in my drupal commerce products as indexed field to use for the slider ... BUT, $field_info is not equal to 'number' and the indexes are not created ...
After some search, I think the problem may come from the function field_info_field() because, in my db, there is no table like field_data_field_amount_decimal or field_data_amount_decimal (as said in the comments here).

Perhaps I'm wrong ... If someone has any Idea