واجهة برمجة تطبيقات البحث التنبؤية تمنحك حرية البحث على ملايين الإدخالات في قاعدة بيانات بسهولة. مزيج من البحث عن النص الكامل وتصنيفه وترتيبه ليمنحك أفضل إخراج لتطبيق/تطبيق Android باستخدام SQLite3.
رابط التطبيق
ما هو البحث التنبئي؟
إلى جانب البحث السريع مع المطابقة الفرعية ما يفعله التنبؤات ، فإنه سيقان كلمة البحث الخاصة بك أي. يحصل على الجذر ثم يبحث على جداول 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.
Creates/Builds the Full Text Search Virtual Table.
تم البحث في سلسلة قاعدة البيانات التي تحتوي على الجدول الذي تريد البحث الذكي.
سلسلة tableofdata اسم الجدول الذي يحتوي على البيانات.
ArrayList ColumnNames قائمة جميع الأعمدة في الجدول أعلاه.
2. ftsrebuilder ()
Rebulids the FTS Virtual Table. Run this each time you make changes to your main database.
3.
returns the list of the words that match with your query. This is without stemming search.
4. String getMatchesWsteming (كلمة سلسلة)
Performs everything that getSearchList() does but with stemming. Use it for prediction.