sphinx partical search和upvote words

时间:2015-10-28 10:02:41

标签: search-engine sphinx

我现在正在使用Sphinx Search一段时间,但我无法得到我想要的结果。我希望有人能抽出一些时间来帮助我。 :)

我刚刚将Sphinx更新为2.2.10-id64-release。

我得到了什么: 1个带有以下配置的RT索引:

index shop_products1 {
  type = rt
  dict = keywords
  #enable_star = 1
  min_prefix_len = 3
  rt_mem_limit = 4096M

  path = /home/sphinxsearch/data/shop_products3

  morphology = stem_en, libstemmer_nl
  
  ignore_chars = U+0060, U+0027, U+0022, U+00B4

  html_strip = 1
  html_index_attrs = img=alt,title; a=title;

  preopen = 1
  inplace_enable = 1
  index_exact_words = 1

  
  rt_field = name
  rt_field = brand
  rt_field = description
  rt_field = specifications
  rt_field = tags
  rt_field = ourtags
  rt_field = searchfield
  rt_field = shop
  rt_field = category
  
  rt_field = color
  rt_field = ourcolor
  rt_field = gender
  rt_field = material

  rt_field = ean
  rt_field = sku

  rt_attr_string = ean
  rt_attr_string = sku
  rt_attr_float = price
  rt_attr_float = discount
  rt_attr_uint = shopid
  rt_attr_uint = itemid
  rt_attr_uint = deleted
  rt_attr_uint = duplicate
  rt_attr_uint = brandid
  rt_attr_uint = duplicates
  rt_attr_timestamp = updated_at
}




searchd {
	listen = 127.0.0.1:9306:mysql41
  log = /var/log/sphinxsearch/searchd.log
  workers = threads
  binlog_path = /home/sphinxsearch/rt-binlog

  #read_timeout = 10
  #client_timeout = 600
  #max_children = 0
  	
  # 2 hours
  rt_flush_period = 7200
  pid_file = /var/run/searchd.pid
  
}

现在我有以下查询示例:

SELECT 
	* , 
	weight() AS relevance, 
	COUNT(*) as count 
FROM shop_products1 
WHERE  
	price > 0  AND  
	price < 50000  AND  
	deleted <> 1  AND 
	duplicate = 0  AND 
	MATCH('(frills sieraden)') 
GROUP BY ean  
ORDER BY relevance DESC 
LIMIT 0, 40 
OPTION max_matches=50000, field_weights=(
	name=20, category=15, brand=10, description=12, searchfield=5, specifications=11, color=6, ourcolor=4, gender=5, material=4
)

当我运行此查询时,我得不到任何结果:

Empty set (0.02 sec)

MySQL [(none)]> show meta;
+---------------+--------+
| Variable_name | Value  |
+---------------+--------+
| total         | 0      |
| total_found   | 0      |
| time          | 0.016  |
| keyword[0]    | frill  |
| docs[0]       | 619    |
| hits[0]       | 1292   |
| keyword[1]    | sierad |
| docs[1]       | 62222  |
| hits[1]       | 99708  |
+---------------+--------+
9 rows in set (0.00 sec)

但是...有很多结果包含“frills”或“sieraden”。 如何才能更好地获得相关性,以便首先匹配2个单词,然后单独使用第一个单词,最后单独使用最后一个单词?

此外,我尝试提升像“sieraden”这样的特定词汇。是否有可能完成这项工作?

我希望有人可以帮助我!

三江源!!

0 个答案:

没有答案