Thanks for the great module! I've been waiting for something like this for a long time.
I would like to report two issues.

1. Newly created Range Facets show up in "Guided search" before adding them to the environment.

2. Overlapping ranges do not work as expected. I am trying to select Amazon items based on the star rating as follows:

1..5]   | All
  2..5] | 2 and up
  3..5] | 3 and up
  4..5] | 4 and up
  5..5] | 5 only

Only the 1..5] range shows up in "Guided search". Is the definition correct?

Thanks,
Laszlo
http://osherl.com

Comments

osherl’s picture

I found a workaround for the Amazon rating problem. I assign taxonomy terms to nodes, for example, an item with 3 stars will have the "All", "2 and up" and "3 and up" terms assigned to it, etc. Faceted Search handles it beautifully. I have created a nice Amazon mashup site for safe cosmetics. Please check it out at http://safecosmeticshop.com

steveray’s picture

Lazlo,
I'm using this successfully for SAT scores:
700..inf | 700+
600..inf | 600+
500..inf | 500+
400..inf | 400+
0..inf | Any

I checked the "When counting items in a range, add the sum of previous ranges." box in the Advanced section of the Edit Range Facet page.
I selected the "Range ID, Asc" option for that facet on the facet environment page.

I get this result in the Guided Search box, which may be similar to what you were looking for (if "5 only" == "700+") :
Average Senior Math SAT Score
700+ (3)
600+ (23)
500+ (41)
400+ (42)
Any (43)

I could not flip the list over, if I select the "Range ID, Desc" option, they sort with Any (1) and 400+ (1) topping the list, but the totals are wrong for the context.
No extra taxonomy was required.

Steve

osherl’s picture

Steve,
Thank you very much for the tip, looks like it should work. I will give it try and let you know.
Laszlo

vinoth.3v’s picture

any update on

1. Newly created Range Facets show up in "Guided search" before adding them to the environment.

?

also I am unable to save it to environment.

Cyboth’s picture

I'm having the same issue with the numeric range facet,

As soon as I created the facet it would automatically be added to the environment, it would also not add to the search if a user tryed using the guided search.

It adds automatically to the environment, but doesn't work, and when I try to add it to the environment it doesn't save.

This only seem to happen with my numeric, textual is also added automatically but seems to be working.

Thanks.

izarco’s picture

I have the same issue. Any progress?

Thank's and good job.

brycesenz’s picture

Subscribing. I am facing the same issue of facets showing up before adding them to an environment.

I've only just started investigating this, but I think that part of the problem is this - when you define a new range, it gets saved into the {fsrange_facets} table. However, it doesn't get saved into the {faceted_search_filters} table until AFTER you go to the Faceted Search Environment administration section and save it to a particular environment.

I'm still working on at least fixing that issue, but I'll keep y'all posted.

brycesenz’s picture

NM. Turns out that the above database situation is not the root cause.

brycesenz’s picture

Status: Active » Needs review

Ok, actual update. I think that the problem of range facets appearing prematurely in the guided search block can be solved with a slight tweak in the 'fsrange_faceted_search_collect' function in fsrange.module.

Original

function fsrange_faceted_search_collect(&$facets, $domain, $env_id, $filter, $arg = NULL) {
  switch ($domain) {
    case 'facets':
      foreach (fsrange_facets() as $facet_struct) {
        $key = _fsrange_key($facet_struct);
        $facets[] = new fsrange_facet($facet_struct);
      }
      break;

Proposed Change

function fsrange_faceted_search_collect(&$facets, $domain, $env_id, $filter, $arg = NULL) {
  switch ($domain) {
    case 'facets':
      foreach (fsrange_facets() as $facet_struct) {
        $key = _fsrange_key($facet_struct);
        if ((!isset($filter) || isset($filter[$key][1])) && fsrange_is_field_defined($facet_struct['field_name'])) {
          $facets[] = new fsrange_facet($facet_struct);
        }
      }
      break;

Can others please test this and confirm that it works?

plach’s picture

StatusFileSize
new571 bytes

The fix looks good and seems to be working as expected. I'm going to test it more extensively and report.

You can find a proper patch attached.

haopei’s picture

This works. I can now create range facets and enable them to the environment.

However, there seems to be another problem. I have created two range facets:

Facet Name: "Price Range - For Sale"

0..4999999| Less than $5M
5000000..10000000 | $5M - $10M
10000001..25000000 | $10M - $25M
25000001..50000000 | $25M - $50M
50000001..inf | More than $50M

Facet Name: "Price Range - For Rent"

0..49999 | Less than $50,000
50000..100000 | $50,000 - $100,000
100001..250000 | $100,000 - $250,000
250001..500000 | $250,000 - $500,000
500001..1000000 | $500,000 - 1M
1000001..inf | More than 1M

The first range facet works fine, and is enabled in the environment without trouble. The second facet refuses to be enabled.

Any ideas of what might be preventing this?

About my website

I have a real estate website which uses two CCK fields:
1. Rent Price
2. Sale Price

Both fields have identical configuration.

I have configured range facets for both of these fields, however, "Rent Price" cannot be enabled.

Thank you for any tips!

Update: I re-created the CCK field associated with the "For Rent" range facet. This fixes the problem.