[ 
https://issues.apache.org/jira/browse/LUCENE-2294?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12844213#action_12844213
 ] 

Shai Erera commented on LUCENE-2294:
------------------------------------

bq. Should we also move MergedSegmentWarmer to IWC?

I guess it could ... wonder how I missed it ...

bq. This adds more Version.LUCENE_CURRENTs in contrib... 

I added it on purpose, so we know to convert these places when we remove 
LUCENE_CURRENT. We can also do this gradually in LUCENE-2305.

bq. There were some tests that previously passed null as analyzers

Those were exactly the cases I wanted to move Analyzer out of the mandatory 
list. Whatever you pass will work for those tests, because they obviously don't 
rely on analysis ... otherwise they'd had been hit by NPE.
Hmm ... I wonder if I can still pass 'null' for them. I used eclipse 
search/replace tool to add the Analyzer to IWC calls. The null argument 
disappeared completely because they used the default, so the search/replace 
tool replaced that w/ Whitespace. I prefer to keep it that way, to avoid 
re-changing them again.

bq. There are a number of tests where the analyzers were changed ...

I thought that that's ok, because those tests don't rely on the output of 
analysis, or otherwise they should have tested/asserted it. Since they don't, 
it shouldn't matter to them. But I'll revert that change.

So two things I need to do:
# revert the changes to those tests
# add warmer to 

> Create IndexWriterConfiguration and store all of IW configuration there
> -----------------------------------------------------------------------
>
>                 Key: LUCENE-2294
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2294
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>            Reporter: Shai Erera
>            Assignee: Michael McCandless
>             Fix For: 3.1
>
>         Attachments: check.py, LUCENE-2294.patch, LUCENE-2294.patch, 
> LUCENE-2294.patch, LUCENE-2294.patch
>
>
> I would like to factor out of all IW configuration parameters into a single 
> configuration class, which I propose to name IndexWriterConfiguration (or 
> IndexWriterConfig). I want to store there almost everything besides the 
> Directory, and to reduce all the ctors down to one: IndexWriter(Directory, 
> IndexWriterConfiguration). What I was thinking of storing there are the 
> following parameters:
> * All of ctors parameters, except for Directory.
> * The different setters where it makes sense. For example I still think 
> infoStream should be set on IW directly.
> I'm thinking that IWC should expose everything in a setter/getter methods, 
> and defaults to whatever IW defaults today. Except for Analyzer which will 
> need to be defined in the ctor of IWC and won't have a setter.
> I am not sure why MaxFieldLength is required in all IW ctors, yet IW declares 
> a DEFAULT (which is an int and not MaxFieldLength). Do we still think that 
> 10000 should be the default? Why not default to UNLIMITED and otherwise let 
> the application decide what LIMITED means for it? I would like to make MFL 
> optional on IWC and default to something, and I hope that default will be 
> UNLIMITED. We can document that on IWC, so that if anyone chooses to move to 
> the new API, he should be aware of that ...
> I plan to deprecate all the ctors and getters/setters and replace them by:
> * One ctor as described above
> * getIndexWriterConfiguration, or simply getConfig, which can then be queried 
> for the setting of interest.
> * About the setters, I think maybe we can just introduce a setConfig method 
> which will override everything that is overridable today, except for 
> Analyzer. So someone could do iw.getConfig().setSomething(); 
> iw.setConfig(newConfig);
> ** The setters on IWC can return an IWC to allow chaining set calls ... so 
> the above will turn into 
> iw.setConfig(iw.getConfig().setSomething1().setSomething2()); 
> BTW, this is needed for Parallel Indexing (see LUCENE-1879), but I think it 
> will greatly simplify IW's API.
> I'll start to work on a patch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-dev-h...@lucene.apache.org

Reply via email to