algolia / algoliasearch-zendesk

Integrate Algolia within your Zendesk Help Center in minutes.
https://community.algolia.com/zendesk
Other
21 stars 12 forks source link

Adds support for excluding some search actions #77

Closed YesThatAllen closed 6 years ago

YesThatAllen commented 6 years ago

Based on the queries I see being sent over, this is where I think the analytics key needs to be set.

Closes #76

YesThatAllen commented 6 years ago

Glad to help.. feel free to squash these commits at merge.

Jerska commented 6 years ago

This will still not work. Here you're just passing the parameters to our wrappers, but you need to forward it to the actual algolia libraries calls.

That's both places described in my first comment.


In autocomplete.js, you'll need to:

  1. Remove the unnecessary analytics from the constructor parameters.
  2. Add analytics to the render function parameters.
  3. Modify, in render the params, like so

     const params = {
    +   analytics, 
       hitsPerPage, 
       facetFilters: `["locale.locale:${locale}"]`, 
       highlightPreTag: '<span class="aa-article-hit--highlight">', 
       highlightPostTag: '</span>', 
       attributesToSnippet: [`body_safe:${nbSnippetWords}`], 
       snippetEllipsisText: '...' 
    };

In instantsearch.js, you'll need to:

  1. Remove the unnecessary analytics from the render parameters.
  2. Modify, in contructor the params, like so

         searchParameters: {
    +       analytics,
           attributesToSnippet: ['body_safe:40'],
           highlightPreTag: '<span class="ais-highlight">',
           highlightPostTag: '</span>',
           snippetEllipsisText: '...'
         },
Jerska commented 6 years ago

How are your tests of the library doing on your Help Center?

YesThatAllen commented 6 years ago

How are your tests of the library doing on your Help Center?

Poorly. Per the local testing docs, yarn installs, but I get only

$ PORT=3005 yarn dev
yarn run v1.12.1
error Command "dev" not found.

Thoughts? but honestly, relying on me to test this may not be the best plan long-term.. I'm far out of my league on this.

Jerska commented 6 years ago

Thoughts? but honestly, relying on me to test this may not be the best plan long-term.. I'm far out of my league on this.

No worries! I'm trying to point you in the right directions as you've started implementing it, but I can definitely take back ownership on it if this is what you want.

YesThatAllen commented 6 years ago

Fantastic. Very happy for you to take this & run with it. Looking forward to the feature add!