how to remove duplicate from views' result page I went through all solutions found on the web. 

Both Distinct or Aggregation do not work at all in my case. 
Is there a way to remove the duplicates using hook_query_alter() ? 

My sql query run in the view is the following:

SELECT node.changed AS node_changed, node.nid AS nid, SUM(search_index.score * search_total.count) AS score
FROM 
{node} node
LEFT JOIN {search_index} search_index ON node.nid = search_index.sid
LEFT JOIN {search_total} search_total ON search_index.word = search_total.word
INNER JOIN {search_dataset} search_dataset ON search_index.sid = search_dataset.sid AND (search_index.type = search_dataset.type)
WHERE ((( (search_index.type = 'node') AND (search_dataset.data LIKE '% saadan %' ESCAPE '\\') AND (search_dataset.data LIKE '% goer %' ESCAPE '\\') AND (search_dataset.data LIKE '% du %' ESCAPE '\\') ))AND(( (node.status = '1') AND (node.type NOT IN  ('nodetype')) )))
GROUP BY search_index.sid, score, node_changed, nid
HAVING (( (COUNT(*) &gt;= '2') ))
ORDER BY node_changed DESC
LIMIT 10 OFFSET 0 


Last note: 

I am also aware of the solution the removes content by hooking into hook_views_pre_render() but I do not really consider this a solution since it cracs up your results.

The query works perfectly if I replace 'GROUP BY search_index.sid, score, node_changed, nid' with GROUP BY nid.
How do I achieve this?
What actually worked is the following

function mymodule_query_alter($query) {

  if (isset($query-&gt;alterMetaData)) {
    if (isset($query-&gt;alterMetaData['view'])) {
      if($query-&gt;alterMetaData['view']-&gt;name == 'node_search') {
        $fields =&amp; $query-&gt;getGroupBy();
        // Tried various fields to check which was the field creating the problem.
        unset($fields['score']);
        $query-&gt;groupBy('nid');
      }
    }
  }
}


Answer found at http://www.brenthartmann.com/blog/how-use-hookqueryalter-drupal-7

PS: In order to check the sql query that produces your view, you need to go to admin/structure/views/settings and enable "Show the SQL query".