How to search in multiple columns

inside my laravel project I just want the search to be limited to two columns of the index from the frontend side like a filter and not to hard code it to two columns for entire app. I am using algolia api with autocomplete.jquery.js. I have searched alot but all i am finding is facets and tags

Sorry, I don’t really understand what do you mean by “I just want the search to be limited to two columns”, what is a column?

I dont know what to say in algolia terms but if we compare the database table to algolia index then columns of the table or attributes of the table is what i am reffering two. Like my object has 4 attributes. I just want algolia to search in a single attribute all objects

If you want Algolia to search only in few attributes, you can use restrictSearchableAttributes.
If you want Algolia to “Return” only few attributes, you can use attributesToRetrieve.

By default, Algolia search in all (Searcheables) attributes and return all (Retrievable) attributes. You can configure the list of Retrievable/Unretrievable and Searcheables/Unsearchables attributes into your Algolia Dashboard (Indexe by indexe in the section “Display”).

thanku sir. One more question please. How to make search efficient with two search bars. one input for few attributes and one input for one attribute. then how to search or how to make an efficient query in this case

I think it’s will be much easier if you explain exactly what you try to do, eventually with few screenshots of your interface, because at this moment I don’t really know why you need to search fields instead of one.

To illustrate a search page with many different behavior, I can explain you how I build the search page of my Company based on AlgoliaSearch. What we have on my page:

  • Two columns of results (News and Reports; each category is a different Algolia index).
  • Fulltext search.
  • Tags to help the search.
  • Multiple filters.
  • Sorting options.

Group 4

The tags are stored directly on the objects reports/news, like that:

{"tags": ["France", "China", "Gucci"]}

And the search engine use the amazing autocomplete of Algolia restricted to the tags field. When we select a tag, we add a new filter with the tagname into the main search query.
Then, the “Fulltext” search is added as a query field in the Algolia search.

The Sorting is based on Algolia Replicas with different sorting strategie.
The multiples filters create a filter attribute, with a numeric filter (for date range). We use facets to generate all the values (and the “Search for facet values” to be able to do a search engine into the values). And for the date range, we use facetStats to know the oldest and newest date on the results.

The tags suggestion are also simply a facet based on the current search results. Hope it’s will help you to build your search page :slight_smile: .

Ok i am trying to search for an online job portal.

profession will be selected from three attributes of the jobs index, then
Location will be selected from one attribute. after that search button is clicked and i need to show this.

Now what should I do. i have done autocomplete on these two inputs