Search by Algolia
What is ecommerce merchandising? Key components and best practices
e-commerce

What is ecommerce merchandising? Key components and best practices

A potential customer is about to land on the home page of your ecommerce platform, curious to see what cool ...

Catherine Dee

Search and Discovery writer

AI-powered search: From keywords to conversations
ai

AI-powered search: From keywords to conversations

By now, everyone’s had the opportunity to experiment with AI tools like ChatGPT or Midjourney and ponder their inner ...

Chris Stevenson

Director, Product Marketing

Vector vs Keyword Search: Why You Should Care
ai

Vector vs Keyword Search: Why You Should Care

Search has been around for a while, to the point that it is now considered a standard requirement in many ...

Nicolas Fiorini

Senior Machine Learning Engineer

What is AI-powered site search?
ai

What is AI-powered site search?

With the advent of artificial intelligence (AI) technologies enabling services such as Alexa, Google search, and self-driving cars, the ...

John Stewart

VP Corporate Marketing

What is a B2B marketplace?
e-commerce

What is a B2B marketplace?

It’s no secret that B2B (business-to-business) transactions have largely migrated online. According to Gartner, by 2025, 80 ...

Vincent Caruana

Sr. SEO Web Digital Marketing Manager

3 strategies for B2B ecommerce growth: key takeaways from B2B Online - Chicago
e-commerce

3 strategies for B2B ecommerce growth: key takeaways from B2B Online - Chicago

Twice a year, B2B Online brings together industry leaders to discuss the trends affecting the B2B ecommerce industry. At the ...

Elena Moravec

Director of Product Marketing & Strategy

Deconstructing smart digital merchandising
e-commerce

Deconstructing smart digital merchandising

This is Part 2 of a series that dives into the transformational journey made by digital merchandising to drive positive ...

Benoit Reulier
Reshma Iyer

Benoit Reulier &

Reshma Iyer

The death of traditional shopping: How AI-powered conversational commerce changes everything
ai

The death of traditional shopping: How AI-powered conversational commerce changes everything

Get ready for the ride: online shopping is about to be completely upended by AI. Over the past few years ...

Aayush Iyer

Director, User Experience & UI Platform

What is B2C ecommerce? Models, examples, and definitions
e-commerce

What is B2C ecommerce? Models, examples, and definitions

Remember life before online shopping? When you had to actually leave the house for a brick-and-mortar store to ...

Catherine Dee

Search and Discovery writer

What are marketplace platforms and software? Why are they important?
e-commerce

What are marketplace platforms and software? Why are they important?

If you imagine pushing a virtual shopping cart down the aisles of an online store, or browsing items in an ...

Vincent Caruana

Sr. SEO Web Digital Marketing Manager

What is an online marketplace?
e-commerce

What is an online marketplace?

Remember the world before the convenience of online commerce? Before the pandemic, before the proliferation of ecommerce sites, when the ...

Catherine Dee

Search and Discovery writer

10 ways AI is transforming ecommerce
e-commerce

10 ways AI is transforming ecommerce

Artificial intelligence (AI) is no longer just the stuff of scary futuristic movies; it’s recently burst into the headlines ...

Catherine Dee

Search and Discovery writer

AI as a Service (AIaaS) in the era of "buy not build"
ai

AI as a Service (AIaaS) in the era of "buy not build"

Imagine you are the CTO of a company that has just undergone a massive decade long digital transformation. You’ve ...

Sean Mullaney

CTO @Algolia

By the numbers: the ROI of keyword and AI site search for digital commerce
product

By the numbers: the ROI of keyword and AI site search for digital commerce

Did you know that the tiny search bar at the top of many ecommerce sites can offer an outsized return ...

Jon Silvers

Director, Digital Marketing

Using pre-trained AI algorithms to solve the cold start problem
ai

Using pre-trained AI algorithms to solve the cold start problem

Artificial intelligence (AI) has quickly moved from hot topic to everyday life. Now, ecommerce businesses are beginning to clearly see ...

Etienne Martin

VP of Product

Introducing Algolia NeuralSearch
product

Introducing Algolia NeuralSearch

We couldn’t be more excited to announce the availability of our breakthrough product, Algolia NeuralSearch. The world has stepped ...

Bernadette Nixon

Chief Executive Officer and Board Member at Algolia

AI is eating ecommerce
ai

AI is eating ecommerce

