Meet Objective Text Indexes: AI-Powered Semantic Search in a Few Lines of Code
The team here at Objective has been hard at work this month making Objective Search smarter and we’re excited to introduce you to Text Indexes, launching into self-service Beta today. If you don’t have an account yet, sign up today and check Objective out!
Searching for meaning, not just matches.
For most of our lives as web developers, we’ve used old search platforms (or hacked features together ourselves) that rely on ‘lexical’ search. Most of us know it as a ‘keyword’ search - search that compares two string values for equality (here’s looking at you, MySQL INSTR() 😘). There are some things lexical search is great at, like looking up names in an employee directory.
But there are a lot of things that are hard or just flat-out impossible with lexical search, because of the difference between matching and understanding meaning. Fortunately for your app, Objective Search is great at both.
Really smart search in a few lines of code
Objective Search speaks in meaning — taking your user’s search query, extracting the semantic meaning, and comparing it to the meaning of the Objects in your Object Store.
Let’s say you’re building product search for your fashion store, and you’ve added Objects to your Object Store that have name and color string attributes with product info, like this —
And let’s say your user searches for “dark green heavy winter coat”. Pretty reasonable, right?
Simple dictionary-lookup search would miss our Winter Wonderland Pea Coat Object entirely. But your Objective Search Indexes understand the meaning in the query, and know we’re looking for a winter coat. It also understands that forest green is semantically very similar to dark green. Which is good news for your user, who is now about to look pretty sharp this winter.
At it’s core, your Text Index understands the meaning of your user’s search query, understands the meaning of all of the string attributes of the Objects in your Object Store, and retrieves the most relevant results for your user. And that means more finding what they want. One of the best parts is how much power you get from a few lines of code.
First, jump into your CLI and grab our new Python lib (or Typescript, if that’s your flavor!) —
And then in your favorite .py file, let’s put some stuff in an Object Store —
Your Object Store has a few different Objects in it now - some are coats, some aren’t. Some are different kinds of green, some aren’t. Now let’s make your first Text Index —
All Objective Search Indexes process (and reprocess!) your Objects automatically. While an Index is processing, you can programmatically poll the status of Index processing by - you guessed it — calling status.
Index status() returns a queue of processing operations during this execution, that you can use to make decisions about how to wait or proceed:
Once everything has processed, all that’s left to do is run a search query and watch the magic happen. Let’s find that coat our user was looking for:
Your Text Index will look inside each Object in your Object Store and will prioritize the most relevant results first. There’s that coat we were after:
Notice that your Text Index knew we weren’t talking about the other coat we added that was a different green - and it knew we weren’t talking about either of the hats. It prioritized the forest green Winter Wonderland Coat. Let’s go ahead and find all the cold weather gear instead.
Your Text Index should come back with these snappy numbers prioritized first in the result set:
We think every website and every app gets better when every developer has powerful, production-ready, built-for-massive-scale AI-driven search in their toolbelt. If you have a Beta account, you can log in and get started today! If not, sign up today!
We can’t wait to see what you build!