I’m trying to implement a domain search. All the top level domains are indexed in Algolia.
What I would like to achieve is that when a user searches e.g. for
my-garden-company.com, I would like to show him a list of sensible top level domains. Such as:
To achieve this I came up with this solution:
- After entering
my-garden-company.com, I would take the first part of the query before the dot (=
my-garden-company) and search in my index
domain-index. This would result in the following results:
- Simultaneously I would take the query part after the dot (=
com) and search in
domain-index. This would obviously result in
It all feels a bit weird… And I did not find a way to intercept/edit the query sent to the indices.
<ais-instantsearch [config]="config"> <ais-search-box placeholder="my-garden-company.com"></ais-search-box> <ais-index indexName="domain-index"> <!-- Here i would like to send 'my-garden-company' as the query --> <ais-hits></ais-hits> </ais-index> <ais-index indexName="domain-index"> <!-- Here i would like to send 'com' as the query --> <ais-hits></ais-hits> </ais-index> </ais-instantsearch>
Thanks for your help!