DSFFullTextSearchIndex
1.0.0
간단한 iOS/macOS/TVOS 전체 텍스트 검색 (FTS) 클래스 SQLITE FTS5를 사용하는 클래스 외부 종속 방지가없는 SKSEARCHKIT와 유사한 API를 사용합니다.
MACOS/iOS 응용 프로그램에 전체 텍스트 검색 색인을 추가하고 싶었고 SKSearchKit (따라서 DFSearchKit은 MACOS 전용임을 깨달았습니다.
SQLITE는 견고한 FTS 기능을 통해 SkSearchKit과 유사한 방식으로이를 사용할 수 있기를 원했습니다. 또한 의존성이없는 간단한 래퍼를 원했습니다. GRDB를 좋아하는만큼 나는 그것이 제공하는 모든 것을 필요로하지 않았습니다.
나는 또한 둘 다 할 수있는 것을 원했다 :-
// Create an index
let index = DSFFullTextSearchIndex ( )
index . create ( filePath : /* some file path */ )
//
// Add some documents
//
let url1 = URL ( string : " demo://maintext/1 " )
index . add ( url : url1 , text : " Sphinx of black quartz judge my vow " )
let url2 = URL ( string : " demo://maintext/2 " )
index . add ( url : url2 , text : " Quick brown fox jumps over the lazy dog " )
let url3 = URL ( string : " demo://maintext/3 " )
index . add ( url : url3 , text : " The dog didn't like the bird sitting on the fence and left quietly " )
//
// Search
//
let urls1 = index . search ( text : " quartz " ) // single match - url1
let urls2 = index . search ( text : " quick " ) // single match - url2
let urls3 = index . search ( text : " dog " ) // two matches - url1 and url3
// Search with a wildcard
let urls4 = index . search ( text : " qu* " ) // three matches = url1 (quartz), url2 (quick) and url3 (quietly)Swift-DOC를 사용하여 생성됩니다.
MIT License
Copyright (c) 2020 Darren Ford
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.