lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Solr Wiki] Update of "TermsComponent" by GrantIngersoll
Date Sat, 29 Nov 2008 13:51:30 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The following page has been changed by GrantIngersoll:
http://wiki.apache.org/solr/TermsComponent

------------------------------------------------------------------------------
   * terms.fl={FIELD NAME} - Required. The name of the field to get the terms from.
   * terms.lower={The lower bound term} - Optional.  The term to start at.  If not specified,
the empty string is used, meaning start at the beginning of the field.
   * terms.upper={The upper bound term} - Either upper, terms.rows, rows must be set.  The
term to stop at.
-  * terms.upr.incl={true|false} - Optional.  Include the upper bound term in the result set.
 Default is false.
+  * terms.upper.incl={true|false} - Optional.  Include the upper bound term in the result
set.  Default is false.
-  * terms.lwr.incl={true|false} - Optional.  Include the lower bound term in the result set.
 Default is true.
+  * terms.lower.incl={true|false} - Optional.  Include the lower bound term in the result
set.  Default is true.
-  * terms.rows={integer} - Either upper, terms.rows, rows must be set.  The number of results
to return.  If not specified, looks for rows (CommonParams.ROWS).  If that is not specified,
default is 10  
+  * terms.rows={integer} - Either upper, terms.rows, rows must be set.  The number of results
to return.  If not specified, looks for rows (CommonParams.ROWS).  If that is not specified,
default is 10.  If < 0, then include all rows up to Integer.MAX_VALUE 
+  * terms.prefix={String} - Optional.  Restrict matches to terms that start with the prefix.

  
  The output is a list of the terms and their document frequency values.  Again, see http://lucene.apache.org/java/2_4_0/api/core/org/apache/lucene/index/TermEnum.html
  
@@ -43, +44 @@

  
  <lst name="responseHeader">
   <int name="status">0</int>
+  <int name="QTime">1</int>
+ </lst>
+ <lst name="terms">
+  <lst name="name">
+   <int name="0">5</int>
+ 
+   <int name="1">15</int>
+   <int name="11">5</int>
+   <int name="120">5</int>
+   <int name="133">5</int>
+   <int name="184">15</int>
+   <int name="19">5</int>
+ 
+   <int name="1900">5</int>
+   <int name="2">15</int>
+   <int name="20">5</int>
+  </lst>
+ </lst>
+ </response>
+ }}}
+ 
+ == Lower ==
+ 
+ URL: 
+ {{{
+ http://localhost:8983/solr/autoSuggest?terms=true&terms.fl=name&terms.lower=a&indent=true
+ }}}
+ 
+ Result:
+ {{{
+ <?xml version="1.0" encoding="UTF-8"?>
+ <response>
+ 
+ <lst name="responseHeader">
+  <int name="status">0</int>
   <int name="QTime">2</int>
  </lst>
  <lst name="terms">
-  <int name="0">5</int>
-  <int name="1">15</int>
-  <int name="11">5</int>
-  <int name="120">5</int>
-  <int name="133">5</int>
-  <int name="184">15</int>
-  <int name="19">5</int>
-  <int name="1900">5</int>
-  <int name="2">15</int>
-  <int name="20">5</int>
- </lst>
- </response>
- }}}
- 
- == Lower ==
- 
- URL: 
- {{{
- http://localhost:8983/solr/autoSuggest?terms=true&terms.fl=name&terms.lower=a&indent=true
- }}}
- 
- Result:
- {{{
- <?xml version="1.0" encoding="UTF-8"?>
- <response>
- 
- <lst name="responseHeader">
-  <int name="status">0</int>
-  <int name="QTime">2</int>
- </lst>
- <lst name="terms">
+  <lst name="name">
-  <int name="a">8</int>
+   <int name="a">8</int>
+ 
-  <int name="adata">5</int>
+   <int name="adata">5</int>
- 
-  <int name="all">5</int>
+   <int name="all">5</int>
-  <int name="allinon">5</int>
+   <int name="allinon">5</int>
-  <int name="amber">1</int>
+   <int name="amber">1</int>
-  <int name="appl">5</int>
+   <int name="appl">5</int>
-  <int name="asus">5</int>
+   <int name="asus">5</int>
+ 
-  <int name="ata">5</int>
+   <int name="ata">5</int>
- 
-  <int name="ati">5</int>
+   <int name="ati">5</int>
-  <int name="b">5</int>
+   <int name="b">5</int>
+  </lst>
  </lst>
  </response>
  }}}
