XF 2.1 Limit any search on the board, on specific nodes (node_ids)

Scandal

Well-known member
Let's say that we have an array on variable $only_node_ids. This array has some integers which are node_ids.

How I could limit any search on the xF board to those node_ids?
I mean not to perform a whole forum search, but only to those Nodes.

I need it to work on quick search and advance search page.

Just need what class do I have to extend, and where to put the array. :)
 
I have try hard coded (just for testing / debuggin) to apply this row on /src/XF/Repository/Search.php, method runSearch().
PHP:
$constraints['child_nodes'] = '1';
$constraints['nodes'] = array_map('strval', $only_node_ids);
But for some reason it still returns threads and posts from whole forum. Any idea?
 
Top Bottom