Algolia: the best way to query a slave index to sort by ranking by date

I have a dataset where I want to dynamically sort by date (both ascending and descending) on ​​the fly. I read the documents and, in accordance with the instructions, I created a sub-index of my main index, where the top ranking value is my "date", sorted by DESC. The date is in the correct integer and unified time format.

My question is how can I query this new index on the fly using the Algolia Javascript API for the API

Currently my code is as follows:

this.client = algoliasearch("xxxx", "xxxxx");
this.index = this.client.initIndex('master_index');

this.index.search( 
    this.query, {
        hitsPerPage: 10,
        page: this.pagination,
        facets: '*',
        facetFilters: facetArray
    },
    function(error, results) {
        // do stuff
}.bind(this));

, , initIndex, , ... , , , . , ?

, , , . ?

slave , , . ?

!

+4
1

, , initIndex, , ... , , , . , ?

, , this:

this.indices = {
  mostRelevant: this.client.initIndex('master_index'),
  desc: this.client.initIndex('slave_desc')
};

this.indices.mostRelevant.search() this.indices.desc.search().

.

. : https://community.algolia.com/instantsearch.js/

, , , . ?

slave , , . ?

. Algolia .

+10

Source: https://habr.com/ru/post/1629318/


All Articles