# Query specific fields and field value must contains a value in nodejs

**URL:** https://discuss.elastic.co/t/query-specific-fields-and-field-value-must-contains-a-value-in-nodejs/265896
**Category:** Elasticsearch
**Created:** [March 2, 2021, 4:16am UTC](https://discuss.elastic.co/t/query-specific-fields-and-field-value-must-contains-a-value-in-nodejs/265896 "2021-03-02T04:16:42Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![pakwai122](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pakwai122/32/84087_2.png) [@pakwai122](https://discuss.elastic.co/u/pakwai122)
#### Post date: [March 2, 2021, 4:16am UTC](https://discuss.elastic.co/t/query-specific-fields-and-field-value-must-contains-a-value-in-nodejs/265896/1 "2021-03-02T04:16:42Z")

</div>

I'm using nodejs as the client slide to build a simple search engine with Elasticsearch  
my index has the following fields

```auto
"id": "75199",
"FoodID": "123",
"FoodCode": "F123",
"FoodNumber": "F567",
"DisplayName": "food food",
"ignore-field-name": "ignore this",
"status": "Existing" or "History"

```

======================================  
nodejs query

```auto
async function search(name) {

  const { body } = await client.search({
    index: INDEX_NAME,
    body: {
      query: {
        match: {
          DisplayName: {
              query: name,
              fuzziness: "AUTO"
          }
        }
      }
    }
  })

```

How can I query field only has "Existing" text and how can I set the field names with multiple boost?for example: DisplayName^10, FoodNumber^9, something like that. Also, if I want to ignore some fields for searching, how to write it in the query.I'm so new to elasticsearch, no idea how to query it, thanks.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [March 30, 2021, 4:17am UTC](https://discuss.elastic.co/t/query-specific-fields-and-field-value-must-contains-a-value-in-nodejs/265896/2 "2021-03-30T04:17:13Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
