Using facetsForcedRefinement to filter out records where enabled = false

I’m having trouble filtering out CMS entries that are disabled. I am using the SearchPlus plugin for Craft CMS. The following is my SearchPlus init with a facetsForcedRefinement configured:

$(this).searchplus({
  searchOnLoad: false,
  facets : ['enabled'],
  facetsForcedRefinement: { 'enabled' : true }
});

My Facets config:

A record from my Algolia index:

{
  "title": "PrimeTime - 5th Saturday Picnic",
  "id": "11754",
  "locale": null,
  "uri": "events/primetime-5th-saturday-picnic",
  "url": "https://lcbcchurch.com/events/primetime-5th-saturday-picnic",
  "slug": "primetime-5th-saturday-picnic",
  "enabled": false,
  "archived": false,
  "localeEnabled": true,
  "postDate": {
    "localeDate": "5/13/2019",
    "localeTime": "11:30 AM",
    "nice": "May 13, 2019, 3:30:00 PM",
    "mysql": "2019-05-13 11:30:00",
    "cookie": "Monday, 13-May-2019 15:30:00 UTC",
    "timestamp": "1557761400"
  },
  "dateCreated": {
    "localeDate": "5/13/2019",
    "localeTime": "11:30 AM",
    "nice": "May 13, 2019, 3:30:34 PM",
    "mysql": "2019-05-13 11:30:34",
    "cookie": "Monday, 13-May-2019 15:30:34 UTC",
    "timestamp": "1557761434"
  },
  "dateUpdated": {
    "localeDate": "9/19/2019",
    "localeTime": "10:20 AM",
    "nice": "Sep 19, 2019, 2:20:44 PM",
    "mysql": "2019-09-19 10:20:44",
    "cookie": "Thursday, 19-Sep-2019 14:20:44 UTC",
    "timestamp": "1568902844"
  },
  "expiryDate": {
    "localeDate": "6/30/2019",
    "localeTime": "12:00 AM",
    "nice": "Jun 30, 2019, 4:00:00 AM",
    "mysql": "2019-06-30 00:00:00",
    "cookie": "Sunday, 30-Jun-2019 04:00:00 UTC",
    "timestamp": "1561867200"
  },
  "absoluteUri": "/events/primetime-5th-saturday-picnic",
  "authorId": "10193",
  "authorName": "Travis",
  "sectionId": 18,
  "typeId": 24,
  "eventTitle": "PrimeTime - 5th Saturday Picnic",
  "eventPhoto": [
    {
      "title": "Prime Time5Th Saturday Picnic 1600X600 Event Hero",
      "id": "11747",
      "locale": null,
      "uri": null,
      "url": "https://storage.googleapis.com/lcbc-assets/images/events/PrimeTime5thSaturdayPicnic__1600x600-EventHero_190513_112440.png?mtime=20190513112440",
      "slug": "prime-time5th-saturday-picnic-1600x600-event-hero",
      "enabled": true,
      "archived": false,
      "localeEnabled": true,
      "postDate": [],
      "dateCreated": {
        "localeDate": "5/13/2019",
        "localeTime": "11:24 AM",
        "nice": "May 13, 2019, 3:24:41 PM",
        "mysql": "2019-05-13 11:24:41",
        "cookie": "Monday, 13-May-2019 15:24:41 UTC",
        "timestamp": "1557761081"
      },
      "dateUpdated": {
        "localeDate": "5/13/2019",
        "localeTime": "11:24 AM",
        "nice": "May 13, 2019, 3:24:41 PM",
        "mysql": "2019-05-13 11:24:41",
        "cookie": "Monday, 13-May-2019 15:24:41 UTC",
        "timestamp": "1557761081"
      },
      "expiryDate": [],
      "absoluteUri": "/",
      "authorId": null,
      "authorName": "",
      "transform_cropheader": "https://storage.googleapis.com/lcbc-assets/images/events/_cropheader/11747/PrimeTime5thSaturdayPicnic__1600x600-EventHero_190513_112440.jpg?mtime=20190513112440",
      "transform_facebook": "https://storage.googleapis.com/lcbc-assets/images/events/_facebook/11747/PrimeTime5thSaturdayPicnic__1600x600-EventHero_190513_112440.jpg?mtime=20190513112440",
      "transform_halfBlockSquare": "https://storage.googleapis.com/lcbc-assets/images/events/_halfBlockSquare/11747/PrimeTime5thSaturdayPicnic__1600x600-EventHero_190513_112440.jpg?mtime=20190513112440",
      "transform_twitterCardLarge": "https://storage.googleapis.com/lcbc-assets/images/events/_twitterCardLarge/11747/PrimeTime5thSaturdayPicnic__1600x600-EventHero_190513_112440.jpg?mtime=20190513112440",
      "transform_twitterCardSmall": "https://storage.googleapis.com/lcbc-assets/images/events/_twitterCardSmall/11747/PrimeTime5thSaturdayPicnic__1600x600-EventHero_190513_112440.jpg?mtime=20190513112440",
      "transforms": [
        {
          "handle": "cropheader",
          "name": "cropHeader",
          "width": "1600",
          "height": "500",
          "url": "https://storage.googleapis.com/lcbc-assets/images/events/_cropheader/11747/PrimeTime5thSaturdayPicnic__1600x600-EventHero_190513_112440.jpg?mtime=20190513112440"
        },
        {
          "handle": "facebook",
          "name": "Facebook",
          "width": "1200",
          "height": "630",
          "url": "https://storage.googleapis.com/lcbc-assets/images/events/_facebook/11747/PrimeTime5thSaturdayPicnic__1600x600-EventHero_190513_112440.jpg?mtime=20190513112440"
        },
        {
          "handle": "halfBlockSquare",
          "name": "Half Block Square",
          "width": "600",
          "height": "600",
          "url": "https://storage.googleapis.com/lcbc-assets/images/events/_halfBlockSquare/11747/PrimeTime5thSaturdayPicnic__1600x600-EventHero_190513_112440.jpg?mtime=20190513112440"
        },
        {
          "handle": "twitterCardLarge",
          "name": "Twitter Card - Large",
          "width": "560",
          "height": "300",
          "url": "https://storage.googleapis.com/lcbc-assets/images/events/_twitterCardLarge/11747/PrimeTime5thSaturdayPicnic__1600x600-EventHero_190513_112440.jpg?mtime=20190513112440"
        },
        {
          "handle": "twitterCardSmall",
          "name": "Twitter Card - Small",
          "width": "240",
          "height": "240",
          "url": "https://storage.googleapis.com/lcbc-assets/images/events/_twitterCardSmall/11747/PrimeTime5thSaturdayPicnic__1600x600-EventHero_190513_112440.jpg?mtime=20190513112440"
        }
      ],
      "metadata": {
        "0": "",
        "1": "",
        "title": "",
        "playtime": ""
      }
    }
  ],
  "eventOneLiner": "Saturday, June 29, 2019",
  "linkToSomething": {
    "type": "entry",
    "value": [
      "11752"
    ],
    "defaultText": "",
    "customText": "Register",
    "target": "_blank"
  },
  "eventDescription": "<p>Join us for a fun day of activities and food along the beautiful Susquehanna River. Connect with others 55+ for a Corn Hole Throw Tournament, Bocce Ball, biking, hiking, fishing, boating, or just playing a game while overlooking the calming river scenery.<br>Hamburgers, hot dogs, condiments, drinks, and paper products will be provided.\r\n</p>\r\n<p>Last names A-N please bring a side dish to share<br>Last names O-Z please bring a dessert\r\n</p>\r\n<p>Bring cold foods in an insulated container if you're coming early. Lunch will be at noon, but you can come as early as 10am if you would like to bike, walk, or start with the ongoing Corn Hole Throw Tournament. Great prizes! Bring lawn chairs and any games you’d like to play.\r\n</p>\r\n<p><br></p>\r\n<p><strong>Details</strong></p>\r\n<p>Saturday, June 29, 2019<br>Lunch is at 12pm<br>Riverfront Park, East Donegal Township, 551 Vinegar Fairy Rd, Marietta, PA<br></p>\r\n<p>$4/person</p>",
  "whenAndWhere": [],
  "fullWidthBlock": [],
  "halfBlockHorizontal": [],
  "halfBlockSquare": [],
  "quarterBlock": [],
  "seoMetaData": [],
  "objectID": "11754"
}

Anybody have an idea why this facet doesn’t seem to be doing anything? Thanks so much for any help you can provide!

Hi there,

Since Algolia did not create the SearchPlus plugin for Craft CMS, we can not support it as we don’t know how they’ve integrated in their plugin. Any advice we might give may be in conflict with their integration methods.

You will need to contact the SearchPlus plugin authors to get support for this plugin.

I apologize for the inconvenience.