getgrav / grav-premium-issues

Official Grav Premium Issues repository to report problems or ask questions regarding the Premium products offered.
https://getgrav.org/premium
7 stars 2 forks source link

[algolia-pro] Much setSettings API calls #336

Open Sogl opened 1 year ago

Sogl commented 1 year ago

Second day of installing Algolia Pro. No index created, Production mode is disabled. But almost 98% of API calls are /1/indexes/pages-ru-grav/settings:

image

Request body is the same (default options):

{
  "searchableAttributes": [
    "title",
    "subtitle",
    "url",
    "taxonomy",
    "headers.h1",
    "headers.h2",
    "headers.h3",
    "headers.h4",
    "content"
  ],
  "attributeForDistinct": "url",
  "distinct": true,
  "attributesToSnippet": [
    "summary:50",
    "content:50"
  ],
  "snippetEllipsisText": "…"
}

Example of Response body:

{
  "updatedAt": "2023-02-02T21:55:53.976Z",
  "taskID": 24899928001
}

As I understand, every time it calls this method: https://www.algolia.com/doc/api-reference/api-methods/set-settings/

After creating the full index (Production mode enabled), I already have 453 search requests:

image

Quite a lot, considering that the free plan is given for 10,000 operations and I only configure the plugin on the localhost.

w00fz commented 1 year ago

You most likely have selected only that specific index. Look at the top of that page, you should see a dropdown for your App and next to it a dropdown for the indices.

You can click on "See All" to see how the indexes are doing and how many records have been created. Keep in mind that from my experience those values are not real-time but slightly delayed. Not talking about days but minutes.

CleanShot 2023-02-02 at 14 38 58@2x

Sogl commented 1 year ago

I have only one index:

image
Sogl commented 1 year ago

What I found using Xdebug about setSettings call and default pages index. I counted the number of stops on the breakpoint in SearchIndex.php line 105 and compared it with Search API Logs Algolia tab:

image image image image

@w00fz Is this normal behavior? Can we reduce number of calls?

I alone have created more than 1100 queries during development and testing from February 1 to the current day.

image