Git Product home page Git Product logo

contentful-to-algolia's Introduction

Hello hello, my name is Hans 👋

As an experienced Engineering Leader and Software Architect, I currently serve as the Vice President of Engineering for Seven.One Entertainment Group (ProSiebenSat.1).

I have been utilizing Agile development and methodologies for over a decade and have 13 years of professional experience developing scalable web-applications using cutting-edge technologies. I am passionate about creating robust systems in high-performance environments and building teams that strive for excellence. My primary focus is on empowering and accelerating the growth of my team members.

Get in Contact

Website Twitter LinkedIn

contentful-to-algolia's People

Contributors

christineywang avatar dependabot[bot] avatar drublic avatar thetoine avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

contentful-to-algolia's Issues

Circular reference creates stack overflow error

Situation: my space has articles and posts. Article A has a multiple reference field with "related posts" that includes Post B. Post B has a multiple reference field with "related articles", that includes Article A.

If I run a build at which I try to sync my items with Algolia, the following happens.

Error message:
RangeError: Maximum call stack size exceeded at Contentful._cleanMore (/Users/Sander/GitHub/gatsby/blog/node_modules/contentful-to-algolia/lib/Contentful.js:171:15)

Bug sits in _getLocalForNestedFields. If I comment out lines 134 to 151 and simply delete the circular array (like delete entry[key]) - the error is gone.

Filtering entries

Is there any way to filter out entries based on their content?
Looks like returning null from manipulateSingle does not work.

Add support for more than 100 entries

I have a content type with over 1000 entries, but the library currently only processes 100 entries. This feature could be implemented using the skip and limit parameters. Thoughts?

Issue with Asset objects being processed in _cleanEntry

👋 I'm using contentful-to-algolia on a project and I had a question about this commit. In _cleanEntry on line 97 it will access entry.sys.contentType, but the array of entries being sent to this code includes objects representing assets, which do not include the contentType key.

I'm just curious which API you're using to build this library. I ran into the above error with the Delivery API, and I know some of Contentful's APIs deliver data in different formats.

Thanks for making this library though, it's been a big help.

Issue with manipulateSingle function

Hello!

I am able to successfully use the contentful-to-algolia integration to import Contentful data into Algolia without any entry manipulation. Now, I would like to test changing the shape of the JSON so that entries are only indexed with specified properties.

My question is related to using the manipulateSingle function. The sync method works when I specify the content type ID, index name, and callback function parameters:

Sync.sync(
  <contentTypeID>,
  <indexName>,
  <callback function>
);

The last two parameters are what I am having issues with. Do I need to specify the <entryId> parameter? I don't want to so I have been testing out values such as undefined and false but I get the error that a string is expected. What I care about is being able to run the manipulateSingle function. If I don't put anything in the <entryID> parameter and use this:

Sync.sync(
  <contentTypeID>,
  <indexName>,
  <callback function>,
  <manipulateSingle>
);

The sync works, entries are imported, and I don't get errors in the console. However, the manipulateSingle function is ignored and my entries are not indexed with their new shape.

What am I doing wrong?

Here is what I am trying to get to work:

const formatter = ({
  id,
  createdAt,
  locale,
  productName,
  slug,
  productDescription,
  tags,
  contentType
}) => ({
  id,
  locale,
  objectID: id,
  createdAt,
  productName,
  slug,
  productDescription,
  tags,
  contentType
});


Sync.sync(
  '2PqfXUJwE8qSYKuM0U6w8M',
  'blog',
  function(algolia_response) {
    const response = algolia_response;
    console.log('res', JSON.stringify(algolia_response));
    console.log('number of indexed entries:', algolia_response.length);
  },
  // undefined,
  formatter
);

Thanks so much!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.