Oh, I guess you also have to import IndexWriter$MaxFieldLength (not sure though, test with both !) :
(import '(org.apache.lucene.index IndexWriter IndexWriter$MaxFieldLength)) 2009/10/9 Laurent PETIT <[email protected]> > Hi, quick answer : > > try (IndexWriter$MaxFieldLength/UNLIMITED) > > > > HTH > > -- > Laurent > > 2009/10/9 tommy c <[email protected]> > > >> I'm trying to translate a java lucene indexer to clojure. >> This java line is bothersome: >> writer = new IndexWriter(dir, new SimpleAnalyzer(), true, >> IndexWriter.MaxFieldLength.UNLIMITED); >> >> I'm doing: >> (import '(org.apache.lucene.index IndexWriter)) >> (def index-writer (new IndexWriter dir (new SimpleAnalyzer) true >> (.UNLIMITED (.MaxFieldLength IndexWriter)))) >> >> The error: >> java.lang.IllegalArgumentException: No matching field found: >> MaxFieldLength for class java.lang.Class (indexer.clj:0) >> >> This is how MaxFieldLength is defined in Lucene: >> public static final MaxFieldLength UNLIMITED = new MaxFieldLength >> ("UNLIMITED", Integer.MAX_VALUE); >> >> >> Why does the compiler think IndexWriter is a Class and not a >> org.apache.lucene.index.IndexWriter object? >> >> >> >> >> > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---
