Implementing “Did you mean?” using Amazon CloudSearch

允我心安 提交于 2020-01-03 17:10:13

问题


The new CloudSearch API uses Solr in the backend and Solr has the "Did You Mean?" feature. However, it seems that Amazon has not yet exposed this feature, at least looking at the documentation. I have looked at other questions asking about implementing a "Did you mean?" feature, however if I am not mistaken, in all these cases the asker has control over the search engine.

I was thinking to perhaps send a second search query using fuzzy search if the first search query results in no matches. Would this be a good idea? Is it possible to create a "Did you mean?" / spellchecking type functionality when using CloudSearch?


回答1:


Not quite what you're asking for, but you could implement the Suggester feature to help prevent spellchecking issues:

http://docs.aws.amazon.com/cloudsearch/latest/developerguide/getting-suggestions.html

But why not use fuzzy search in the first place? If you're worried about performance, I'd say time a couple searches with and without fuzzy to see if it's a significant difference.

You can also perform fuzzy searches with the simple query parser. To perform a fuzzy search, append the ~ operator and a value that indicates how much terms can differ from the user query string and still be considered a match. For example, the specifying planit~1 searches for the term planit and allows matches to differ by up to one character, which means the results will include hits for planet.

  • http://docs.aws.amazon.com/cloudsearch/latest/developerguide/searching-text.html
  • or a "sloppy phrase search" http://docs.aws.amazon.com/cloudsearch/latest/developerguide/searching-text.html#searching-text-phrases


来源:https://stackoverflow.com/questions/23863362/implementing-did-you-mean-using-amazon-cloudsearch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!