src/main/java/de/blau/android/presets/Preset.java
/**
     * Add a name, any translation and the individual words to the index. Currently we assume that all words are
     * significant
     * 
     * @param term search key to add
     * @param translationContext the translation context if any
     * @param item the PresetItem to add
     */
Add a name, any translation and the individual words to the index. Currently we assume that all words are
significant

@param term search key to add
@param translationContext the translation context if any
@param item the PresetItem to add
Add a name any translation and the individual words to the index . Currently we assume that all words are significant @param term search key to add @param translationContext the translation context if any @param item the PresetItem to add
void addToSearchIndex(@Nullable String term, @Nullable String translationContext, @NonNull PresetItem item) {
        if (term != null) {
            String normalizedName = SearchIndexUtils.normalize(term);
            searchIndex.add(normalizedName, item);
            String[] words = normalizedName.split(" ");
            if (words.length > 1) {
                for (String w : words) {
                    searchIndex.add(w, item);
                }
            }
            if (po != null) { 
                String normalizedTranslatedName = SearchIndexUtils.normalize(po.t(translationContext, term));
                translatedSearchIndex.add(normalizedTranslatedName, item);
                String[] translastedWords = normalizedName.split(" ");
                if (translastedWords.length > 1) {
                    for (String w : translastedWords) {
                        translatedSearchIndex.add(w, item);
                    }
                }
            }
        }
    }
void addToSearchIndex ( @ Nullable String term , @ Nullable String translationContext , @ NonNull PresetItem item ) { if ( term != null ) { String normalizedName = SearchIndexUtils . normalize ( term ) ; searchIndex . add ( normalizedName , item ) ; String [ ] words = normalizedName . split ( " " ) ; if ( words . length > 1 ) { for ( String w : words ) { searchIndex . add ( w , item ) ; } } if ( po != null ) { String normalizedTranslatedName = SearchIndexUtils . normalize ( po . t ( translationContext , term ) ) ; translatedSearchIndex . add ( normalizedTranslatedName , item ) ; String [ ] translastedWords = normalizedName . split ( " " ) ; if ( translastedWords . length > 1 ) { for ( String w : translastedWords ) { translatedSearchIndex . add ( w , item ) ; } } } } }
Add a name, any translation and the individual words to the index.
Add a name any translation and the individual words to the index .
// search support // and any translation