See org.apache.lucene.analysis.miscellaneous.LimitTokenCountAnalyzer
and org.apache.lucene.analysis.miscellaneous.LimitTokenCountFilter.

Looks you can use the former with StandardAnalyzer as the delegate and
whatever value you want for maxTokenCount.

The 3.6,1 javadocs have "IndexWriter.MaxFieldLength Deprecated. use
LimitTokenCountAnalyzer instead.".  The 4.x docs don't, because it's
gone.




--
Ian.


On Wed, Jan 23, 2013 at 8:28 PM, saisantoshi <saisantosh...@gmail.com> wrote:
> Thanks. I have gone through the change log but its not very clear from the
> bug on the usage in the latest versions. I understand that instead of user
> supplying the values, its been wrapped in another analyzer. Could you please
> let me know how the usage for modifying the fields I mentioned above. Also,
> we are using StandardAnalyzer and wanted to stick with it.
>
> The docs are not very clear. it should have at least provided some usage
> snippets if deprecated.
>
> IndexWriterConfig indexWriterConfig = new
> IndexWriterConfig(Version.LUCENE_40,analyzer);
> IndexWriter indexWriter = new IndexWriter(directory, indexWriterConfig)
> indexWriterConfig.setOpenMode(IndexWriterConfig.OpenMode.CREATE);
>
> How to add the below two feilds to the indexWriterConfig:
>
> IndexWriter.MaxFieldLength.LIMITED
> indexWriter.setMaxFieldLength(MAX_FIELD_SCAN_LENGTH)
>
> /*** 2.4 Construct ***//
> IndexWriter indexWriter = new IndexWriter(directory, stAnalyzer,
> create,IndexWriter.MaxFieldLength.LIMITED);
> indexWriter.setMaxFieldLength(MAX_FIELD_SCAN_LENGTH);
>
> All I am looking is how can we get the same kind of thing with the newer
> API.
>
> Thanks,
> Sai.
>
>
>
>
> --
> View this message in context: 
> http://lucene.472066.n3.nabble.com/IndexWriter-IndexWriter-MaxFieldLength-LIMITED-setMaxFieldLength-MAX-FIELD-SCAN-LENGTH-tp4035732p4035740.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
> For additional commands, e-mail: java-user-h...@lucene.apache.org
>

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

Reply via email to