lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Khee Chin (JIRA)" <>
Subject [jira] Commented: (SOLR-877) Access to Lucene's TermEnum capabilities
Date Tue, 02 Dec 2008 23:58:44 GMT


Khee Chin commented on SOLR-877:

As a solr-user who uses this function for auto-complete, I'd like to filter out terms with
a low-frequency count. Thus, I've implemented a quick-hack, against a 28th Nov checkout.


  // Optional.  The minimum value of docFreq to be returned.  1 by default
  public static final String TERMS_FREQ_MIN = TERMS_PREFIX + "freqmin";
   // Optional.  The maximum value of docFreq to be returned.  -1 by default means no boundary
  public static final String TERMS_FREQ_MAX = TERMS_PREFIX + "freqmax";


    // At lines 55-56, after initializing boolean upperIncl and lowerIncl
    int freqmin = params.getInt(TermsParams.TERMS_FREQ_MIN,1); // initialize freqmin
    int freqmax = params.getInt(TermsParams.TERMS_FREQ_MAX,-1); // initialize freqmax
    // At line 69, within the if() { terms.add() } block,    
    if (termEnum.docFreq() >= freqmin && (freqmax==-1 || (termEnum.docFreq() <=
freqmax))) {
        terms.add(theText, termEnum.docFreq());
    } else {
The new parameters could be used by calling
both of which, are optional.

> Access to Lucene's TermEnum capabilities
> ----------------------------------------
>                 Key: SOLR-877
>                 URL:
>             Project: Solr
>          Issue Type: New Feature
>            Reporter: Grant Ingersoll
>            Assignee: Grant Ingersoll
>            Priority: Minor
>             Fix For: 1.4
>         Attachments: SOLR-877.patch, SOLR-877.patch
> I wrote a simple SearchComponent on the plane the other day that gives access to Lucene's
TermEnum capabilities.  I think this will be useful for doing auto-suggest and other term
based operations.  My first draft is not distributed, but it probably should be made to do
so eventually. 

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message