: : The "source" of my problems is the fact that I do not know in advance the : field names. Users are allowed to decide they own field names, they can, : at runtime, add new fields and different Lucene documents might have : different field names.
I would suggest you abstract away the field names your users pick and the underlying fieldnames you use when dealing with solr -- so create the list of fieldTypes you want to support (with all of the individual analzyer configurations that are valid) and then create a dynamicField corrisponding to each one. then if your user tells you they want an "author" field associated with the type "text_en" you can map that in your application to "author_text_end" at both indexing and query time. This will also let you map the same "logical field names" (from your user's perspective) to different "internal field names" (from Solr's perspective) based on usage -- searching the "author" field might be against "author_text_en" but sorting on "author" might use "author_string". (Some notes were drafted up a while back on making this kind of field name aliasing a feature of Solr, but nothing ever came of it... http://wiki.apache.org/solr/FieldAliasesAndGlobsInParams ) -Hoss