@@ -107, +114 @@

  
  <lst name="responseHeader">
   <int name="status">0</int>
-  <int name="QTime">2</int>
+  <int name="QTime">122</int>
  </lst>
+ <lst name="terms">
- <lst name="terms">
+  <lst name="name">
-  <int name="a">8</int>
+   <int name="a">8</int>
+ 
-  <int name="adata">5</int>
+   <int name="adata">5</int>
- 
-  <int name="all">5</int>
+   <int name="all">5</int>
-  <int name="allinon">5</int>
+   <int name="allinon">5</int>
-  <int name="amber">1</int>
+   <int name="amber">1</int>
-  <int name="appl">5</int>
+   <int name="appl">5</int>
-  <int name="asus">5</int>
+   <int name="asus">5</int>
+ 
-  <int name="ata">5</int>
+   <int name="ata">5</int>
- 
-  <int name="ati">5</int>
+   <int name="ati">5</int>
+  </lst>
  </lst>
  </response>
  }}}
@@ -131, +140 @@

  
  URL:
  {{{
- http://localhost:8983/solr/autoSuggest?terms=true&terms.fl=name&terms.lower=a&terms.upper=b&terms.lwr.incl=false&indent=true
+ http://localhost:8983/solr/autoSuggest?terms=true&terms.fl=name&terms.lower=a&terms.upper=b&terms.lower.incl=false&indent=true
  }}}
  
  Result:
@@ -141, +150 @@

  
  <lst name="responseHeader">
   <int name="status">0</int>
-  <int name="QTime">2</int>
+  <int name="QTime">130</int>
  </lst>
+ <lst name="terms">
- <lst name="terms">
+  <lst name="name">
-  <int name="adata">5</int>
+   <int name="adata">5</int>
+ 
-  <int name="all">5</int>
+   <int name="all">5</int>
- 
-  <int name="allinon">5</int>
+   <int name="allinon">5</int>
-  <int name="amber">1</int>
+   <int name="amber">1</int>
-  <int name="appl">5</int>
+   <int name="appl">5</int>
-  <int name="asus">5</int>
+   <int name="asus">5</int>
-  <int name="ata">5</int>
+   <int name="ata">5</int>
+ 
-  <int name="ati">5</int>
+   <int name="ati">5</int>
- 
+  </lst>
  </lst>
  </response>
  }}}
@@ -173, +184 @@

  
  <lst name="responseHeader">
   <int name="status">0</int>
-  <int name="QTime">0</int>
+  <int name="QTime">308</int>
  </lst>
+ <lst name="terms">
- <lst name="terms">
+  <lst name="name">
-  <int name="a">8</int>
+   <int name="a">8</int>
+ 
-  <int name="adata">5</int>
+   <int name="adata">5</int>
- 
- </lst>
+  </lst>
+ </lst>
+ </response>
+ }}}
+ 
+ == Use in Auto-Suggest ==
+ 
+ To use in auto-suggest, add in a lower bound, an upper bound and make the lower bound exclusive
of the input term, as in:
+ 
+ URL:
+ {{{
+ http://localhost:8983/solr/autoSuggest?terms=true&terms.fl=name&terms.lower=at&terms.prefix=at&terms.lower.incl=false&terms.upper=b&indent=true
+ }}}
+ 
+ Result:
+ {{{
+ <?xml version="1.0" encoding="UTF-8"?>
- </response>
+ <response>
  
- }}}
+ <lst name="responseHeader">
+  <int name="status">0</int>
+  <int name="QTime">120</int>
+ </lst>
+ <lst name="terms">
+  <lst name="name">
+   <int name="ata">5</int>
  
+   <int name="ati">5</int>
+  </lst>
+ </lst>
+ </response>
+ }}}
+ 

Mime
View raw message