Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

139
Views
¿Cómo obtener artículos si alguna palabra clave de búsqueda coincide?

Tengo este documento en mi base de datos elástica. Estoy usando este paquete https://www.npmjs.com/package/@elastic/elasticsearch

Estoy buscando en el title .

Estoy haciendo así.

 const result= await client.search({ index: 'products', "query": { "bool": { "should": [ { "wildcard": { "title": "*" + search + "*" } } ], "minimum_should_match": 1 } }

cuando busco "título" este issue . me da un resultado , pero cuando estoy buscando i have issue . está dando cero o 0 resultado. ¿Por qué? ¿Es posible obtener esos datos? La palabra clave de issue está presente en la primera colección ¿por qué no se selecciona?

 [ { "_index": "products", "_id": "wZRh3n8Bs9qQzO6fvTTS", "_score": 1.0, "_source": { "title": "laptop issues", "description": "laptop have issue present in according" } }, { "_index": "products", "_id": "wpRh3n8Bs9qQzO6fvzQM", "_score": 1.0, "_source": { "title": "buy mobile", "description": "mobile is in Rs 250" } }, { "_index": "products", "_id": "w5Rh3n8Bs9qQzO6fvzTz", "_score": 1.0, "_source": { "title": "laptop payment", "description": "laptop payment is given in any way" } } ]

¿Cómo buscar por palabras clave? cualquier coincidencia de palabra clave. Necesito elegir toda esa colección.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Si desea hacer coincidir solo parte de la palabra de la consulta, puede usar la match query con el operator establecido en or .

 { "query": { "match": { "title": { "query": "i have issues", "operator": "or" } } } }

Actualizar

Para ejecutar la consulta que mencionó en el comentario, puede usar la consulta match_bool_prefix .

 { "query": { "match_bool_prefix": { "title": { "query": "i have issu" } } } }
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!