Smart Search
Smart-Search
データベース内の何百万ものエントリを簡単に検索できる予測検索API。 SQLite3を使用してAndroidアプリケーション/アプリケーションに最適な出力を提供するために、全文検索、ランキング、ステムの組み合わせ。
アプリリンク
予測検索とは何ですか?
一致するサブストリングを使用した高速検索に加えて、予測が行うことは、検索ワード、すなわち幹です。ルートを取得し、FTSテーブルで検索して一致のリストを取得し、一致する確率に基づいてリストをソートし、ソートされたリストを返します。
使い方
ビルドファイルに以下を追加します。
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
compile 'com.github.gauravat16:Smart-Search:1.2'
}
例
PredictiveSearch search = new PredictiveSearch(getApplicationContext());
ArrayList<String> columns = new ArrayList<>();
columns.add("<column-name>");
columns.add("<column-name>");
try {
search.createFTS4Table("<db-name.db>", "<table-name>", columns);
search.ftsRebuilder(); //Use it to rebulid after any change
ArrayList<String> resp1 = search.getSearchList("potatoes"); //Get result w/o stemming
ArrayList<String> resp2 = search.getPredictedList("try"); //Get result with stemming - predictive
} catch (Exception ex) {
ex.printStackTrace();
} finally {
search.close();
}
1。CreateFTS4Table(string dbtobesearched、string tableofdata、arrayList columnNames)
Creates/Builds the Full Text Search Virtual Table.
String DBTOBESEARは、スマート検索に必要なテーブルを持つデータベースの名前を検索しました。
String TableOfDataデータを含むテーブルの名前。
ArrayList列の名前上のすべての列のリスト。
2。ftsrebuilder()
Rebulids the FTS Virtual Table. Run this each time you make changes to your main database.
3。GetMatchesWostemming(String Partword)
returns the list of the words that match with your query. This is without stemming search.
4。string getMatchesWSTEMMING(string word)
Performs everything that getSearchList() does but with stemming. Use it for prediction.