Smart Search
Smart-Search
一种预测性搜索API,可自由地自由搜索数据库中数百万个条目。全文搜索,排名和Stem的组合,为您使用SQLITE 3提供了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(字符串dbtobesearched,字符串tableofdata,arrayList columnNames)
Creates/Builds the Full Text Search Virtual Table.
字符串dbtobesearch搜索具有您要智能搜索表的数据库的名称。
字符串tableofdata包含数据的表的名称。
ArrayList列名称上表中的所有列的列表。
2。ftsrebuilder()
Rebulids the FTS Virtual Table. Run this each time you make changes to your main database.
3。getMatchesWostemming(字符串partword)
returns the list of the words that match with your query. This is without stemming search.
4。字符串getMatcheswstemming(字符串字)
Performs everything that getSearchList() does but with stemming. Use it for prediction.