Can Algolia search across multiple subdomains? - algolia

My company's site is spread out across several subdomains (e.g. help., blog., etc.). Can Algolia return relevant content from all of these subdomains when someone does a search?
For instance, say I have a SQL question. There's content that could answer that question on the blog and on help and on a few other subdomains. When I search "SQL" in the search bar, the results would be for pieces of content from all the different subdomains.
I believe Stripe does something like this, though I'm not sure what kind of search they're using. https://support.stripe.com/search?q=money
Thanks in advance!

Definitely! Algolia Search API is domain agnostic, it's all about the data you push to Algolia. You can read the getting started to better understand how it works.
In your case, you can push the content of all your subdomains to a single Algolia index and implement a simple JavaScript-based search targeting that index. You can then either build an auto-completion menu or a full search results page.

Related

How can I autogenerate pages using information from the database?

I'd like to build a semi-automated site where pages would be created based on information on the database.
The site would be a vocabulary-like site where there will be thousands of words with their associated meaning, phonetics, and sentence examples along with other useful information.
Since a CMS like WordPress wouldn't work in that sense, what is the best solution for a system like this?
thanks,

Google manual search results do not match Custom Search API results

I am trying to obtain the total result count from manual Google web search via the CustomSearch API. I am searching the entire web based on a keyword and an associated site, so the search query is " site:". Judging by my research, it is a known issue that manual Google search results tend to differ from CustomSearch API results obtained from searching the entire web, as cited here and elsewhere.
Is there really no way to exactly reproduce manual search results with the API? If that is the case, then the API is rather limited and should be explained up-front to developers in the documentation or fixed.
My custom search engine is already set up to search the whole web I believe.
It looks like maybe PDF files returned in a web search are not returned by the API. I have already tried specifying fileType parameter to include PDFs to no avail.
3 Results returned via manual web search.
0 results returned by API.
If anyone has lessons to share I will be thankful!

algolia best practices : new index or tags?

I'v successfully setup an algolia search engine on my web page. My backend syncs public data to algolia, and the searchbar works just fine.
Now I want to setup the same for my admin application. Unlike the public application, this app should be able to recover secret data from algolia.
So far, I can think about two ways of doing this:
For each document, store both a "public" version (with a "public" tag) and an admin version (tagged "admin", and with additional fields). Custom api keys can then ensure that each app has access to the proper data.
OR
Create a new index, perhaps my_admin_collection_index, duplicate the settings, and use it just like the my_collection_index from the admin app.
So in first version I search the same index, but with different tags; in the second version I search two different indices.
Is there some insights about how to choose between the two approaches ?
I'd say it would be easier for me to duplicate documents and put some tags on them, but I can't really tell about the performances impact of such an approach.
Thanks !
The first approach consisting in pushing all objects to a single index and tagging them with the permissions is the good way to go. Combining that approach with the Secured API keys allows you to easily scale while keeping a secure front-end implementation (embedding the key in the javascript code for instance).
Even if the Algolia engine supports an unlimited number of indices per application (I saw users with +700,000 indices), having too many indices may result in some indexing overheads & slowdown (especially on the mutualized plans where you're sharing the indexing CPUs with other customers).

EPiServer - how to search content in different EPiServer websites?

Greetings EPiServer gurus.
Picture this scenario:
A customer has got two different EPiServer-sites.
One internal and one external website.
The external is using EPiServer Find's REST API for search.
The internal is currently using a simple Search page which is based upon the Lucene indexer.
The customer wants to be able to search both the external and internal site's content INSIDE the internal site. They are not keen on the idea of having to buy another EPiServer Find license to apply on the internal. So basically they want to be able to search the content of the external site while inside of the internal.
What would be the proper approach in order to do this?
Any suggestions appreciated.
/ChrisRun
This is a tricky one. EPiServer Find support multi site setup but requires them to be hosted in the same solution. EPiServer constructed the indexing job in such way that it clears the entire Find index, this means that if you have the same Find index on two different machines they will erase each others indexes, effectively you'll only have the results from the most recently indexed site.
We've discussed this with EPiServer on changing this pattern to only allow an indexer to erase posts with siteId's available to the solution running the index job. However, no luck so far, instead we rely on hackish solutions :)
So, what you are asking is possible with a bit of coding, reflect the built-in indexer and ensure the ReindexTarget are scoped correctly (the code is easy to understand). When done this indexing job needs to be used on both the internal and external environment and the original job needs to be removed.
There's no need for filtering in your internal environment but in the external environment you'll have to ensure only external results are posted. If your results include anything else than pages you cannot filter on siteId since global items (like files and images) doesn't have any siteId. We've solved this with a url-filter like the one below.
private static FilterBuilder<ISearchContent> SiteFilterBuilder
{
get
{
var filter = SearchClient.Instance.BuildFilter<ISearchContent>();
filter = filter.Or(x => x.SearchHitUrl.Prefix(EPiServer.Web.SiteDefinition.Current.SiteUrl.AbsoluteUri));
return filter;
}
}
Implement
var query = SearchClient.Instance.UnifiedSearch(Language.Swedish)
.For(searchQuery.Query)
.AndInField(x => x.SearchCategories)
.UsingSynonyms()
.OrFilter(SiteFilterBuilder) // will scope to this site
.ApplyBestBets()
.Track()
.TermsFacetFor(x => x.SearchSection)
;
Off the top of my head, I can see multiple risks involved in adding the public Find index to the internal site - especially if you don't want it two-way (i.e. index the internal site in the same Find index).
One approach could be to add a search endpoint to the public website, which the internal website invokes to do searches.
Basically that endpoint (for example a controller action method) would perform a search using Find (this would happen inside the public web application) and then return the result to the internal website.
Technically, only the public website would use Find - but results would be available to the internal website.

async autocomplete service

Call me crazy, but I'm looking for a service that will deliver autocomplete functionality similar to Google, Twitter, etc. After searching around for 20 min I thought to ask the geniuses here. Ideas?
I don't mind paying, but it would great if free.. Also is there a top notch NLP service that I can submit strings to and get back states, cities, currencies, company names, establishments, etc. Basically I need to take unstructured data (generic search string) and pull out key information with relevant meta-data.
Big challenge, I know.
Sharing solutions I found after further research.
https://github.com/haochi/jquery.googleSuggest
http://shreyaschand.com/blog/2013/01/03/google-autocomplete-api/
If you dont want to implement it yourself, you can use this service called 'Autocomplete as a Service' which is specifically written for these purposes. You can access it here - www.aaas.io.
you can add metadata with each record and it returns metadata along with the matching results. Do check out demo put up on the home page. It has got a very simple API specifically written for autocomplete search
It does support large datasets and you can apply filters as well while searching.
Its usage is simple - Add your data and use the API URL as autocomplete data source.
Disclaimer: I am founder of it. I will be happy to provide this service to you.