Home > Article > Backend Development > dede57 configures Sphinx to support typeid and mid
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.