\documentclass[12pt, unicode]{beamer}
\usetheme{Warsaw}
\usepackage{luatexja}
\usepackage{listings}

\title{Groonga query specification}
\author{Hiroshi Hatake}
\date[2016/03/12]{Technical information sharing seminar}

\begin{document}

\frame{\maketitle}

\begin{frame}{Introduction}
\begin{block}{What is Groonga?}
Groonga is a fully free open-source full-text search engine and column store.
\end{block}
\onslide<1->
\begin{itemize}
\item<2-> Full-text search engine based on inverted index
\item<3-> Various tokenizers
\item<4-> Sharable storage and read lock-free
\item<5-> Basic funcitonality is privided from libgroonga
\item<6-> Query syntax to do full-text search
\end{itemize}
\end{frame}

\begin{frame}{Query syntax -- Motivation}
  \onslide<1->
  \begin{block}{Motivation}
  \begin{itemize}
  \item<1-> groonga.org documents is well-documented for users but for library developers.
  \item<2-> So, this slide describes Groonga query structures for query builder library developers.
  \end{itemize}
  \end{block}
\end{frame}

\begin{frame}{Query syntax}
\begin{block}{Summary of query syntax}
Groonga has a query which is used by full-text search.
\end{block}
\onslide<1->
\begin{itemize}
\item<2-> It requires mandatory command name parameter(s) (e.g. select, load... etc.)
\item<3-> It requires mandatory parameter(s) if they exist
\item<4-> It may require optional parameter(s) if they can specify
\item<5-> It may append additional parameter(s) if they are defined (e.g. request\_id and request\_timeout like parameters)
\end{itemize}
\end{frame}

\begin{frame}{Groonga query structure}
\begin{block}{Query structure}
Groonga query has multiple parts.
\end{block}
\begin{table}[htb]
\resizebox{\textwidth}{!}{%
    \begin{tabular}{l | c | c } \hline
      part & content & mandatory? \\ \hline \hline
      command & command name & yes \\ \hline
      mandatory parameter(s) & pairs of keys and value & yes \\ \hline
      optional parameter(s) & pairs of keys and values & no \\ \hline
      additional parameter(s) & pairs of keys and values & no \\ \hline
    \end{tabular}}
\end{table}
\end{frame}

\begin{frame}{Groonga query basics}
\begin{block}{Query order}
Groonga query MUST keep query parameters order except for using \textbf {named query}.
\end{block}
\onslide<1->
\begin{itemize}
\item<2-> \textbf {non-named query} MUST keep query order
\item<3-> \textbf {named query} need not keep query order
\end{itemize}
\end{frame}

\begin{frame}{Groonga query basics --example}
\begin{block}{Query order}
Groonga query MUST keep query parameters order except for using \textbf {named query}.
\end{block}
\onslide<1->
\begin{table}[htb]
\resizebox{\textwidth}{!}{%
  \begin{tabular}{l | c | c } \hline
      query type & content & valid/invalid \\ \hline \hline
      non-named query & table\_create {\color{orange}Site} {\color{red}TABLE\_HASH\_KEY} {\color{blue}ShortText} & valid \\ \hline
      non-named query & table\_create {\color{orange}Site} {\color{blue}ShortText} {\color{red}TABLE\_HASH\_KEY} & invalid \\ \hline
      named query & table\_create {\color{red}--flags TABLE\_HASH\_KEY} {\color{blue}--key\_type ShortText} {\color{orange}--name Site} & valid \\ \hline
      named query & table\_create {\color{blue}--key\_type ShortText} {\color{red}--flags TABLE\_HASH\_KEY} {\color{orange}--name Site} & valid \\ \hline
    \end{tabular}}
\end{table}
\end{frame}

\frame{\centering \Large Any questions?}

\end{document}
