代码之家  ›  专栏  ›  技术社区  ›  JP Silvashy Gautam Rege

狮身人面像,为每一个记录设定精确的匹配?

  •  0
  • JP Silvashy Gautam Rege  · 技术社区  · 15 年前

    所以我最近在一个rails项目中使用了Sphinx,我想提供一个列表,列出一个与给定条件100%匹配的'would be'精确匹配。例如:

    +==================+==========================================================+
    |  ingredient      |  exact matches                                           |
    +==================+==========================================================+
    |  cheese, cream   |  'cream cheese','philadephia cream cheese','cream chese',|
    |                  |  'creamed cheese'                                        |
    +------------------+----------------------------------------------------------+
    |  Cheese, gruyere |  'gruyere','gruyer cheese','gruyeres cheese'             |
    |                  |  'gruyere chese'                                         |
    +------------------+----------------------------------------------------------+
    |  Cheese, blue    |  'blue cheese','blu cheese'                              |
    +------------------+----------------------------------------------------------+
    

    这可能吗?好像其他人以前也有这个问题。。。不?


    我想最好的答案可能是把 exact matches 列并提供一个非常高的权重的条款。

    我不知道怎样才能打破“数组”,看看搜索词是否完全匹配,虽然。。。

    1 回复  |  直到 15 年前
        1
  •  1
  •   Iaroslav Vorozhko    15 年前

    你应该试着玩狮身人面像搜索模式。看匹配短语和匹配扩展2。