Problem/Motivation

The view doesn’t show indexed data when 1 or more filters are applied. When filters are removed, it shows all the content from all the configured datasources.

Steps to reproduce

  1. Create a view of an Algolia indexed content.
  2. Add content type filter or status filter and preview the result.
  3. Data gets disappeared from the preview.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#4 Screenshot 2023-02-03 at 6.11.02 PM.png232.71 KBjonloh
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

psingh10 created an issue. See original summary.

robertoperuzzo’s picture

Hi, I'm facing the same issue.

I added the 'status' field in the Search API index as a "Boolean" and added the filter "Content datasource: Published (= True)" in my view.

The resulting query is

{
  "attributesToRetrieve": "search_api_id",
  "facets": [
  ],
  "analytics": true,
  "length": 3,
  "offset": 0,
  "filters": "status:1",
  "query": "*"
}

I'm investigating.

robertoperuzzo’s picture

Status: Needs work » Active
jonloh’s picture

StatusFileSize
new232.71 KB

Not sure if this is related, but it seems that if I add Sort Criteria, there will be no results returned as well.

Checking the logs in Algolia, it seems Drupal is appending the field names into the API URL somehow, causing it 404 error.

Error

jonloh’s picture

Ok my apologies, I believe my comment above can be ignored.

Apparently you will need to create a Replica manually in Algolia dashboard. The replica's name follows the index in the URL generated in Drupal - In my case above, the name is directory_test_created_1_asc. Then in that Replica's index, go to Configuration > Ranking and Sorting > Create the field that you want to sort.

I supposed the sorting is not really in synced with Drupal Views for now.

davps’s picture

davps’s picture

Status: Active » Needs review

MR #35 contains fixes for filter value with boolean type.

  • davps committed f7c50c30 on 3.0.x
    Issue #3277657 by psingh10, robertoperuzzo, jonloh, davps: Cannot see...
davps’s picture

Status: Needs review » Fixed

Thanks all for the reports and troubleshooting.

The sorting issue will be fixed in a separate task.

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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