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

Tomoko Uchida commented on SOLR-3055:
-------------------------------------

Again, I think there are three strategies for implementation.

1. embed gram size information in TokenStraem by adding new attribute (taken by 
first patch)
  - Pros: fully integrated with Lucene, so any application have not to write 
additional codes to optimize n-gram based phrase query
  - Pros: no configuration is needed because query parser create 
NGramPhraseQuery automatically
  - Pros: maybe most simple to implement
  - Cons: there might be some kind of conflicts with other attributes? 

2. NGramTokenizer expose "gramSize" for later use, and Solr's QueryParser 
create NGramPhraseQuery
  - Pros: no effect to Lucene's default behavior
  - Pros: no configuration is needed because query parser create 
NGramPhraseQuery automatically
  - Cons: extra codes are needed to use NGramPhraseQuery per each query parser

3. add "gramSize" (or something like) attribute to schema.xml, and Solr's query 
parser create NGramPhraseQuery using given gramSize by user
  - Pros: no effect to Lucene's and Solr's default behavior
  - Cons: new configuration attribute will be introduced
  - Cons: what's happen if user give gramSize value inconsistent with 
minGramSize or maxGramSize given to NGramTokenizer? maybe it's problematic.

I attach two patches, one (SOLR-3055-1.patch) for strategy 1 and other 
(SOLR-3055-2.patch) for strategy 2.
Reviews / suggestions will be appreciated.

> Use NGramPhraseQuery in Solr
> ----------------------------
>
>                 Key: SOLR-3055
>                 URL: https://issues.apache.org/jira/browse/SOLR-3055
>             Project: Solr
>          Issue Type: New Feature
>          Components: Schema and Analysis, search
>            Reporter: Koji Sekiguchi
>            Priority: Minor
>         Attachments: SOLR-3055-1.patch, SOLR-3055-2.patch, SOLR-3055.patch
>
>
> Solr should use NGramPhraseQuery when searching with default slop on n-gram 
> field.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to