phrase 12

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. Proximity Matching

Standard full-text search with TF/IDF treats documents, or at least each field within a document, as a big bag of words. The match query can tell us whether that bag contains our search terms, but that is only part of the story. It can’t tell us anything about the relationship between words.TF/IDF를 가진 표준 full-text 검색은, document나, 최소한 document내의 각각의 filed를, 단어가 들어 있는 큰 가방(bag of words) 으로 생각한다. 그..

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-3. Multivalue Fields

A curious thing can happen when you try to use phrase matching on multivalue fields. Imagine that you index this document:다중 값(multi-value) field에 구문 일치를 사용하는 경우, 특이한 상황이 발생할 수 있다. 아래 document를 색인한다고 가정해 보자.PUT /my_index/groups/1 { "names": [ "John Abraham", "Lincoln Smith"] }COPY AS CURLVIEW IN SENSE Then run a phrase query for Abraham Lincoln:그 다음에, Abraham Lincoln 에 대한 phrase query를 실행해 보자.GE..

2-4-6. Improving Performance

Phrase and proximity queries are more expensive than simple match queries. Whereas a matchquery just has to look up terms in the inverted index, a match_phrase query has to calculate and compare the positions of multiple possibly repeated terms.phrase와 proximity query는, 단순한 match query에 비해, 더 많은 비용이 든다. match query는 단어를 inverted index에서 찾는 반면에, match_phrase query는 가능한 한 여러 번, 반복해서 단어들의 위치를 계산하고 ..

2-4-7. Finding Associated

As useful as phrase and proximity queries can be, they still have a downside. They are overly strict: all terms must be present for a phrase query to match, even when using slop.phrase와 proximity query는 유용하지만, 단점이 있다. 지나치게 엄격하다. phrase query에 일치하기 위해, 심지어 slop 을 사용할 경우에도, 모든 단어가 반드시 존재해야 한다.The flexibility in word ordering that you gain with slop also comes at a price, because you lose the assoc..