The ecommerce industry has experienced steady and reliable growth over the last 20 years (albeit interrupted briefly by a global ...

Sean Mullaney

CTO @Algolia

Semantic textual similarity: a game changer for search results and recommendations
product

Semantic textual similarity: a game changer for search results and recommendations

As an ecommerce professional, you know the importance of providing a five-star search experience on your site or in ...

Vincent Caruana

Sr. SEO Web Digital Marketing Manager

Looking for something?

facebookfacebooklinkedinlinkedintwittertwittermailmail

We are thrilled to announce the release of Scout Extended — the official Algolia Laravel integration. Built on top of the latest release of Laravel Scout, Scout Extended lets you take advantage of all of Scout’s great features, and, at the same time, leverage the complete Algolia’s search experience.

When Laravel Scout was first released, it provided immediate access to Algolia search. For many, this meant simply getting fast and typo-tolerant search out of the box. However, Algolia is way more than speed and typo tolerance. On par with speed, there’s also relevance — having the best matching records always appear at the top of your results. To achieve this, you’ll need to set up a few basics. Scout Extended gives you direct access to these and other settings through Laravel Artisan Commands.

Easier access to configuring Algolia is only one of the extensions we’ve added on top of Laravel Scout. Another feature of equal importance is support for aggregators: now you can centralize your search, creating a single point of entry for your entire website. Other improvements include full reindexing without any downtime for your users, extending the search builder, getting status overviews, and many other features. Let’s get into some of the details.

If you prefer to watch vs. read, here is a talk I recently gave on Scout Extended.

Aggregators — multiple models in one index

An aggregator is a clean way to implement site-wide search among multiple models. In other words, it allows you to have multiple models in one index.

To create a new aggregator, use the scout:make-aggregator Artisan command. This command will create a new aggregator class in the app/Search directory:

php artisan scout:make-aggregator News

After generating your aggregator, you should fill the $models property of the class, which will be used to identify the models that should be aggregated:

An aggregator is a standard searchable class, and, as usual, you may begin searching on the aggregator using the search method or the raw method:

To learn more about Aggregators in Scout Extended, please review the Scout Extended Documentation.

Zero downtime reimports — painless to deploy

With Scout Extended, it’s a breeze to import data in production. To keep your existing search experience available while reimporting your data, use the scout:reimport Artisan command:

php artisan scout:reimport

This Artisan command will output the following content:

To ensure that searches performed on the index during the rebuild will not be interrupted, Scout Extended uses a temporary index to import all records before moving the temporary index to the production index. We have you covered.

Configuring Algolia from within Laravel

You’ll start with the scout:optimize Artisan command, to optimize the search experience based on information from the searchable class:

php artisan scout:optimize

This might be sufficient. scout:optimize does its best to generate the settings of your searchable class index, but you may need to edit those settings in config/scout-articles.php. For example, two of the most important configurations to get right are searchable attributes and custom ranking:

Once you have verified the settings file, all you need to do is synchronize the settings with Algolia using the scout:sync Artisan command:

php artisan scout:sync

You may also edit settings using the Algolia Dashboard. However, make sure you apply those settings locally running the scout:sync Artisan command.

An improved search builder

Scout Extended pushes the Laravel Scout’s search builder to the next level, adding new methods and improving the existing ones. Here are some examples.

  • where

The where method may be used to compare a field’s value against another value. With Scout Extended, this method shares the same API of the Laravel Query Builder, allowing you to filter results either via a comparison or a range numerically:

The supported operators are: <, <=, =, !=, >=, >.

  • whereBetween

The whereBetween method verifies that a field’s value is between two values:

You can do the same with whereIn, with, count, and aroundLatLng. Head over to Scout Extended Documentation to find out more about this.

Status overviews

Scout Extended provides a beautiful overview of your application indexes, allowing you to easily monitor the number of records, among other key metrics.

To get an overview of your application indexes, use the scout:status Artisan command:

php artisan scout:status

This Artisan command will output a table with the following content:

And more!

Scout Extended is 100% open source, so you’re free to dig through the source code to see exactly how it works. Dig right in! Visit the Scout Extended documentation.

See something that needs to be improved? Just send us a pull request on GitHub.

Thanks, we hope you enjoy this new release!

About the author
Nuno Maduro

Software engineer at Algolia

githubtwitter

Algolia documentation

Extensive, clear, and of course, searchable

Read the docs
Algolia documentation

Recommended Articles

Powered byAlgolia Algolia Recommend

Bringing the Missing Frontend Search Block to the Laravel Vue.js Community
engineering

Raymond Rutjes

Software Engineer

Inside the engine part 7 – Better relevance via dedup at query time
engineering

Julien Lemoine

Co-founder & former CTO at Algolia

Inside the Engine Part 8: Handling Advanced Search Use Cases
engineering

Julien Lemoine

Co-founder & former CTO at Algolia