Home  >  Article  >  Backend Development  >  dede57 configures Sphinx to support typeid and mid

dede57 configures Sphinx to support typeid and mid

WBOY
WBOYOriginal
2016-07-28 08:28:171412browse
After configuring Sphinx, you can enable the specific configuration in dede's backend via Baidu. I will only mention here that Sphinx supports the query condition typeid.

After I configured it, I found that dede’s search did not support typeid. After I found the code, I found that I had written the code, but it was only a string type. It should be an array, so it is not supported. Now let’s talk about how to change it.

Find the include directory, look for the arc.searchview.class.php file, and then find the function CountRecordSphinx() function, which is about line 379. Find the code $this->sphinx->SetFilter('typeid', GetSonIds($this- >TypeID));

replaced with

$this->sphinx->SetFilter('typeid', explode(',',GetSonIds($this->TypeID))));

can be supported Typeid If you still want to support mid

Go down a few lines and find about line 384

$this->sphinx->SetFilter('mid', $this->mid);

Replace with

$ this->sphinx->SetFilter('mid', array($this->mid));

That’s it, you can try it according to my modification

Note: I use dede Some things have been changed in version 5.7 and the number of lines may not be accurate. Please make a backup before making any changes

The above introduces how dede57 configures Sphinx to support typeid and mid, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn