A powerful hosted search engine API, Algolia provides product teams with the resources & tools they need to create fast, relevant search.
Free trial - no credit card required
A powerful hosted search engine API, Algolia provides product teams with the resources & tools they need to create fast, relevant search.
Search that scales with you, your customers, and their data.
Delight your shoppers with an experience they’ll love.
Connect your audience with the content that matters most to them.
Algolia obsesses over developer experience. Extensive documentation &
guides, an active community & 24/7 support make it a pleasure to work with Algolia.
Push your data
my_index = Algolia::Index.new('contacts')
my_index.add_object :firstname => "Jimmie",
:lastname => "Barninger",
:company => "California Paint"
class Contact < ActiveRecord::Base
include AlgoliaSearch
algoliasearch do
attribute :firstname, :lastname, :company
end
end
myIndex = apiClient.init_index("contacts")
myIndex.add_object({"firstname": "Jimmie",
"lastname": "Barninger",
"company": "California Paint"})
from django.contrib.algoliasearch import AlgoliaIndex
class YourModelIndex(AlgoliaIndex):
fields = ('firstname', 'lastname', 'company')
$myIndex = $apiClient->initIndex("contacts");
$myIndex->addObject([
"firstname" => "Jimmie",
"lastname" => "Barninger",
"company" => "California Paint",
]);
/**
*
* @ORM\Entity
*
* @Algolia\Index()
*
*/
class Contact
{
/**
* @var string
*
* @ORM\Column(name="firstname", type="string")
* @Algolia\Attribute
*/
protected $firstname;
}
const myIndex = apiClient.initIndex('contacts');
myIndex
.addObject({
firstname: 'Jimmie',
lastname: 'Barninger',
company: 'California Paint',
})
.then(content => console.log(content))
.catch(err => console.error(err));
Index<Contact> index = client.initIndex("contacts", Contact.class);
index.addObject(
new Contact()
.setFirstname("Jimmie")
.setLastname("Barninger")
.setCompany("California Paint")
);
//For the DSL
import algolia.AlgoliaDsl._
//For basic Future support, you might want to change this by your own ExecutionContext
import scala.concurrent.ExecutionContext.Implicits.global
//case class of your objects
case class Contact(firstname: String,
lastname: String,
compagny: String)
val indexing: Future[Indexing] = client.execute {
index into "contacts" `object` Contact("Jimmie", "Barninger", "California Paint")
}
object := algoliasearch.Object{
"firstname": "Jimmie",
"lastname": "Barninger",
}
res, err = index.AddObject(object)
Index myIndex = apiClient.InitIndex("contacts");
var jsonObject = new JObject();
jsonObject.Add("firstname", "Jimmie");
jsonObject.Add("lastname", "Barninger");
jsonObject.Add("company", "California Paint");
myIndex.AddObject(jsonObject);
let myIndex = apiClient.getIndex("contacts")
let n = [
"firstname": "Jimmie",
"lastname": "Barninger",
"company": "California Paint"
]
myIndex.addObject(n)
Index myIndex = apiClient.initIndex("contacts");
JSONObject jsonObject = new JSONObject()
.put("firstname", "Jimmie")
.put("lastname", "Barninger")
.put("company", "California Paint");
myIndex.addObjectAsync(jsonObject, null);
Back-end
Build search UX
<div id="searchbox"></div>
<div id="hits"></div>
<script>
const { searchBox, hits } = instantsearch.widgets;
search.addWidget(searchBox({ container: "#searchbox" }));
search.addWidget(hits({ container: '#hits' }));
search.start();
</script>
const App = (
<Search>
<SearchBox />
<Results />
<Pagination />
<RefinementList
attributeName="company"
/>
</Search>
);
<RelativeLayout
xmlns:algolia="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.algolia.instantsearch.ui.views.SearchBox
android:id="@+id/search_box"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<com.algolia.instantsearch.ui.views.Stats
android:id="@+id/search_box"
android:layout_width="match_parent"
android:layout_height="<wrap_co></wrap_co>ntent"/>
<com.algolia.instantsearch.ui.views.Hits
android:layout_width="match_parent"
android:layout_height="wrap_content"
algolia:itemLayout="@layout/hits_item"/>
</RelativeLayout>
<ais-index>
<ais-search-box />
<ais-results>
<template scope="{ result }">
<h2>{{ result.name }}</h2>
<p>{{ result.description }}</p>
</template>
</ais-results>
<ais-refinement-list attributeName="company" />
<ais-pagination />
</ais-index>
@Component({
selector: 'search-ui',
template: `
<input type="search" (input)="search()">
<div *ngFor="let result of results">{{result.title.highlighted}}</div>
`
})
export algolia(App);
var searcher: Searcher!
var searchBar: UISearchBar!
func viewDidLoad() {
super.viewDidLoad()
let client = Client(appID: "appID", apiKey: "apiKey")
let index = client.index(withName: "indexName")
searcher = Searcher(index: index, resultHandler: resultHandler)
searchBar.delegate = self
}
func resultHandler(results: SearchResults?, error: Error?, userInfo: [String: Any]) {
print(results?.hits)
}
func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) {
searcher.params.query = searchText
searcher.search()
}
Front-end