How to do one search with 2 texts

Hey guys :grinning:

So I have an index where I put all the users posts of my application. Each posts has an attribute “location” and an attribute “name”.

I want to search the index by passing two strings, one corresponding to the location and another for the name of the publication and I want the returned hits to answer the 2 strings.

In SQL, I will have done something like this:

SELECT * FROM POSTS WHERE name LIKE "%name%" and location LIKE "%location%

I have tried a few things with “multipleQueries” but I realize that this is not what I want given that the queries are done separately.

So I wonder if Algolia allows a way to search according to 2 texts like in SQL

If not what are my possibilities ?

Thanks a lot

Hi @philippe.vincent.3, The Algolia search works more like a Google search than a database search. One thing you might try is to use a filter for one of the attributes. You could search by name and filter by location so that you only retrieved results that matched the name and filtered down by the location.

2 Likes

Wow thanks you very much for the answer ! I will try that right now :slight_smile:

1 Like