[ 
https://issues.apache.org/jira/browse/LUCENE-3426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13102406#comment-13102406
 ] 

Robert Muir commented on LUCENE-3426:
-------------------------------------

Well if we apply the refactoring part of SOLR-2660 (we can split out into a 
separate issue), we could add such a thing as an attribute to the fieldType?

I like the way your patch looks now! A couple more questions:
* doesn't the optimization also apply to MultiPhraseQuery? If so, 
NGramPhraseQuery could extend MultiPhraseQuery and just rewrite to the correct 
one (MultiPhrase or Phrase depending upon the situation after optimization)
* what about hashCode/equals? Although the same results will be returned, 
scoring will differ, maybe it NGramPhraseQuery should implement these?


> optimizer for n-gram PhraseQuery
> --------------------------------
>
>                 Key: LUCENE-3426
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3426
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: core/search
>            Reporter: Koji Sekiguchi
>            Priority: Trivial
>         Attachments: LUCENE-3426.patch, LUCENE-3426.patch, LUCENE-3426.patch, 
> LUCENE-3426.patch, PerfTest.java, PerfTest.java
>
>
> If 2-gram is used and the length of query string is 4, for example q="ABCD", 
> QueryParser generates (when autoGeneratePhraseQueries is true) 
> PhraseQuery("AB BC CD") with slop 0. But it can be optimized PhraseQuery("AB 
> CD") with appropriate positions.
> The idea came from the Japanese paper "N.M-gram: Implementation of Inverted 
> Index Using N-gram with Hash Values" by Mikio Hirabayashi, et al. (The main 
> theme of the paper is different from the idea that I'm using here, though)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to