1
0
Fork 0

make transformData more explicit cc algolia/docsearch-configs#975

This commit is contained in:
s-pace 2019-08-21 01:52:00 +02:00 committed by Sylvain Pace
parent b1d9eade21
commit e92afb8621
4 changed files with 8 additions and 8 deletions

View file

@ -83,14 +83,15 @@ docsearch({
## `transformData`
This method will be called on all suggestions before displaying them. It doesn't
do anything by default, but we provide this hook for you to add your own logic.
This method will be called on every hits before displaying them. It doesn't do
anything by default, but we provide this hook for you to add your own logic and
pre-process the hits returned by Algolia.
```javascript
docsearch({
[…],
transformData: function(suggestions) {
// Transform the list of suggestions, and the return the updated list
transformData: function(hits) {
// Transform the list of hits
}
});
```

View file

@ -45,7 +45,7 @@ complete, it moves that index to the name specified by `index_name` (replacing
the existing index).
By default, the name of the temporary index is the value of `index_name` +
*_tmp*. If you want to use a different name, set the `INDEX_NAME_TMP`
_\_tmp_. If you want to use a different name, set the `INDEX_NAME_TMP`
environment variable to a different value. This variable can be set in the .env
file alongside `APPLICATION_ID` and `API_KEY`.

View file

@ -6,8 +6,8 @@ title: Scraper Overview
## How?
The DocSearch scraper is written in python and heavily based on the [Scrapy][1]
framework. It will go through all pages of your website and extract content from the
HTML structure to populate an Algolia index.
framework. It will go through all pages of your website and extract content from
the HTML structure to populate an Algolia index.
It will automatically follow every internal links to make sure we are not
missing any content, and will use the semantics of your HTML structure to

View file

@ -73,7 +73,6 @@ You are ready to go.
### Running the crawler
Running `pipenv shell` will enable your virtual environment. From there, you can
run one crawl with the following command: