[
https://issues.apache.org/jira/browse/LUCENE-8326?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16488772#comment-16488772
]
Alessandro Benedetti commented on LUCENE-8326:
----------------------------------------------
Hi Robert,
first of all thanks for your feedback, much appreciated.
My initial goal was to make More Like This original 1000 lines class:
* More Readable
* Easier to Maintain and Extend
* More Testable
So I started identifying the different responsibilities in the More Like This
class, to separate them, in the way that if I just need to change the scoring
algorithm for the interesting terms I just touch the TermScorer ect ect :
You see the overall idea in these slides :
[https://www.slideshare.net/AlessandroBenedetti/advanced-document-similarity-with-apache-lucene]
I tried to modify as less as possible the logic and tests at this stage.
So let me wrap my considerations under different topics :
*Parameters Abstraction*
I see your point for just additional indirection/abstraction ( it is exactly
just that with readability in mind).
My scope for this was :
"We have 600 lines of code of default and parameters for the MLT. How to make
them isolated, more readable and extendable ?"
And I initially thought to just put them in a separate class to remove that
responsibility from the original MLT .
So the focus was exclusively better readability and easy maintenance at this
stage.
Can you elaborate why you think this is undesired ?
I don't have any strong feeling regarding this bit, so I am open to suggestions
with the forementioned objective in mind.
*MLT Immutable*
I didn't consider it , but I am completely open to do that.
In such case it could be worth to add a MoreLikeThis factory that manages the
parameters and create the immutable MLT object ?
*MoreLikeThisQuery*
It was not in the scope of this refactor but I am absolutely happy to tackle
that immediately as a next step, it could give it a try to see if there is
space for improvement there.
*Solr Tests*
I completely agree, indeed as part of my additional tests which I have ready
for the sequent refactors I introducedmuch more tests Lucene side than Solr
side.
We can elaborate this further at the right moment
> More Like This Params Refactor
> ------------------------------
>
> Key: LUCENE-8326
> URL: https://issues.apache.org/jira/browse/LUCENE-8326
> Project: Lucene - Core
> Issue Type: Improvement
> Reporter: Alessandro Benedetti
> Priority: Major
> Attachments: LUCENE-8326.patch, LUCENE-8326.patch
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> More Like This ca be refactored to improve the code readability, test
> coverage and maintenance.
> Scope of this Jira issue is to start the More Like This refactor from the
> More Like This Params.
> This Jira will not improve the current More Like This but just keep the same
> functionality with a refactored code.
> Other Jira issues will follow improving the overall code readability, test
> coverage and maintenance.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]