Search by Algolia
Building a performant search bar in Nuxt with Algolia & Storefront UI
engineering

Building a performant search bar in Nuxt with Algolia & Storefront UI

In today's highly competitive e-commerce landscape, providing customers with a seamless and efficient search experience can make all ...

Jakub Andrzejewski

Senior Developer and Dev Advocate at Vue Storefront

How to use AI to build your business
ai

How to use AI to build your business

The world of technology is constantly evolving with generative Artificial Intelligence (AI) currently leading the charge. We’re suddenly surrounded ...

Abhijit Mehta

Director of Product Management

Haystack EU 2023: Learnings and reflections from our team
ai

Haystack EU 2023: Learnings and reflections from our team

If you have built search experiences, you know creating a great search experience is a never-ending process: the data ...

Paul-Louis Nech

Senior ML Engineer

What is k-means clustering? An introduction
product

What is k-means clustering? An introduction

Just as with a school kid who’s left unsupervised when their teacher steps outside to deal with a distraction ...

Catherine Dee

Search and Discovery writer

Feature Spotlight: Synonyms
product

Feature Spotlight: Synonyms

Back in May 2014, we added support for synonyms inside Algolia. We took our time to really nail the details ...

Jaden Baptista

Technical Writer

Feature Spotlight: Query Rules
product

Feature Spotlight: Query Rules

You’re running an ecommerce site for an electronics retailer, and you’re seeing in your analytics that users keep ...

Jaden Baptista

Technical Writer

An introduction to transformer models in neural networks and machine learning
ai

An introduction to transformer models in neural networks and machine learning

What do OpenAI and DeepMind have in common? Give up? These innovative organizations both utilize technology known as transformer models ...

Vincent Caruana

Sr. SEO Web Digital Marketing Manager

What’s the secret of online merchandise management? Giving store merchandisers the right tools
e-commerce

What’s the secret of online merchandise management? Giving store merchandisers the right tools

As a successful in-store boutique manager in 1994, you might have had your merchandisers adorn your street-facing storefront ...

Catherine Dee

Search and Discovery writer

New features and capabilities in Algolia InstantSearch
engineering

New features and capabilities in Algolia InstantSearch

At Algolia, our business is more than search and discovery, it’s the continuous improvement of site search. If you ...

Haroen Viaene

JavaScript Library Developer

Feature Spotlight: Analytics
product

Feature Spotlight: Analytics

Analytics brings math and data into the otherwise very subjective world of ecommerce. It helps companies quantify how well their ...

Jaden Baptista

Technical Writer

What is clustering?
ai

What is clustering?

Amid all the momentous developments in the generative AI data space, are you a data scientist struggling to make sense ...

Vincent Caruana

Sr. SEO Web Digital Marketing Manager

What is a vector database?
product

What is a vector database?

Fashion ideas for guest aunt informal summer wedding Funny movie to get my bored high-schoolers off their addictive gaming ...

Vincent Caruana

Sr. SEO Web Digital Marketing Manager

Unlock the power of image-based recommendation with Algolia’s LookingSimilar
engineering

Unlock the power of image-based recommendation with Algolia’s LookingSimilar

Imagine you're visiting an online art gallery and a specific painting catches your eye. You'd like to find ...

Raed Chammam

Senior Software Engineer

Empowering Change: Algolia's Global Giving Days Impact Report
algolia

Empowering Change: Algolia's Global Giving Days Impact Report

At Algolia, our commitment to making a positive impact extends far beyond the digital landscape. We believe in the power ...

Amy Ciba

Senior Manager, People Success

Retail personalization: Give your ecommerce customers the tailored shopping experiences they expect and deserve
e-commerce

Retail personalization: Give your ecommerce customers the tailored shopping experiences they expect and deserve

In today’s post-pandemic-yet-still-super-competitive retail landscape, gaining, keeping, and converting ecommerce customers is no easy ...

Vincent Caruana

Sr. SEO Web Digital Marketing Manager

Algolia x eTail | A busy few days in Boston
algolia

Algolia x eTail | A busy few days in Boston

There are few atmospheres as unique as that of a conference exhibit hall: the air always filled with an indescribable ...

Marissa Wharton

Marketing Content Manager

What are vectors and how do they apply to machine learning?
ai

What are vectors and how do they apply to machine learning?

To consider the question of what vectors are, it helps to be a mathematician, or at least someone who’s ...

Catherine Dee

Search and Discovery writer

Why imports are important in JS
engineering

Why imports are important in JS

My first foray into programming was writing Python on a Raspberry Pi to flicker some LED lights — it wasn’t ...

Jaden Baptista

Technical Writer

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