lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Lea <ian....@gmail.com>
Subject Re: IndexWriter: IndexWriter.MaxFieldLength.LIMITED && setMaxFieldLength(MAX_FIELD_SCAN_LENGTH)
Date Thu, 24 Jan 2013 09:58:55 GMT
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 <saisantoshi76@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-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>

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


Mime
View raw message