lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Haycock" <Robert.Hayc...@mediasurface.com>
Subject CJKAnalyzer - does it work?
Date Thu, 15 Jun 2006 11:30:18 GMT
Hi,

I have a very simple example.  An IndexWriter (Lucene 1.9.0) with
CJKAnalyzer (latest version as of today).  A Chinese friend of mine as
given me a sentence and a word that appears in that sentence, eg:

"C1C2C3C4C5C6C7C8" where the word is "C3C4".

Here's code segment:

IndexWriter writer = new IndexWriter(directory, new CJKAnalyzer(),
true);
Document doc = new Document();
doc.add(new Field("name", " C1C2C3C4C5C6C7C8", Store.YES,
Index.TOKENIZED));
writer.addDocument(doc);
writer.optimize();
writer.close();

IndexSearcher searcher = new IndexSearcher(directory);
Hits hits = searcher.search(new TermQuery(new Term("name", "C3C4")));


This returns no hits.  I've also tried with the ChineseAnalyzer too, but
still no good.  It still works fine for English though.

Anyone know how to get this working?

Rob.

---------------------------------------------------------------------
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