0
좋은 퍼지 검색 솔루션 또는 패키지에 대한 올바른 방향을 알려줄 수 있습니까? Meteor.users를 포함한 몇 가지 컬렉션을 검색 할 수 있기를 원합니다.퍼지 검색 컬렉션을위한 최상의 솔루션/패키지?
감사
좋은 퍼지 검색 솔루션 또는 패키지에 대한 올바른 방향을 알려줄 수 있습니까? Meteor.users를 포함한 몇 가지 컬렉션을 검색 할 수 있기를 원합니다.퍼지 검색 컬렉션을위한 최상의 솔루션/패키지?
감사
하면 Levenshtein Distance 알고리즘을 사용 https://atmospherejs.com/perak/fuzzy-search 있습니다. 추가 정보에서 가져온 예 :
// If we have a collection named "Drinks" which contains "beer", "juice" and "milk"
var searchString = "bear"; // user typed "bear" instead of "beer"
// search "Drinks" collection for string "bear"
var someCursor = Drinks.find({ drink_name: searchString });
// "bear" is not found, so we want to find most similar word to give user suggestion (Did you mean...)
if(someCursor.count() == 0)
{
// expose entire collection
var tempCursor = Drinks.find({ }, { drink_name: true });
// find most similar string
var bestWord = mostSimilarString(tempCursor, "drink_name", searchString, -1, false);
// in this example, bestWord is "beer", show user a suggestion: "Did you mean beer?"
// ...
}
등도 매우 강력하지만, 처음 사용할 어려워 보일 수있는 Elastic Search 및 https://github.com/Crenshinibon/spomet를 사용 https://atmospherejs.com/matteodem/easy-search 같은 다른 대안도있다.