TryGhost / TryGhost/algolia

Cannot index pages instead of posts

Open
#4 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted
Dominant language
TypeScript
Stars
22
Forks
19
Avg merge
18h 31m
Merged PRs (30d)
50

Description

In cli.js the original code is:

let context = {errors: [], posts: []};
. . .
context.posts = await ghost.posts.browse();

… which obviously fetches posts. However, changing the second line above to:

context.posts = await ghost.pages.browse();

… still fetches posts.

Is this hard-wired somewhere? Really should be able to fetch and index pages as well.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in cli.js and trace how the result of Ghost's posts.browse or pages.browse is passed into the indexing flow. Check where the choice is being overridden or hard-wired. Done means selecting pages causes pages, rather than posts, to be indexed in Algolia.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli, search
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.