Home  >  Q&A  >  body text

javascript - typeahead.js中的bloodhound的两个tokenizer是什么作用

datumTokenizer – A function with the signature (datum) that transforms a datum into an array of string tokens

queryTokenizer – A function with the signature (query) that transforms a query into an array of string tokens.

不太理解这两个属性的作用。。

doc

高洛峰高洛峰2723 days ago351

reply all(1)I'll reply

  • 天蓬老师

    天蓬老师2017-04-10 15:57:42

    datumTokenizer 是建立索引时候用的分词器
    queryTokenizer 是查询语句的分词器

    reply
    0
  • Cancelreply