Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I don't believe you can do this OOTB in Lucene currently - searching for this functionality yields this open issue:</p> <p><a href="https://issues.apache.org/jira/browse/LUCENE-1421" rel="nofollow noreferrer">Jira Lucene Feature Request</a></p> <p>The functionality is present OOTB with Solr however - which provides a faceting feature. A query such as the following:</p> <p><a href="http://localhost:8983/solr/select?q=ipod&amp;rows=0&amp;facet=true&amp;facet.limit=-1&amp;facet.field=cat&amp;facet.field=inStock" rel="nofollow noreferrer">http://localhost:8983/solr/select?q=ipod&amp;rows=0&amp;facet=true&amp;facet.limit=-1&amp;facet.field=cat&amp;facet.field=inStock</a> </p> <p>would return the following result:</p> <pre><code>&lt;response&gt; &lt;responseHeader&gt;&lt;status&gt;0&lt;/status&gt;&lt;QTime&gt;2&lt;/QTime&gt;&lt;/responseHeader&gt; &lt;result numFound="4" start="0"/&gt; &lt;lst name="facet_counts"&gt; &lt;lst name="facet_queries"/&gt; &lt;lst name="facet_fields"&gt; &lt;lst name="cat"&gt; &lt;int name="search"&gt;0&lt;/int&gt; &lt;int name="memory"&gt;0&lt;/int&gt; &lt;int name="graphics"&gt;0&lt;/int&gt; &lt;int name="card"&gt;0&lt;/int&gt; &lt;int name="music"&gt;1&lt;/int&gt; &lt;int name="software"&gt;0&lt;/int&gt; &lt;int name="electronics"&gt;3&lt;/int&gt; &lt;int name="copier"&gt;0&lt;/int&gt; &lt;int name="multifunction"&gt;0&lt;/int&gt; &lt;int name="camera"&gt;0&lt;/int&gt; &lt;int name="connector"&gt;2&lt;/int&gt; &lt;int name="hard"&gt;0&lt;/int&gt; &lt;int name="scanner"&gt;0&lt;/int&gt; &lt;int name="monitor"&gt;0&lt;/int&gt; &lt;int name="drive"&gt;0&lt;/int&gt; &lt;int name="printer"&gt;0&lt;/int&gt; &lt;/lst&gt; &lt;lst name="inStock"&gt; &lt;int name="false"&gt;3&lt;/int&gt; &lt;int name="true"&gt;1&lt;/int&gt; &lt;/lst&gt; &lt;/lst&gt; &lt;/lst&gt; &lt;/response&gt; </code></pre> <p>More information on faceting can be found on the Solr website:</p> <p><a href="http://wiki.apache.org/solr/SimpleFacetParameters" rel="nofollow noreferrer">http://wiki.apache.org/solr/SimpleFacetParameters</a></p> <p><strong>EDIT:</strong> If you definitely don't want to go down the SOLR aproach to faceting you may be able to leverage the functionality in this patch described for Lucene:</p> <p><a href="http://sujitpal.blogspot.com/2007/01/faceted-searching-with-lucene.html" rel="nofollow noreferrer">http://sujitpal.blogspot.com/2007/01/faceted-searching-with-lucene.html</a></p> <p>which provides an implementation of the faceting feature on top of Lucene 2.0 via a patch. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload