我索引的时候有个字段 type 0为新闻 1为产品 现在如何 where type=1这样的啊? $docs = $search->setQuery($skey)->addWeight('title', $skey)->search(); 这里不知道怎么写?
烦请仔细看上面所说的章节啊!!!什么时候用 numeric? [type] [color=red]type = string[/color] index = self
addWeight('title', $skey) 作何解释?addWeight 是只针对一个词的。 此外 $skey 发果是关键字你就用 setQuery($skey . " type:1") 这样啊,详见: http://www.xunsearch.com/doc/php/guide/search.query
...xample_attr] index = self tokenizer = split(,)[/php] 按这个字段搜索,example_attr:jianyue,baise 得到结果如下:[php]45 ... jianyue,baise,qianhuang 207 ... zhongshi,hongse,baise 39 ... jianyue,baise,huangse 41 ... jianyue,heise,baise 43 ... heise,baise 48 ... xingudian,heis...
谢谢,另请问一下 type 这个是否需要索引 我现在这个是没有索引的 [type] type = numeric[hr] 现在我已经把字段改成 [type] type = numeric index = self 这样了 但是我更新所以好像没效果 $index->update($doc); 这样的 是不是要清空后用add ...
... print_r($docs); 已经 [type] type = string index = self 了 但是搜索不到什么 改成 $docs = $search->setQuery($skey)->search(); 就可以 type这个我读出来是 "0" 和"1" 没错[hr] $docs = $search->setQuery($skey.' AND type:1')->search(); 这样的话可以 但是好...
...前面。介绍3条语句例子,第一条语句包含hello,world的模糊搜索,结果是包含hello,world的排在前面,且只包含hello或者world的也可以搜到,第二条语句只搜索包含hello,world的,结果只包含hello,world。 第三条和第二条结果一样。 此搜索...