Comments (11)
Ah yes, that would work nicely as well!
And regarding the possibility of merging dashboard and code settings, I agree that would likely cause more trouble than it's worth.
from gatsby-plugin-algolia.
Hey @syivanes! The way to go is:
- add
settings
key (optional) to the queries array - read it, and call
setSettings
on the index to the temporary index, before it's moved to the main one - test it out on the example
Ideally there'd be real tests here, but I didn't add them yet, because I was still unsure which parts of the Gatsby life cycle to mock and which not to.
This should comfortably fit in a trial & community Algolia plan, but let me know your appId if you need bigger quota.
Let me know if you have any questions!
from gatsby-plugin-algolia.
Cool! Gatsby and Algolia are both foreign to me, but I'll dig in.
from gatsby-plugin-algolia.
Don't hesitate to reach out in a more direct medium like twitter DM (I'm in EU time zone though) if you have any more questions) for this!
from gatsby-plugin-algolia.
@Haroenv I implemented the ability to specify settings programmatically in PR #17. Also tested it.
from gatsby-plugin-algolia.
Okay. Would be great though, if this could be released sooner rather than later. Let me know if I can help with the tests.
from gatsby-plugin-algolia.
It's not a feature I added initially, since you were able to set them manually, but the change to never-down indexing broke that, since it now will move that staging index into the production index.
We have two options here:
- gatsby-plugin-algolia is the main source of truth
adds the settings to the Gatsby plugin, always set them and override anything set in the dashboard
- the dashboard is the source of truth
No settings allowed via Gatsby, but it will copy over those from the main index.
I'm personally leaning towards the first option; since it allows you to declaratively set the settings with the code.
Another option is something between those two options, where we can merge from the dashboard and the code, but that's likely going to cause confusion.
What's your POV on this?
from gatsby-plugin-algolia.
What's your POV on this?
Same here. I also think declaratively is the way to go. Otherwise people who fork the repo would have to manually pick those settings, meaning you would have to include them in the readme. It's usually a lot nicer to keep everything self-contained.
Perhaps you could offer a flag by which people could choose themselves between options 1 and 2 and make option 1 the default.
from gatsby-plugin-algolia.
One option to avoid the flag is to check if settings
is available in the config, and only set & override if it's given.
from gatsby-plugin-algolia.
Hello guys! I need some practice and this project and issue both look interesting. Which route should I go with for the settings?
from gatsby-plugin-algolia.
PR has been merged, I'll test some things out in the coming weeks and try to add tests, then I will release it, in the meantime you can use your own fork :)
from gatsby-plugin-algolia.
Related Issues (20)
- Question re: Algolia Search HOT 6
- Unreachable hosts Error HOT 6
- Algolia transformer returns nulls for images that are correctly displayed in built site HOT 1
- Support for Gatsby 5 HOT 2
- Gatsby 4 build broken gatsby-plugin-algolia v1.0.0 HOT 2
- failed to index to Algolia Cannot read properties of undefined (reading 'contentDigest') HOT 3
- Plugin breaking in Gatsby 5 HOT 5
- JavaScript heap out of memory HOT 5
- Add indexName to the gatsby cache key HOT 4
- Why partial partial update is no more optional ? HOT 6
- Enrich your records with Google Analytics data HOT 1
- Request for skipIndexing Option to Avoid Unwanted API Access During CI Builds HOT 2
- Extracting chunks of long text as its own record HOT 2
- Adding headers to graphql query HOT 3
- Error: cannot apply the batch operation on a replica index
- Plugin is deleting Sanity document from index if edited. HOT 3
- Adding new data to existing records is ignored HOT 3
- Gatsby internal.contentDigest is a poor source for deciding whether content needs to be updated HOT 6
- Do we still need the MatchFields and enablePartialUpdate options in config? HOT 2
- Partially update not updating existing object in index HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gatsby-plugin-algolia.