Match vs Term Query
"match" query, EK, "text" field, PAR, use, hoti, hai, — SEARCH, TERM, ko, USI, ANALYZER, se, GUZAARA, jaata hai, JO, INDEXING, ke, waqt, USE, HUA, THA — YE, USER-TYPED, SEARCHES, ke, liye, IDEAL, hai.
"term" query, EXACT, VALUE, MATCH, karti, hai — bina, KOI, ANALYSIS, ke. YE, "keyword" fields, boolean, fields, ya, NUMBERS, PAR, use, hoti, hai.
GET /products/_search
{ "query": { "match": { "title": "Wireless Mouse" } } }- match query = analyzed text field par, user-typed search ke liye
- term query = exact value match, koi analysis nahi
- term query ko "text" field par use karna common mistake hai
"match" query, EK, "text" field, PAR, use, hoti, hai, — SEARCH, TERM, ko, USI, ANALYZER, se, GUZAARA, jaata hai, JO, INDEXING, ke, waqt, USE, HUA, THA, (lowercase, tokenizing, waghera) — YE, USER-TYPED, SEARCHES, ke, liye, IDEAL, hai.
GET /products/_search
{ "query": { "match": { "title": "Wireless Mouse" } } }"term" query, EXACT, VALUE, MATCH, karti, hai — bina, KOI, ANALYSIS, ke. YE, "keyword" fields, boolean, fields, ya, NUMBERS, PAR, use, hoti, hai, JAHAN, EXACT, MATCH, chahiye, — jaise, "status:published".
GET /products/_search
{ "query": { "term": { "category.keyword": "Electronics" } } }