# Query Search by three fields

**URL:** https://forum.builder.io/t/query-search-by-three-fields/3761
**Category:** Technical Questions
**Created:** [June 22, 2023, 2:09pm UTC](https://forum.builder.io/t/query-search-by-three-fields/3761 "2023-06-22T14:09:20Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Shintaro](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@Shintaro](https://forum.builder.io/u/Shintaro)
#### Post date: [June 22, 2023, 2:09pm UTC](https://forum.builder.io/t/query-search-by-three-fields/3761/1 "2023-06-22T14:09:20Z")

</div>

Can someone help me with this?  
Using [https://cdn.builder.io/api/v3/content](https://cdn.builder.io/api/v3/content)  
I need to do a search query with three parameters  
I have tried with

```auto
{
  "limit": "25",
"collection": "content",
"query.published.$ne": "archived",
"query.$or[0].name.$regex": "(?i)Maxi",
"query.$or[1].data.param1.$regex": "(?i)Maxi"
"query.$or[2].data.param2.$regex": "(?i)Maxi"
}

```

but I got no results

If I put only

```auto
{
  "limit": "25",
"collection": "content",
"query.published.$ne": "archived",
"query.$or[0].name.$regex": "(?i)Maxi"
}

```

I got results

once I separate the query it brings results, all together, no results

thanks in advance

---

<div class="post-metadata">

### Author: ![manish-sharma](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@manish-sharma](https://forum.builder.io/u/manish-sharma)
#### Post date: [June 22, 2023, 6:16pm UTC](https://forum.builder.io/t/query-search-by-three-fields/3761/2 "2023-06-22T18:16:11Z")

</div>

Hello @Shintaro,

Welcome to the [builder.io](http://builder.io) forum.

Below is an example that does query search based on multiple fields

```auto
{
  'query.name.$eq': 'Qwik Blog 2023',
  'query.published.$ne': 'archived',
}

```

```auto
  const articles = await builder.getAll("blog-article", {
    limit: 30,
    query:{
      'name': {$ne: 'Qwik Blog 2023'},
      'lastUpdated': {$ne: "1686026776524"},
    },
  });

```

> [@Why is the query returning an empty array?](https://forum.builder.io/t/why-is-the-query-returning-an-empty-array/3315/3):
>
> Hi @matheusnogueira unfortunately, the syntax you referred to didn’t work. But I tried to change my query for the topic. // it works { "topic.id": { $eq: "..." } } // it doesn't work { "topic": { id: { $eq: "..." } } }

---

<div class="post-metadata">

### Author: ![Shintaro](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@Shintaro](https://forum.builder.io/u/Shintaro)
#### Post date: [June 23, 2023, 7:11am UTC](https://forum.builder.io/t/query-search-by-three-fields/3761/3 "2023-06-23T07:11:13Z")

</div>

Thanks for the reply, but I think it does not solve my issue…  
Please have a look on these images, I’m trying to do a search for content in [builder.io](http://builder.io) search

 ![14](https://us1.discourse-cdn.com/flex020/uploads/builder/original/2X/3/3742569467083edec129bcc02c7e021004e20d98.png)  
 ![15](https://us1.discourse-cdn.com/flex020/uploads/builder/original/2X/0/0c188b5474755716a4f26c80471b8969f460af05.png)  
 ![16](https://us1.discourse-cdn.com/flex020/uploads/builder/original/2X/5/53d3018286e9af5809790b90e10780d25cacdb8e.png)  
 ![18](https://us1.discourse-cdn.com/flex020/uploads/builder/original/2X/b/b8e3876d7435e229705f9d4d35daaa2ae48f3c11.png)

As you can see if I search for Maxi on previewDescription it does not returns results.

Thanks

---

<div class="post-metadata">

### Author: ![manish-sharma](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@manish-sharma](https://forum.builder.io/u/manish-sharma)
#### Post date: [June 23, 2023, 5:53pm UTC](https://forum.builder.io/t/query-search-by-three-fields/3761/4 "2023-06-23T17:53:54Z")

</div>

Hello @Shintaro,

We were able to verify that this could be a potential bug in our SDK, and we have escalated it internally to our engineering team for further investigation and final resolution.

We will let you know when it is fixed.

If it helps you can try the below query, which seems to work when using multiple search fields

Note: Update [builder-model-id] and [your-builder-api-key] with your own

`https://cdn.builder.io/api/v3/data?limit=25&collection=content&query.published.$ne=archived&query.$or[0].name.$regex=%28%3Fi%29Maxi&query.$or[1].data.param1.$regex=%28%3Fi%29Maxi&query.$or[2].data.param2.$regex=%28%3Fi%29Maxi&query.modelId=[builder-model-id]&query.ownerId=[your-builder-api-key]&cachebust=true&offset=0&noTraverse=true&__db=1&weakTarget=true&sort.priority=1&omit=data.blocks,data.jsCode,data.tsCode,data.cssCode&apiKey=[your-builder-api-key]`
