14string.mql 951 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. -- ============================================================
  2. -- string 前缀/全文搜索测试
  3. -- ============================================================
  4. -- 1. 前缀搜索(s_name like)
  5. select * from /test/aaa/test_search where s_name=^'search_int'
  6. /**
  7. output()
  8. **/
  9. ;
  10. -- 2. 前缀搜索 - 单个匹配
  11. select * from /test/aaa/test_search where s_name=^'search_string'
  12. /**
  13. output()
  14. **/
  15. ;
  16. -- 3. 前缀搜索 - 无匹配
  17. select * from /test/aaa/test_search where s_name=^'zzz_not_exist'
  18. /**
  19. output()
  20. count(0)
  21. **/
  22. ;
  23. -- 4. 全文搜索 - autosearch(类无 autosearch,跳过)
  24. -- select * from /test/aaa/test_search where s_text search 'test'
  25. -- onerror(continue)
  26. ;
  27. -- 5. 全文搜索 - 中文(类无 autosearch,跳过)
  28. -- select * from /test/aaa/test_search where s_text search 'hello'
  29. -- onerror(continue)
  30. ;
  31. -- 6. 前缀搜索 - 精确前缀
  32. select * from /test/aaa/test_search where s_name=^'search_neg'
  33. /**
  34. output()
  35. **/
  36. ;