Search.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. 'enableService' => true,
  20. 'searchIndexConfig' => [
  21. 'name' => 10,
  22. 'description' => 5,
  23. ],
  24. //more : https://docs.mongodb.com/manual/reference/text-search-languages/#text-search-languages
  25. /* example:
  26. 'searchLang' => [
  27. 'en' => 'english',
  28. 'fr' => 'french',
  29. 'de' => 'german',
  30. 'es' => 'spanish',
  31. 'ru' => 'russian',
  32. 'pt' => 'portuguese',
  33. ],
  34. */
  35. ],
  36. 'xunSearch' => [
  37. 'class' => 'fecshop\services\search\XunSearch',
  38. 'enableService' => true,
  39. /*
  40. 'fuzzy' => true, # 是否开启模糊查询
  41. 'synonyms' => true, #是否开启同义词翻译
  42. 'searchLang' => [
  43. 'zh' => 'chinese',
  44. ],
  45. */
  46. ],
  47. ],
  48. ],
  49. ];