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

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

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

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

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.

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