lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (JIRA)" <>
Subject [jira] [Commented] (LUCENE-7902) Refactoring of IndexSearcher
Date Wed, 02 Aug 2017 03:25:00 GMT


Robert Muir commented on LUCENE-7902:

Personally I think the IndexWriterConfig thing has a lot of downsides. Its an additional class
the user must worry about and more complicated than a POJO: i think it makes something hard
to use.

In the case of IndexWriter there were so many getters and setters that we made this change
due to the sheer number, but I don't really see that as a good thing either :)

> Refactoring of IndexSearcher
> ----------------------------
>                 Key: LUCENE-7902
>                 URL:
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/search
>            Reporter: João Paulo Lemes Machado
> Hello everyone.
> I was analyzing the modularization of some classes, and I identified that the class IndexSearcher
 has an opportunity for cohesion improvement. 
> The class IndexWriter was in the same situation and the problem was solved as follows:
The IndexWriterConfig class was created, and several get() and set() methods that were used
only to configure the class parameters were moved from IndexWriter to IndexWriterConfig. 
> The new class was then accessed through an instance variable in IndexWriter. This strategy
has cleaned and improved IndexWriter cohesion.
> With this in mind, I would recommend creating a new class: IndexSearcherConfig , and
moving the following methods:
> setDefaultQueryCachingPolicy
> getDefaultQueryCachingPolicy
> getQueryCachingPolicy
> setQueryCachingPolicy
> setQueryCache
> getQueryCache
> setDefaultQueryCache
> getDefaultQueryCache
> setSimilarity
> getSimilarity
> from the IndexSearcher.
> Those parameters accessed by an instance variable in the IndexSearcher.
> Moreover, the orthogonality is the design would be enhanced.
> What do you think about that?

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message