Setting a filter to "Is not equal to" is broken in the latest dev branch. This is because my query outputs like this:

http://localhost:8983/solr/drupal/select?start=0&rows=10&&fl=id,entity_id,path_alias,label,ss_field_teaser&sort=&qf=content^40&qf=label^5.0&qf=tags_inline^1.0&qf=taxonomy_names^2.0&qf=tos_name^3.0&qf=ss_author&qf=tm_description&qf=tm_city&q.alt=(((-id:(3x4i52/node/7)) AND (bundle:(blog))))&wt=json&json.nl=map

The issue is the fact that we're trying to do an exclude in the q.alt parameter. This is due to over-exuberant parenthesis in our query string. Because the field no longer starts with "-", but instead starts with "((-", apachesolr doesn't know to set the field to '#exclude'.

I tracked this down to hash 5f15f3b2, related to https://www.drupal.org/node/2304685

The patch recommended in that issue was not the patch applied, even though it works and doesn't destroy NOT queries. I'm going to re-roll the patch against the latest dev version with the next comment.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mariacha1’s picture

Status: Active » Needs review
FileSize
1.04 KB

Here's that patch.

MiroslavBanov’s picture

Status: Needs review » Fixed

Thanks for the patch. Did not realize that the committed version introduced a regression that the original patch didn't. In my tests the original patch worked just fine, but I had thought to slightly simplify the code.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.