카우치베이스 모바일 2.0은 JSON 문서에 강력한 전체 텍스트 검색(FTS) 기능을 도입합니다. 이는 다음을 기반으로 하는 새로운 쿼리 인터페이스의 일부입니다. N1QL는 JSON용 SQL을 확장하는 Couchbase의 선언적 쿼리 언어입니다. SQL에 익숙하다면 새로운 API의 의미를 쉽게 이해할 수 있을 것입니다.
전체 텍스트 검색을 사용하면 자연스러운 언어 쿼리가 가능합니다. 이 글은 Couchbase Lite의 쿼리 인터페이스에 대해 설명하는 시리즈 글 중 세 번째 글입니다. 이 블로그에서는 기본 사항을 잘 알고 있다고 가정하므로, 아직 기본 사항을 숙지하지 않은 경우 이전 게시물 를 먼저 읽어 보세요. 관심이 있으시다면 이 글의 끝에 쿼리 인터페이스의 다른 기능에 대해 설명하는 블로그 링크가 제공됩니다.
다음에서 최신 Couchbase Mobile 2.0 시험버전을 다운로드할 수 있습니다. 여기.
배경
1.x 버전의 Couchbase Mobile을 사용 중이라면 다음과 같은 내용을 잘 알고 계실 것입니다. 맵 보기 를 사용하여 인덱스와 쿼리를 만들 수 있습니다. 2.0에서는 더 이상 뷰와 맵 함수를 만들 필요가 없습니다! 대신, 간단한 인터페이스를 통해 인덱스를 생성하고 쿼리 빌더 인터페이스를 사용해 쿼리를 구성할 수 있습니다. 새로운 쿼리 인터페이스는 사용하기 더 간단하고 훨씬 더 강력합니다. 이 글에서 몇 가지 기능을 살펴보겠습니다.
샘플 프로젝트
여기서 설명하는 예제에서는 iOS용 Swift를 사용하지만, 몇 가지 사소한 차이점을 제외하면 동일한 쿼리 인터페이스가 Android 및 Windows 플랫폼에서도 지원된다는 점에 유의하세요.
따라서 약간의 수정만 하면 다른 플랫폼에서 작업할 때 이 글의 쿼리 예제를 재사용할 수 있습니다.
샘플 Swift 프로젝트에 관심이 있다면 아래 지침을 따르세요.
- GitHub에서 iOS Swift 플레이그라운드 복제하기
1$ git clone https://github.com/couchbaselabs/couchbase-lite-ios-api-playground - 해당 항목의 설치 지침을 따르세요. README 파일을 사용하여 플레이그라운드를 빌드하고 실행합니다.
샘플 데이터 모델
당사는 다음 위치의 여행 샘플 데이터베이스를 사용합니다. 여기. 이 사전 구축된 데이터베이스를 모바일 애플리케이션에 임베드하여 쿼리에 사용할 수 있습니다.
샘플 데이터 세트에는 다음과 같이 여러 유형의 문서가 포함되어 있습니다. 유형 속성을 추가합니다. 다음과 같은 문서에 초점을 맞출 것입니다. 유형 "랜드마크" . JSON 문서 모델은 아래와 같습니다. 간결성을 위해 아래 모델에서 이 게시물과 관련이 없는 일부 속성은 생략했습니다.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
{ "activity": "see", "address": "84 rue Claude Monet", "alt": "Fondation Claude Monet", "city": "Giverny", "content": "the house is quietly eccentric and highly interesting in an Orient-influenced style, and includes Monet's collection of [https://www.intermonet.com/japan/ Japanese prints]. There are no original Monet paintings on the site - the real drawcard, is the gardens around the house ...", "country": "France", "directions": null, "email": null, "geo": { "accuracy": "ROOFTOP", "lat": 49.0753489, "lon": 1.5337884 }, "hours": "open April-October Mo-Su 9:30-18:00", "id": 10061, "image": null, "name": "Monet's House", "phone": "+33 232512821", "price": "€9, $5 students, €4 4.00 disabled, under-7s free", "state": "Haute-Normandie", "title": "Giverny", "tollfree": null, "type": "landmark", "url": "https://www.fondation-monet.com/" } |
** 아래의 각 쿼리 예제는 위의 모델을 참조하세요. **
데이터베이스 핸들
아래 쿼리에서는 다음과 같이 데이터베이스 API를 사용하여 CouchbaseLite 데이터베이스를 열거나 생성합니다.
|
1 2 |
var options = DatabaseConfiguration() let db = try Database(name: kDBName, config: options) |
기본 사항
전체 텍스트 검색을 통해 자연스러운 언어 쿼리가 가능합니다. 저희의 게시물에서 쿼리 기본 사항에 대해 논의했습니다. 같은 그리고 정규식 표현식을 사용하여 패턴 일치 작업을 수행할 수 있습니다. FTS는 다음을 지원하여 해당 기능을 대체합니다. 스템밍, 관련성 기반 순위 그리고 로캘별 자연어 쿼리.
전체 텍스트 검색은 다음과 같습니다. 대소문자 구분 없음 를 사용하여 일치 쿼리 표현식을 사용합니다. FTS를 수행하려면 다음을 만들어야 합니다. 전체 텍스트 색인 를 적절한 속성에 추가합니다. 하나 이상의 속성에 인덱스를 만들 수 있습니다.
스템밍
예제를 진행하기 전에 먼저 어간 축약에 대해 한 마디 하겠습니다. 어간화란 단어를 어근 어간으로 축소하는 과정을 말합니다. 따라서 인스턴스, "catty", "catlike", "cats"는 "고양이"라는 단어로 축소됩니다. 따라서 '고양이'라는 용어를 검색하면 '고양이', '고양이 같은' 등과 일치하는 결과를 얻을 수 있습니다.
카우치베이스 라이트는 현재 다음 언어의 스템밍을 지원합니다.
* 덴마크어
* 네덜란드어
* 영어
* 핀란드어
* 프랑스어
* 독일어
* 헝가리어
* 이탈리아어
* 노르웨이어
* 포르투갈어
* 로마자
* 러시아어
* 스페인어
* 스웨덴어
* 터키어
특정 언어가 사용되지 않는 경우에도 토큰화 도구는 텍스트를 유니코드 공백 문자로 단어로 분할합니다. 따라서 단어 사이에 공백을 넣는 모든 언어에서 잘 작동하지만 덜 잘 작동합니다.
전체 텍스트 색인
그리고 이름 를 생성할 때 인덱스와 연관된 이름을 지정하는 것이 중요합니다. 나중에 보게 될 쿼리 예제에서는 이름을 통해 적절한 인덱스를 참조합니다.
단일 속성 색인
다음 예제에서는 전체 텍스트 인덱스 에서 "content" 속성의 문서. 스템밍은 기본적으로 활성화되어 있으며 로캘은 디바이스의 로캘로 가정합니다. 아래에는 표시되지 않았지만, '악센트'를 무시할지 여부를 지정하는 옵션도 있습니다. 무시 악센트 옵션을 설정합니다. 기본적으로 악센트는 무시되지 않습니다.
|
1 2 |
let ftsIndex = IndexBuilder.fullTextIndex(items: FullTextIndexItem.property("content")) try db.createIndex(ftsIndex,withName: "ContentFTSIndex") |
다중 속성 색인
다음 예제에서는 전체 텍스트 인덱스 on "content" 그리고 "name" 속성의 문서
|
1 2 |
let ftsIndex = IndexBuilder.fullTextIndex(items: FullTextIndexItem.property("content"),FullTextIndexItem.property("name")) try db.createIndex(ftsIndex,withName: "ContentAndNameFTSIndex") |
줄임말 없이 색인 생성
다음 예제에서는 전체 텍스트 인덱스 에서 "content" 속성의 문서 를 비활성화한 상태입니다. 기본적으로 현재 디바이스 언어 설정을 사용하여 형태소 분석이 활성화됩니다. 언어를 nil로 설정하면 형태소 분석이 비활성화됩니다.
|
1 2 |
let ftsIndex = IndexBuilder.fullTextIndex(items: FullTextIndexItem.property("content")).language(nil) try db.createIndex(ftsIndex,withName: "ContentFTSIndexNoStemming") |
스템밍을 사용한 FTS 검색
아래 쿼리는 id 그리고 콘텐츠 속성의 "랜드마크" 유형 용어가 포함된 문서 "기계" 에서 "content" 속성입니다. 우리는 "ContentFTSIndex" 를 만들었습니다.
요청
|
1 2 3 4 5 6 7 8 9 |
let ftsExpression = FullTextExpression.index("ContentFTSIndex") let searchQuery = QueryBuilder .select(SelectResult.expression(Meta.id), SelectResult.expression(Expression.property("content"))) .from(DataSource.database(db)) .where( Expression.property("type").equalTo(Expression.string ("landmark")) .and( ftsExpression.match("Mechanical"))) .limit(Expression.int(limit)) |
샘플 응답
위의 쿼리에 대한 응답에는 "기계", "메커니즘", "메커니즘", "기계공" 등의 용어가 포함된 문서가 포함됩니다.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
[ { "id": "landmark_21703", "content": "The Swiss luxury watch manufacturer, founded in 1851, is known for precise mechanics." }, { "id": "landmark_2592", "content": "Here you can see the mechanisms that drive San Francisco's famed cable cars, as well as plenty of cable car memorabilia and information on the history of the cable cars." }, { "id": "landmark_26144", "content": "This scenic section of the Golden Gate National Recreation Area is a favorite for hikers, bikers and beach-goers, with rugged coastal highlands and deep sand dunes. Hang gliding is quite popular here, with several shops for hang gliders in the area. Nearby is the remnants of Battery Davis, a WWII-era military defense mechanism." }, { "id": "landmark_33234", "content": "Western-style steakhouse features a huge, ‘country’ bar and even a mechanical bull for those ready for a faux bull-riding adventure. The menu is vast and surprisingly inexpensive. And again, the saloon is a longtime trendy destination along the Sunset Strip for raucous good times." } ] |
FTS 검색 없이 스템밍
아래 쿼리는 id 그리고 콘텐츠 속성의 "랜드마크" 유형 정확한 용어가 포함된 문서 "기계" 에서 "content" 속성입니다. 우리는 "ContentFTSIndexNoStemming" 를 생성하여 스템밍을 비활성화하는 옵션을 지정했습니다.
요청
|
1 2 3 4 5 6 7 8 |
let ftsExpression = FullTextExpression.index("ContentFTSIndexNoStemming") let searchQuery = QueryBuilder .select(SelectResult.expression(Meta.id), SelectResult.expression(Expression.property("content"))) .from(DataSource.database(db)) .where(Expression.property("type").equalTo(Expression.string ("landmark")) .and( ftsExpression.match("Mechanical"))) .limit(Expression.int(limit)) |
샘플 응답
위의 쿼리에 대한 응답에는 "기계적"이라는 용어가 정확히 포함된 문서가 포함됩니다. 모든 검색은 대소문자를 구분하지 않는다는 점에 다시 한 번 유의하세요.
|
1 2 3 4 5 6 7 |
[ { "id": "landmark_33234", "content": "Western-style steakhouse features a huge, ‘country’ bar and even a mechanical bull for those ready for a faux bull-riding adventure. The menu is vast and surprisingly inexpensive. And again, the saloon is a longtime trendy destination along the Sunset Strip for raucous good times." } ] |
여러 속성에서 FTS 검색
아래 쿼리는 id , 이름 그리고 콘텐츠 속성의 "랜드마크" 유형 용어가 포함된 문서 "기계" 중 하나에서 "name" 또는 "content" 속성입니다. 우리는 "ContentAndNameFTSIndex" 를 생성했습니다. 이 인덱스를 사용하면 "name" 그리고 "content" 속성
요청
|
1 2 3 4 5 6 7 8 9 |
let ftsExpression = FullTextExpression.index("ContentAndNameFTSIndex") let searchQuery = QueryBuilder .select(SelectResult.expression(Meta.id), SelectResult.expression(Expression.property("name")), SelectResult.expression(Expression.property("content"))) .from(DataSource.database(db)) .where(Expression.property("type").equalTo(Expression.string ("landmark")) .and( ftsExpression.match("Mechanical"))) .limit(Expression.int(limit)) |
샘플 응답
위 쿼리에 대한 응답에는 '이름' 또는 '콘텐츠' 속성 중 하나에 '기계적'(또는 어간을 통해 파생된 변형)이라는 용어가 포함된 문서가 포함됩니다.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
[ { "id": "landmark_10062", "name": "Natural Mechanical Museum", "content": "Founded by the Guillemard brothers: Jean-pierre, René and Gérard currently run restorations and exhibitions with the help of an enthusiasts team who devoted their time and known-how to the Patrimony preservation. The museum origin is a private collection of steam internal combustion engines; founded in 1955 by the Guillemard family a GIVERNY residents since generations." }, { "id": "landmark_21703", "name": "Patek Philippe Salons", "content": "The Swiss luxury watch manufacturer, founded in 1851, is known for precise mechanics." }, { "id": "landmark_25929", "name": "Cable Car Museum", "content": "Here you can see the mechanisms that drive San Francisco's famed cable cars, as well as plenty of cable car memorabilia and information on the history of the cable cars" }, { "id": "landmark_26144", "name": "Fort Funston", "content": "This scenic section of the Golden Gate National Recreation Area is a favorite for hikers, bikers and beach-goers, with rugged coastal highlands and deep sand dunes. Hang gliding is quite popular here, with several shops for hang gliders in the area. Nearby is the remnants of Battery Davis, a WWII-era military defense mechanism" } ] |
논리 표현식을 사용한 FTS 검색
앞의 예제에서는 형태소 분석을 비활성화하면 정확한 검색 문자열을 찾을 수 있다는 것을 보았습니다. 하지만 두 개 이상의 검색어를 찾고 싶다면 어떻게 해야 할까요? 검색어 일치 쿼리 표현식은 AND 및 OR을 포함한 논리 표현식을 허용합니다.
아래 쿼리는 id 및 콘텐츠 속성의 "랜드마크" 유형 용어가 포함된 문서 "기계" 또는 "메커니즘" 에서 "content" 속성입니다. 우리는 "ContentFTSIndexNoStemming" 를 사용하여 스템밍을 비활성화할 수 있습니다.
요청
|
1 2 3 4 5 6 7 8 |
let ftsExpression = FullTextExpression.index("ContentFTSIndexNoStemming") let searchQuery = QueryBuilder .select(SelectResult.expression(Meta.id), SelectResult.expression(Expression.property("content"))) .from(DataSource.database(db)) .where(Expression.property("type").equalTo(Expression.string ("landmark")) .and( ftsExpression.match("Mechanical OR Mechanism"))) .limit(Expression.int(limit)) |
샘플 응답
위의 쿼리에 대한 응답에는 '콘텐츠' 속성에 '기계적' 또는 '메커니즘'이라는 용어가 정확히 포함된 문서가 포함됩니다.
|
1 2 3 4 5 6 7 8 9 10 11 |
[ { "id": "landmark_26144", "content": "This scenic section of the Golden Gate National Recreation Area is a favorite for hikers, bikers and beach-goers, with rugged coastal highlands and deep sand dunes. Hang gliding is quite popular here, with several shops for hang gliders in the area. Nearby is the remnants of Battery Davis, a WWII-era military defense mechanism" }, { "id": "landmark_33234", "content": "Western-style steakhouse features a huge, ‘country’ bar and even a mechanical bull for those ready for a faux bull-riding adventure. The menu is vast and surprisingly inexpensive. And again, the saloon is a longtime trendy destination along the Sunset Strip for raucous good times." } ] |
윌카드 표현식을 사용한 FTS 검색
검색 문자열에 "*" 문자를 사용하여 일치하는 문자가 0개 이상임을 나타낼 수 있습니다.
아래 쿼리는 id 및 콘텐츠 속성의 "랜드마크" 유형 용어가 포함된 문서 "walt*" 에서 "content" 속성을 입력합니다. 이렇게 하면 'walt'로 시작하여 0자 이상으로 끝나는 모든 검색어가 일치합니다. 여기서는 "ContentFTSIndex" 를 만들었습니다.
참고: 검색어에 와일드카드를 사용하는 것이 어간화를 구현하는 순진한 방법이라고 주장할 수도 있습니다. 하지만 그렇게 되면 어간을 통해 파생된 용어와 일치하지 않을 수 있는 파생 형태가 나올 수 있습니다. 따라서 필요한 경우에만 스템밍을 사용하는 것이 바람직합니다.
요청
|
1 2 3 4 5 6 7 8 |
let ftsExpression = FullTextExpression.index("ContentFTSIndex") let searchQuery = QueryBuilder .select(SelectResult.expression(Meta.id), SelectResult.expression(Expression.property("content"))) .from(DataSource.database(db)) .where(Expression.property("type").equalTo(Expression.string ("landmark")) .and( ftsExpression.match("walt*"))) .limit(Expression.int(limit)) |
샘플 응답
위 쿼리에 대한 응답에는 "walt", "Walter", "Waltham", "Walthamstow" 등의 용어가 포함된 문서가 포함됩니다.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
[ { "id": "landmark_10134", "content": "On the Ibrox tour, you get access to the home dressing room and hear a recorded message from Walter Smith and Ally McCoist before climbing the marble staircase, visit the illustrious trophy room, the blue room and the managers office. Tickets, except for matches against Celtic, are available online from the clubs website, ticket centre at the stadium and club outlets at JJB Sports Stores in Glasgow city centre." }, { "id": "landmark_16104", "content": "Presents the history of Waltham Forest. The building was constructed to be a work house and has since been used as a police station and a private home. Its collection includes the Bremer car, built by engineer Frederick Bremer in 1892 it has a claim to being this first petrol-driven car made in Britain." }, { "id": "landmark_16105", "content": "The ancient nucleus of present day Walthamstow centred around the 12 th century St.Marys Church " }, { "id": "landmark_16574", "content": "Impressive hall architecture complete with tours most days.The Dorothy Chandler Pavilion is open to the public Christmas Eve day with almost round the clock performances by amateur cultural arts groups.The Walt Disney Hall has daily tours ,check website for schedules." }, { "id": "landmark_8631", "content ": "Museum about famous Scottish authors, focussing on Robert Burns, Sir Walter Scott and Robert Louis Stevenson " } ] |
중지 단어를 사용한 FTS 검색
중지 단어는 한 언어의 일반적인 단어를 의미합니다. 영어에서는 "the", "is", "and" , "which" 등과 같은 용어가 이에 해당합니다.
예 1: 검색 문자열에 중지어가 포함된 경우
카우치베이스 라이트는 검색 문자열에 나타나는 중지 단어를 무시합니다.
아래 쿼리는 id 및 콘텐츠 속성의 "랜드마크" 유형 용어가 포함된 문서 "기록에" 에서 "content" 속성입니다. 우리는 "ContentFTSIndex" 를 만들었습니다.
카우치베이스 라이트는 중지 단어 "on"과 "the"를 무시하므로 "history"라는 용어와 어간 단어의 파생 형태만 포함된 문서를 가져올 수 있습니다.
요청
|
1 2 3 4 5 6 7 |
let ftsExpression = FullTextExpression.index("ContentFTSIndex") let searchQuery = QueryBuilder.select(SelectResult.expression(Meta.id), SelectResult.expression(Expression.property("content"))) .from(DataSource.database(db)) .where(Expression.property("type").equalTo(Expression.string ("landmark")) .and( ftsExpression.match("on the history"))) .limit(Expression.int(limit)) |
샘플 응답
위 쿼리에 대한 응답에는 "역사"라는 용어와 이 단어의 파생 형태인 "역사적" 등의 용어가 포함된 문서가 포함됩니다.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
[ { "id": "landmark_10019", "content": "Museum on military engineering and the history of the British Empire. A quite extensive collection that takes about half a day to see. Of most interest to fans of British and military history or civil engineering." }, { "id": "landmark_10083", "content": " Tours take about 45 min. In front the building, George Square, the citys notional centre, is populated by several statues of civic leaders and famous figures from history and is often used for outdoor events." }, { "id": "landmark_10093", "content": "The auditorium has now garnered some world fame for being the place where the Susan Boyle audition - one of the most downloaded YouTube video clips in history - was filmed." }, { "id": "landmark_10101", "content": "This museum has a large collection of artifacts and exhibits showcasing the history of the city. If you don't want to pay to enter the museum itself, you can just walk into the building (which contains three separate museums) and look at some historical photographs on the walls of the atrium." }, { "id": "landmark_10105", "content": "The Peoples Palace is a great folk museum, telling the history of Glasgow and its people, from various perspectives, displaying details of Glasgow life (including one of Billy Connolly's banana boots). The Winter Gardens, adjacent, is a pleasant greenhouse with a reasonable cafe.)" } ] |
예 2: 검색 중 중지 단어 무시하기
기본적으로 카우치베이스 라이트는 검색 콘텐츠 내의 중지 단어를 무시합니다.
아래 쿼리는 id 및 콘텐츠 속성의 "랜드마크" 유형 약관이 포함된 문서 "파란 지느러미 노란 지느러미" 에서 "content" 속성입니다. 우리는 "ContentFTSIndex" 를 만들었습니다.
카우치베이스 라이트는 검색 시 중지어를 무시하므로 '파란색', '지느러미', '노란색'이라는 용어가 포함된 문서를 중지어로 구분된 순서대로 가져올 수 있습니다.
요청
|
1 2 3 4 5 6 7 |
let ftsExpression = FullTextExpression.index("ContentFTSIndex") let searchQuery = QueryBuilder.select(SelectResult.expression(Meta.id), SelectResult.expression(Expression.property("content"))) .from(DataSource.database(db)) .where(Expression.property("type").equalTo(Expression.string ("landmark")) .and( ftsExpression.match("blue fin yellow fin"))) .limit(Expression.int(limit))<code class="swift"> |
샘플 응답
위 쿼리에 대한 응답에는 "파란색", "지느러미", "노란색"이라는 용어가 "파란색 지느러미, 노란색 지느러미"와 같이 원하는 수의 쉼표로 구분된 문서가 포함됩니다.
|
1 2 3 4 5 6 7 |
[ { "id": "landmark_18840", "content": "This large aquarium specializes in exhibiting local sea life in typical local habitat displays, and has many spectacular exhibits. It is particularly known for its Kelp Forest exhibit, three stories high, filled with several varieties of giant kelp and a wide variety of marine animal species, and also for its million-gallon Open Sea exhibit with large blue fin and yellow fin tunas, mahi-mahis, sharks (including an occasional Great White Shark as a very temporary visitor, before being released back to the ocean), ocean sunfish (mola-molas) and sea turtles. The best exhibits include a large tank of silver sardines that swim around and around above one's head, and one of rescued sea otters deemed unreturnable to the wild and therefore kept at the aquarium. )" } ] |
순위가 있는 FTS 검색
다음을 사용할 수 있습니다. 풀텍스트 함수 순위 을 클릭하여 검색 결과의 순위 순서를 지정할 수 있습니다. 가장 일치하는 순서대로 일치하는 항목을 평가하는 데 유용합니다.
아래 쿼리는 id 및 콘텐츠 속성의 "랜드마크" 유형 용어가 포함된 문서 "유치" 에서 "content" 속성으로 설정합니다. 문서는 순위에 따라 내림차순으로 정렬되므로 일치 항목 수가 가장 많은 문서가 나머지 문서보다 높게 정렬됩니다.
요청
|
1 2 3 4 5 6 7 8 |
let ftsExpression = FullTextExpression.index("ContentFTSIndexNoStemming") let searchQuery = QueryBuilder.select(SelectResult.expression(Meta.id), SelectResult.expression(Expression.property("content"))) .from(DataSource.database(db)) .where(Expression.property("type").equalTo(Expression.string ("landmark")) .and( ftsExpression.match("attract"))) .orderBy(Ordering.expression(FullTextFunction.rank("ContentFTSIndexNoStemming")).descending()) .limit(Expression.int(limit)) |
샘플 응답
위 쿼리에 대한 응답에는 다음과 같은 용어가 포함된 문서가 포함됩니다. "유치" 또는 파생된 버전입니다. 최대 일치 문서 수가 많은 문서가 더 높게 정렬됩니다.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
[ { "id": "landmark_22056", "content": "Top paid-for visitor attraction in Wales including a farm, indoor vintage funfair, zoo and indoor and outdoor adventure play. All-weather family attraction with 50% of attractions undercover." }, { "id": "landmark_16309", "content": "The London Bridge Experience and London Tombs are two scare attractions for one price and have been voted the UK's Best Year Round Scare Attraction for three years running." }, { "id": "landmark_25216", "content": "TA seaside amusement park located near the southern end of Mission Beach, Belmont Park is a landmark with a number of shops, restaurants, an arcade, and a bunch of rides. The big attraction is the Giant Dipper, a historic roller coaster that is one of the only two remaining oceanfront roller coasters still operating on the west coast. Among the other rides is a FlowRider (a simulated wave attraction which you can bodyboard on), an antique carousel, bumper cars, slides, pendulum rides, tilt-a-whirl, and a trampoline " }, { "id": "landmark_1059", "content": "Aims to tell the history of flight throughout the 20th Century, and has a large collection of aircraft, including British Airways Concorde G-BOAA. Another rather good attraction (and well worth the look) is the De-Havilland Comet 4C, a derivative of the Worlds first jetliner." } ] |
제한 사항
Couchbase Lite 2.0의 FTS 기능은 매우 강력하며 임베디드 데이터베이스의 일반적인 사용 사례에 충분하지만, 몇 가지 제한 사항이 있습니다.
- 일치 표현식은 최상위 또는 최상위 AND 표현식에만 사용할 수 있습니다. 즉, 다음과 같은 표현식은 허용되지 않습니다. ftsExpression.match("attract").or(ftsExpression2.match("museum"))
- 사용자 지정 언어 토큰화 도구
지원되는 언어 목록은 앞서 지정되었습니다. 이 글을 작성하는 현재로서는 다른 언어로 지원을 확장하기 위해 사용자 지정 토큰화 도구를 연결할 수 없습니다. - 퍼지 검색 지원
쿼리에 '퍼지' 요소를 지정하면 관련성이 낮은 일치 항목이 고려될 수 있습니다. - 패싯
패싯 검색은 지원되지 않습니다.
카우치베이스 라이트는 임베디드 데이터베이스라는 점을 명심하세요. 따라서 FTS 기능이 서버 측 데이터베이스 구현만큼 광범위할 필요는 없다고 주장할 수도 있습니다. 이에 대한 지원은 향후 릴리스에서 평가될 예정입니다.
다음 단계
이 블로그 게시물에서는 Couchbase Mobile 2.0의 새로운 쿼리 API에서 전체 텍스트 검색(FTS) 기능을 활용하는 방법에 대해 살펴보았습니다. 이것은 시작에 불과합니다. 향후 릴리스에서 더 많은 기능이 추가될 예정입니다. 최신 릴리스는 다음에서 다운로드할 수 있습니다. 다운로드 페이지로 이동합니다.
다음은 관심을 가질 만한 몇 가지 다른 Couchbase 모바일 쿼리 관련 게시물입니다.
- 이 블로그 게시물 기본 사항에 대해 설명합니다.
- 이 블로그 게시물 배열 컬렉션을 쿼리하는 방법에 대해 설명합니다.
- 이 블로그 게시물 조인 쿼리를 수행하는 방법에 대해 설명합니다.
질문이나 피드백이 있으면 아래에 댓글을 남기거나 트위터로 언제든지 문의해 주세요. @rajagp 또는 이메일을 보내주세요. priya.rajagopal@couchbase.com. . 카우치베이스 포럼 를 통해 질문할 수 있습니다.