Search.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /**
  3. * FecShop file.
  4. * @link http://www.fecshop.com/
  5. * @copyright Copyright (c) 2016 FecShop Software LLC
  6. * @license http://www.fecshop.com/license/
  7. */
  8. return [
  9. 'search' => [
  10. 'class' => 'fecshop\services\Search',
  11. /* example:
  12. 'filterAttr' => [
  13. 'color','size', # 在搜索页面侧栏的搜索过滤属性字段
  14. ],
  15. */
  16. 'childService' => [
  17. 'mongoSearch' => [
  18. 'class' => 'fecshop\services\search\MongoSearch',
  19. 'searchIndexConfig' => [
  20. 'name' => 10,
  21. 'description' => 5,
  22. ],
  23. //more : https://docs.mongodb.com/manual/reference/text-search-languages/#text-search-languages
  24. /* example:
  25. 'searchLang' => [
  26. 'en' => 'english',
  27. 'fr' => 'french',
  28. 'de' => 'german',
  29. 'es' => 'spanish',
  30. 'ru' => 'russian',
  31. 'pt' => 'portuguese',
  32. ],
  33. */
  34. ],
  35. 'xunSearch' => [
  36. 'class' => 'fecshop\services\search\XunSearch',
  37. /*
  38. 'fuzzy' => true, # 是否开启模糊查询
  39. 'synonyms' => true, #是否开启同义词翻译
  40. 'searchLang' => [
  41. 'zh' => 'chinese',
  42. ],
  43. */
  44. ],
  45. 'mysqlSearch' => [
  46. 'class' => 'fecshop\services\search\MysqlSearch',
  47. /*
  48. 'searchLang' => [
  49. 'en' => 'english',
  50. 'fr' => 'french',
  51. 'de' => 'german',
  52. 'es' => 'spanish',
  53. 'ru' => 'russian',
  54. 'pt' => 'portuguese',
  55. 'it' => 'italian',
  56. 'zh' => 'chinese',
  57. ],
  58. */
  59. ],
  60. ],
  61. ],
  62. ];