Here's a prototype using the imakeidx package.
\documentclass{book}
\usepackage[noautomatic,splitindex]{imakeidx}
%%% Allocate enough chapter indices
\count255=0
\loop\ifnum\count255<50
\advance\count255 by 1
\begingroup\edef\x{\endgroup
\noexpand\makeindex[name=\number\count255 chap,title=Word index for Chapter \number\count255]}\x
\repeat
%%% A global index
\makeindex
%%% The user level macros
\newcommand{\gindex}[1]{%
\index{#1}% global index
\expandafter\index\expandafter[\thechapter chap]{#1}%
}
\newcommand{\printchapterindex}{%
\begingroup
% We want the index as an unnumbered section
\let\chapter\section
% Also disable the page break
\let\cleardoublepage\relax
% Print the index
\expandafter\printindex\expandafter[\thechapter chap]%
\endgroup}
\begin{document}
\mainmatter
\chapter{First}
First\gindex{first} and abc\gindex{abc}
\printchapterindex
\chapter{Second}
Second\gindex{second} and def\gindex{def}
\printchapterindex
\printindex
\end{document}
We can't use the automatic features of imakeidx that can work only if the indices are the last thing in the document (or, more precisely, nothing to be indexed follows one of the indices), so the procedure is to call
pdflatex filename
splitindex filename
pdflatex filename
Image of Chapter 1

Image of Chapter 2

Image of the global index

Appendix: how to add an engine to TeXShop for building this file
Navigate in the Finder opening the folder ~/Library/TeXShop/Engines (where ~ stands for your Home.
Duplicate the XeTeX.engine file.
Rename the newly created file to splitindex.engine.
Right click on this file and choose "Open with TeXShop.app"
Change the entire contents of the file with
#! /bin/bash
PATH=/usr/texbin:/usr/local/bin:${PATH}
bfname=${1%\.*}
splitindex "$bfname"
Save the file and quit TeXShop
On reopening TeXShop the dropdown menu next to the Typeset button will have an entry called splitindex

When you want to run splitindex, just select the item from the dropdown menu and push the Typeset button. This is equivalent to running the command
splitindex filename
I talked before of. For the next typesetting, choose your default engine from the menu, be it LaTeX or Latexmk.