match_phrase 4

1-01-11. Phrase Search

Finding individual words in a field is all well and good, but sometimes you want to match exact sequences of words or phrases. For instance, we could perform a query that will match only employee records that contain both "rock" and "climbing" and that display the words next to each other in the phrase "rock climbing".특정 field에서 개별적인 단어를 찾는 것은 잘 된다. 하지만 가끔씩 정확한 순서의 단어들이나 구(句, phrases) 로 일치하기를 원한..

2-4-1. Phrase Matching

In the same way that the match query is the go-to query for standard full-text search, the match_phrase query is the one you should reach for when you want to find words that are near each other:표준 full-text 검색에 대해, match query가 정보를 찾는 query인 것과 동일한 방식으로, match_phrasequery는 서로 가까이 있는 단어들을 찾는 경우에 사용할 query 중 하나이다.GET /my_index/my_type/_search { "query": { "match_phrase": { "title": "quick brown f..

2-4-2. Mixing It Up

Requiring exact-phrase matches may be too strict a constraint. Perhaps we do want documents that contain "quick brown fox" to be considered a match for the query "quick fox", even though the positions aren’t exactly equivalent.정확한 구문 일치를 요구하는 것은 너무 엄격한 제약사항이 될 수 있다. 아마도 "quick brown fox" 를 포함하는 document는 query "quick fox" 에 일치하는 것으로 간주하길 원할 것이다. 비록 그 위치가 정확히 일치하지 않더라도 말이다.We can introduce a degr..

2-4-5. Proximity for Relevance

Although proximity queries are useful, the fact that they require all terms to be present can make them overly strict. It’s the same issue that we discussed in Controlling Precision in Full-Text Search: if six out of seven terms match, a document is probably relevant enough to be worth showing to the user, but the match_phrase query would exclude it.proximity query가 유용하지만, 모든 단어가 존재해야 한다는 사실은, 너..