lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mikhail Khludnev <m...@apache.org>
Subject Re: How can i specify a custom Analyzer for a Field of Document?
Date Tue, 10 Dec 2019 07:45:39 GMT
You can check how SolrAnalyzer switches chains across fields.

On Tue, Dec 10, 2019 at 9:41 AM 小鱼儿 <ctengctsh@gmail.com> wrote:

> Directory indexDataDir = FSDirectory.open(Paths.get("index_data"));
> Analyzer analyzer = MyLuceneAnalyzerFactory.newInstance();
> IndexWriterConfig iwc = new IndexWriterConfig(analyzer);
> iwc.setOpenMode(OpenMode.CREATE);
> iwc.setRAMBufferSizeMB(256.0);
> IndexWriter indexWriter = new IndexWriter(indexDataDir, iwc);
>
> like the above code which i use for building index, the problem is, Why i
> can only set 1 analyzer for the whole index?
>
> I have a document set, most fields to index is only text type, suited for a
> StandAnalyzer or a SmartChineseAnalyzer. But the problem is, i have a
> special field which is a KeywordList type, like "A;B;C", which i hope i can
> fully control the analyzing step.
>
> How to do this in Lucene?
>


-- 
Sincerely yours
Mikhail Khludnev

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message