[ 
https://issues.apache.org/jira/browse/LUCENE-1398?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Koji Sekiguchi updated LUCENE-1398:
-----------------------------------

    Attachment: LUCENE-1398.patch

Patch attached. The patch includes a new constructor of PrefixQuery:

{code:java}
public PrefixQuery(Term prefix, boolean reverse) {
  if(reverse){
    String s = prefix.text();
    int len = s.length();
    if( len <= 1 ){
      this.prefix = prefix;
      return;
    }
    StringBuffer sb = new StringBuffer(len);
    for( int i = 0; i < len; i++ ){
      sb.append( s.charAt( len - i - 1 ) );
    }
    this.prefix = new Term(prefix.field(),sb.toString());
  }
  else
    this.prefix = prefix;
  }
{code}

so that you can extend PrefixQuery to have SuffixQuery:

{code:java}
class SuffixQuery extends PrefixQuery {
  public SuffixQuery( Term term ){
    super( term, true );
  }
}
{code}


> Add ReverseStringFilter
> -----------------------
>
>                 Key: LUCENE-1398
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1398
>             Project: Lucene - Java
>          Issue Type: New Feature
>          Components: Analysis
>            Reporter: Koji Sekiguchi
>            Priority: Trivial
>         Attachments: LUCENE-1398.patch
>
>
> add ReverseStringFilter and ReverseStringAnalyzer that can be used for 
> backword much. For Example, "*ry", "*ing", "*ber".

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to