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

MaxFieldLength is an  inner class in IndexWriter and UNLIMITED is a
static field in MaxFieldLength?

> I'm doing:
> (import '(org.apache.lucene.index IndexWriter))
> (def index-writer (new IndexWriter dir (new SimpleAnalyzer) true
> (.UNLIMITED (.MaxFieldLength IndexWriter))))

You are first trying to call a method MaxFieldLength on the
IndexWriter object. And then you're calling the method UNLIMITED on
the return value.

First of all, to access the static field you should use a form like this:
Class/Field

And secondly, since you're trying to access the inner class, I think
the syntax is like this:
IndexWriter$MaxFieldLength

So try replacing
(.UNLIMITED (.MaxFieldLength IndexWriter))))

with
IndexWriter$MaxFieldLength/UNLIMITED

> Why does the compiler think IndexWriter is a Class and not a
> org.apache.lucene.index.IndexWriter object?

IndexWriter is a Class. index-writer would be an instance of
IndexWriter in this case.

-- 
  ! Lauri

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

Reply via email to