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

Alan Woodward commented on LUCENE-9153:
---------------------------------------

WhitespaceAnalyzer uses a WhitespaceTokenizer that defaults to a 
`max_token_length` of 255 chars. We should add a parameter here to allow users 
to adjust the max token length.

Meanwhile [~akanksha88] you can work around this by creating your own analyzer:

 
{code:java}
Analyzer myAnalyzer = new Analyzer() {
  @Override
  protected TokenStreamComponents createComponents(final String fieldName) {
    return new TokenStreamComponents(new WhitespaceTokenizer(1024));
  }
};
{code}

> Lucene Query parser append space if query length is greater than 255
> --------------------------------------------------------------------
>
>                 Key: LUCENE-9153
>                 URL: https://issues.apache.org/jira/browse/LUCENE-9153
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Akanksha Jain
>            Priority: Major
>
> Hello Everyone
>  
> I am working with Lucene 4.7.1
> When parsing query using Lucene query parser. If query length is greater than 
> 255 bytes, it returns query with space appended after every 255 bytes, which 
> is causing further issues in my project.
>  
> Can you please let me know why the term (parsed query contain 
> Arraylist<Term>) max length is 255 bytes. Why space is appended in between 
> the query?
>  
> I will really appreciate it if someone can help me with this.
> Do let me know if you have not understood my query and require some reference
>  
> For analysis,  Please check QueryBuilder.java class which has method 
> createFieldQuery(....) 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to