Postponed (maintainer needs more info)
Project:
Facet API
Version:
7.x-1.2
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
29 Jan 2013 at 10:41 UTC
Updated:
23 Sep 2015 at 20:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
danieltang commentedGot the same issue on a freshly installed demo site.
Related modules I've installed:
xxxxx@ubuntu:~/public_html/demo$ drush pml | grep facet
Search Search facets Module Enabled 7.x-1.4
(search_api_facetapi)
Search Facet API (facetapi) Module Enabled 7.x-1.2
Search Facet API Bonus (facetapi_bonus) Module Enabled 7.x-1.1
any ideas?
Thanks!
Comment #2
smashwini commentedAfter lot's of browsing i got this url of creating custom widget in facet API with example. http://www.trellon.com/content/blog/apachesolr-and-facetapi . I also took dive into the code of facet Api and found out that their is form of operators in that but its didnt get displayed on UI part .
Operator Form in facet.admin.inc is :-
$all_options = array(
FACETAPI_OPERATOR_AND => t('AND'),
FACETAPI_OPERATOR_OR => t('OR'),
);
$options = array_intersect_key($all_options, array_filter($facet['allowed operators']));
$form['global']['operator'] = array(
'#type' => 'radios',
'#access' => count($options) > 1,
'#title' => t('Operator'),
'#prefix' => '
'#suffix' => '
',
'#default_value' => $global_settings->settings['operator'],
'#options' => $options,
'#description' => t('AND filters are exclusive and narrow the result set. OR filters are inclusive and widen the result set.')
);
Any ideas on this how to show operator form on UI of facet API settings ?
Comment #3
cpliakas commentedHi ashwiniKumar.
The facet field has to support the OR operator. I would track down the facet's definition that is defined by the backend's hook_facetapi_facet_info() implementation. You can also implement hook_facetapi_facet_info_alter() in a custom module to inspect all facet definitions and force support of the OR operator.
Thanks,
Chris
Comment #4
cpliakas commentedChanging title back for clarity.
Comment #5
smashwini commented@cpliakas
I worked on this issue bit more and able to display operator form in facet display settings.
I have not used conventional way to solve respective problem. Probably you can give me direction on this.
I just commented below line from facetapi.admin.inc.
$options = array_intersect_key($all_options, array_filter($facet['allowed operators']));
So, instead of using array_intersect_key() and array_filter() function.
I directly gave array of operator to variable and pushed variable to operator form and it worked like charm.
$options = $all_options ;.
After that I was able to acheive functionality on which I was working on.
PFA image of output.
Comment #6
smashwini commentedChanging title for more clarity.
Comment #7
smashwini commentedComment #8
cpliakas commentedHi ashwiniKumar.
The concern that I have is that a facet must define which operators it supports, and the fix that is applied bypasses that logic and forces facets to support the operator even when it doesn't. If there is any info that you can provide on what the field is you are faceting on we can work through the issue in a way that doesn't brute force the issue.
Thanks for you debugging and for posting your solutions! I know there is a ton of code and getting into the internals can be daunting.
Chris
Comment #9
auraell commented"or" is not an allowed filter for Database servers. See: https://drupal.org/node/1254698
Comment #10
bkline@auraell:
Can you clarify what you mean by
?
Here's the table from the page whose link you supplied. It makes it look like "or" is supported for Database servers. No?
Comment #11
bkline@cpliakas:
I see that ashwinikumar is taking a while to gather what he needs to respond to your request for additional information. How about if I step in to fill the gap while we wait for him? :-)
I'm seeing the same gap that he reported (the administrative UI doesn't expose the option to select which Boolean operator is to be used when more than one facet term is supplied). The field for the facet is content type, and the service class is DB. Is there any other information which would be useful?
Thanks,
Bob
Comment #12
bklineI appears that -- although its release notes make no mention of this fact -- earlier versions of the Search API DB module did not support the OR operator, but the current version does.