The MWE below, is made to display a bibliography and to extract a name-title index from it. I'd like to remove the page number within this index. To do so I use this answer but unfortunately it doesn't work…
Command \renewcommand{\index}[1]{\OldIndex{#1|mygobble}} breaks normal behaviour.
% !TeX TS-encoding = utf8
% !TeX TS-spellcheck = fr_FR
% !BIB TS-program = biber
% !TeX TS-program = lualatex
\documentclass[12pt, a4paper]{memoir}
\makeatletter
\RequirePackage{csquotes}
\RequirePackage{imakeidx}
\RequirePackage{ifthen}
\usepackage[%
language=french,
backend=biber,
sorting=nyt,
backref=true,
indexing=true,
maxnames=99,
style=authoryear-icomp,
url=false,
]{biblatex}
\usepackage{letltxmacro}
\@ifpackageloaded{biblatex_legacy}
{\DeclareIndexNameFormat{name:title}{%
\iffieldundef{title}
{\usebibmacro{index:name}{\index[name-title]}{#1}{#3}{#5}{#7}}
{\usebibmacro{index:name:title}{\index[name-title]}{#1}{#3}{#5}{#7}}}}
{\DeclareIndexNameFormat{name:title}{%
\iffieldundef{title}
{\usebibmacro{index:name}{\index[name-title]}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}}
{\usebibmacro{index:name:title}{\index[name-title]}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}}}}
%
% Auxiliary indexing macros in biblatex.def can be used to define additional
% indexing directives with subentries. The following directive creates entries
% for the year-title index.
%
\DeclareIndexFieldFormat{with:year}{%
\iffieldundef{year}
{\usebibmacro{index:entry}{\index[year-title]}{%
\mkbibindexentry{0}{Not dated}%
\subentryoperator%
\mkbibindexfield{\thefield{indexsorttitle}}{\emph{#1}}}}
{\usebibmacro{index:entry}{\index[year-title]}{%
\thefield{year}\subentryoperator%
\mkbibindexfield{\thefield{indexsorttitle}}{\emph{#1}}}}}
%
% We redefine the 'citeindex' bibmacro to use the new indexing directives.
%
\renewbibmacro*{citeindex}{%
\ifciteindex
{\indexnames[name:title]{labelname}%
\indexfield[with:year]{indextitle}}
{}}
\renewbibmacro*{bibindex}{%
\ifbibindex
{\indexnames[name:title]{labelname}%
\indexfield[with:year]{indextitle}}
{}}
\makeatother
\begin{filecontents*}{document.bib}
@article{Nejstgaard2008,
title={Quantitative PCR to estimate copepod feeding},
author={Nejstgaard, Jens C and Frischer, Marc E and Simonelli, Paolo and Troedsson, Christofer and Brakel, Markus and Adiyaman, Filiz and Sazhin, Andrey F and Artigas, L Felipe},
journal={Marine Biology},
volume={153},
pages={565--577},
year={2008},
publisher={Springer}
}
@ARTICLE{Smith1882,
author = {John Smith},
title = {I'm {J}ohn {S}mith},
year = {1882}
}
\end{filecontents*}
\begin{filecontents*}{document.ist}
quote '+'
delim_0 " "
delim_1 " "
delim_2 " "
delim_n " "
\end{filecontents*}
\addbibresource{document.bib}
\makeindex[program=makeindex,options=-s document.ist, name=name-title, title={Index des noms et des titres}, intoc]
\makeatletter
\let\mygobble\@gobble
\LetLtxMacro\OldIndex\index
\renewcommand{\index}[1]{\OldIndex{#1|mygobble}}
\makeatother
\begin{document}
\nocite{*}
\printbibliography
\printindex[name-title]
\end{document}

\renewcommand\indexwas faulty, but I had no clue how to solve this. Many thanks! – NBur Jul 27 '18 at 13:05