question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is there any way to add user specific info to result of algolia?

See original GitHub issue

Hi,

I need to append some info related to authenticated user to the result returned by algolia algoliasearchHelper. I tried to make a ajax request inside helper.on method

helper.on('result', function(data) {
        renderHits(data);
        myfunction(data);
});

but I always get this error: “Uncaught TypeError: Illegal invocation”. Do you have any kind of suggestion?

Regards

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
vvocommented, Mar 31, 2016

Can you open another issue with a more descriptive content? It’s a lot easier to deal with and for people to refer to in the future, thanks!

1reaction
vvocommented, Mar 31, 2016

There’s a formatData function on the hits widget that let’s you rework the hits.

Unfortunately it is not yet asynchronous compatible, we could add that maybe by just supporting returning promises.

In the meantime what I would do is just put some <div class="more-data" data-object-id="$OBJECTID"></div> in your hit template.

Then fill it after each search, like this:

search.on('render', function() {
  var more = document.querySelectorAll('.more-data');
  // loop through all the more data elements, find the object id, do the requests, fill in the html
});

What do you think?

Read more comments on GitHub >

github_iconTop Results From Across the Web

User-restricted access to data - Algolia
On this page · 1. Adding an attribute for filtering in your dataset · 2. Making the attribute filterable · 3. Adding and...
Read more >
Send and update your data - Algolia
How to send your data to Algolia, batch large datasets, synchronize via incremental updates and atomic reindexing, or handle concurrency.
Read more >
Tag new and returning users | Algolia
You can do this from the Analytics section of your Algolia dashboard. In the header of the Analytics tab you can find the...
Read more >
Customize user experience with search personalization - Algolia
Click, add-to-cart, view, add-to-wishlist, you can choose what makes the most sense for your audience, your content and your business.
Read more >
Implementing Rules - Algolia
Go to the Rules tab for a selected index and click on Add Rule. Here you can choose between two editors: The Visual...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found