# C1.LiveLinq.Indexing.Search.IndexQuery-1.Subindex

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_LiveLinq_Indexing_Search_IndexQuery_1_Subindex_" data-uid="C1.LiveLinq.Indexing.Search.IndexQuery`1.Subindex*">Subindex Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_LiveLinq_Indexing_Search_IndexQuery_1_Subindex_" data-uid="C1.LiveLinq.Indexing.Search.IndexQuery`1.Subindex*"></a>
<h4 id="C1_LiveLinq_Indexing_Search_IndexQuery_1_Subindex__1_C1_LiveLinq_Indexing_Subindex__0___0__" data-uid="C1.LiveLinq.Indexing.Search.IndexQuery`1.Subindex``1(C1.LiveLinq.Indexing.Subindex{`0,``0})">Subindex&lt;TKey&gt;(Subindex&lt;T, TKey&gt;)</h4>
<div class="markdown level1 summary"><p>Used to apply subindex search to the result of a search operation.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public virtual IIndexScanner&lt;T, TKey&gt; Subindex&lt;TKey&gt;(Subindex&lt;T, TKey&gt; definition)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Overridable Function Subindex(Of TKey)(definition As Subindex(Of T, TKey)) As IIndexScanner(Of T, TKey)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.LiveLinq.Indexing.Subindex-2.html">Subindex</a>&lt;T, TKey&gt;</td>
      <td><span class="parametername">definition</span></td>
      <td><p>Subindex to use for narrowing the search.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.LiveLinq.Indexing.Search.IIndexScanner-2.html">IIndexScanner</a>&lt;T, TKey&gt;</td>
      <td><p>An <a class="xref" href="C1.LiveLinq.Indexing.Search.IIndexScanner-2.html">IIndexScanner&lt;T, TKey&gt;</a> collection indexed by the subindex that can be used to perform search operations narrowing the collection.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span class="parametername">TKey</span></td>
      <td><p>Type of the subindex key.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_LiveLinq_Indexing_Search_IndexQuery_1_Subindex__1_C1_LiveLinq_Indexing_Subindex__0___0___remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>A subindex can be used to further narrow the result of a search operation,
if the corresponding subindex exists in the index or subindex used to perform that search operation. For example,</p>
<pre><code class="lang-csharp">var idxByCity = customers.Indexes(c =&gt; c.City);
var subindexByContactTitle = idxByCity.Subindexes(c =&gt; c.ContactTitle);
var ownersInLondon = idxByCity.Find("London").Subindex(subindexByContactTitle).Find("Owner");</code></pre>
</div>


<a id="C1_LiveLinq_Indexing_Search_IndexQuery_1_Subindex_" data-uid="C1.LiveLinq.Indexing.Search.IndexQuery`1.Subindex*"></a>
<h4 id="C1_LiveLinq_Indexing_Search_IndexQuery_1_Subindex_C1_LiveLinq_Indexing_Subindex__0__" data-uid="C1.LiveLinq.Indexing.Search.IndexQuery`1.Subindex(C1.LiveLinq.Indexing.Subindex{`0})">Subindex(Subindex&lt;T&gt;)</h4>
<div class="markdown level1 summary"><p>Used to apply subindex search to the result of a search operation.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public IIndexScanner&lt;T&gt; Subindex(Subindex&lt;T&gt; definition)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function Subindex(definition As Subindex(Of T)) As IIndexScanner(Of T)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.LiveLinq.Indexing.Subindex-1.html">Subindex</a>&lt;T&gt;</td>
      <td><span class="parametername">definition</span></td>
      <td><p>Subindex to use for narrowing the search.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.LiveLinq.Indexing.Search.IIndexScanner-1.html">IIndexScanner</a>&lt;T&gt;</td>
      <td><p>An <a class="xref" href="C1.LiveLinq.Indexing.Search.IIndexScanner-1.html">IIndexScanner&lt;T&gt;</a> collection indexed by the subindex that can be used to perform search operations narrowing the collection.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_LiveLinq_Indexing_Search_IndexQuery_1_Subindex_C1_LiveLinq_Indexing_Subindex__0___remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>A subindex can be used to further narrow the result of a search operation,
if the corresponding subindex exists in the index or subindex used to perform that search operation. For example,</p>
<pre><code class="lang-csharp">var idxByCity = customers.Indexes(c =&gt; c.City);
var subindexByContactTitle = idxByCity.Subindexes(c =&gt; c.ContactTitle);
var ownersInLondon = idxByCity.Find("London").Subindex&lt;string&gt;(subindexByContactTitle).Find("Owner");</code></pre>
</div>
</div>
