假设我有三个模型/表:operating_systems、words和programming_languages:
# operating_systems
name:string created_by:string family:string
Windows Microsoft MS-DOS
Mac OS X Apple UNIX
Linux Linus Torvalds UNIX
UNIX AT&T UNIX
# words
word:string defenitions:string
window (serialized hash of defenitions)
hello (serialized hash of defenitions)
UNIX (serialized hash of defenitions)
# programming_languages
name:string created_by:string example_code:text
C++ Bjarne Stroustrup #include <iostream> etc...
HelloWorld Jeff Skeet h
AnotherOne Jon Atwood imports 'SORULEZ.cs' etc...
当用户搜索hello时,系统显示“你好”的定义。这相对容易实现。但是,当用户搜索时UNIX,引擎必须选择:word或operating_system。此外,当用户搜索windows(小写字母“w”)时,引擎会选择word,但也应该显示Assuming 'windows' is a word. Use as an <a href="etc..">operating system</a> instead。
谁能通过解析和选择搜索查询的主题为我指明正确的方向?谢谢。
注意:它不需要像 WA 那样执行计算。