You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Robert Muir (JIRA)" <ji...@apache.org> on 2011/03/23 17:50:05 UTC

[jira] [Created] (LUCENE-2986) divorce defaultsimilarityprovider from defaultsimilarity

divorce defaultsimilarityprovider from defaultsimilarity
--------------------------------------------------------

                 Key: LUCENE-2986
                 URL: https://issues.apache.org/jira/browse/LUCENE-2986
             Project: Lucene - Java
          Issue Type: Task
            Reporter: Robert Muir
            Assignee: Robert Muir
            Priority: Minor
             Fix For: 4.0


In LUCENE-2236 as a start, we made DefaultSimilarity which implements the factory interface (SimilarityProvider), and also extends Similarity.

Its factory interface just returns itself always by default.

Doron mentioned it would be cleaner to split the two, and I thought it would be good to revisit it later.

Today as I was looking at SOLR-2338, it became pretty clear that we should do this, it makes things a lot cleaner. I think currently its confusing to users to see the two apis mixed if they are trying to subclass.


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Resolved] (LUCENE-2986) divorce defaultsimilarityprovider from defaultsimilarity

Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-2986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Muir resolved LUCENE-2986.
---------------------------------

    Resolution: Fixed

Committed revision 1085374.

I cleaned up all the tests as Doron suggested, except for the solr MockConfigurableSimilarity as I discussed (since solr scoring is not yet per-field, but i have a patch for this that fixes the naming issues there too).

> divorce defaultsimilarityprovider from defaultsimilarity
> --------------------------------------------------------
>
>                 Key: LUCENE-2986
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2986
>             Project: Lucene - Java
>          Issue Type: Task
>            Reporter: Robert Muir
>            Assignee: Robert Muir
>            Priority: Minor
>             Fix For: 4.0
>
>         Attachments: LUCENE-2986.patch
>
>
> In LUCENE-2236 as a start, we made DefaultSimilarity which implements the factory interface (SimilarityProvider), and also extends Similarity.
> Its factory interface just returns itself always by default.
> Doron mentioned it would be cleaner to split the two, and I thought it would be good to revisit it later.
> Today as I was looking at SOLR-2338, it became pretty clear that we should do this, it makes things a lot cleaner. I think currently its confusing to users to see the two apis mixed if they are trying to subclass.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Commented] (LUCENE-2986) divorce defaultsimilarityprovider from defaultsimilarity

Posted by "Doron Cohen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2986?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13010570#comment-13010570 ] 

Doron Cohen commented on LUCENE-2986:
-------------------------------------

+1 for this change (I did not remember discussing this, but other than remembering I am consistent :))

Patch looks very clean.

Minor technical comments - concerning just some tests:

- some of the DSP implementations are still named xyzSimilarity - I think it would be more clear to name them xyzSimilarityProvider:
-- o.a.l.search.payloads.TestPayloadNearQuery.BoostingSimilarity
-- o.a.l.search.payloads.TestPayloadTermQuery.BoostingSimilarity
-- o.a.solr.schema.MockConfigurableSimilarity
-- o.a.l.index.TestIndexWriterConfig.MySimilarity
-- o.a.l.index.TestIndexReaderCloneNorms.SimilarityOne
-- o.a.l.index.TestNorms.SimilarityOne
-- o.a.l.index.TestOmitTf.SimpleSimilarity
-- o.a.l.search.TestSimilarity.SimpleSimilarity

- for few of the above it is not only the name - they are still doing both roles: {code}extends DefaultSimilarity implements SimilarityProvider{code}:
-- o.a.l.search.payloads.TestPayloadNearQuery.BoostingSimilarity
-- o.a.l.search.payloads.TestPayloadTermQuery.BoostingSimilarity
-- o.a.l.index.TestOmitTf.SimpleSimilarity
-- o.a.l.search.TestSimilarity.SimpleSimilarity

Other than that I think it is good to go in.

Also, tests from trunk/lucene and trunk/solr passed.
(I am seeing problems in running all trunk tests, at least on Windows, but I'll send a separate mail to the list on that)

> divorce defaultsimilarityprovider from defaultsimilarity
> --------------------------------------------------------
>
>                 Key: LUCENE-2986
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2986
>             Project: Lucene - Java
>          Issue Type: Task
>            Reporter: Robert Muir
>            Assignee: Robert Muir
>            Priority: Minor
>             Fix For: 4.0
>
>         Attachments: LUCENE-2986.patch
>
>
> In LUCENE-2236 as a start, we made DefaultSimilarity which implements the factory interface (SimilarityProvider), and also extends Similarity.
> Its factory interface just returns itself always by default.
> Doron mentioned it would be cleaner to split the two, and I thought it would be good to revisit it later.
> Today as I was looking at SOLR-2338, it became pretty clear that we should do this, it makes things a lot cleaner. I think currently its confusing to users to see the two apis mixed if they are trying to subclass.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Updated] (LUCENE-2986) divorce defaultsimilarityprovider from defaultsimilarity

Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-2986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Muir updated LUCENE-2986:
--------------------------------

    Attachment: LUCENE-2986.patch

Attached is a patch: adds DefaultSimilarityProvider, which has our default implementations of the non-field-specific methods (coord/queryNorm/etc), and always returns DefaultSimilarity.

> divorce defaultsimilarityprovider from defaultsimilarity
> --------------------------------------------------------
>
>                 Key: LUCENE-2986
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2986
>             Project: Lucene - Java
>          Issue Type: Task
>            Reporter: Robert Muir
>            Assignee: Robert Muir
>            Priority: Minor
>             Fix For: 4.0
>
>         Attachments: LUCENE-2986.patch
>
>
> In LUCENE-2236 as a start, we made DefaultSimilarity which implements the factory interface (SimilarityProvider), and also extends Similarity.
> Its factory interface just returns itself always by default.
> Doron mentioned it would be cleaner to split the two, and I thought it would be good to revisit it later.
> Today as I was looking at SOLR-2338, it became pretty clear that we should do this, it makes things a lot cleaner. I think currently its confusing to users to see the two apis mixed if they are trying to subclass.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Commented] (LUCENE-2986) divorce defaultsimilarityprovider from defaultsimilarity

Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2986?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13010672#comment-13010672 ] 

Robert Muir commented on LUCENE-2986:
-------------------------------------

Thanks, I agree the tests look messy/lazy... I'll fix these (well I think I would like to delay the solr one until SOLR-2338, i fixed the MockConfigurableSimilarity in that patch already)


> divorce defaultsimilarityprovider from defaultsimilarity
> --------------------------------------------------------
>
>                 Key: LUCENE-2986
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2986
>             Project: Lucene - Java
>          Issue Type: Task
>            Reporter: Robert Muir
>            Assignee: Robert Muir
>            Priority: Minor
>             Fix For: 4.0
>
>         Attachments: LUCENE-2986.patch
>
>
> In LUCENE-2236 as a start, we made DefaultSimilarity which implements the factory interface (SimilarityProvider), and also extends Similarity.
> Its factory interface just returns itself always by default.
> Doron mentioned it would be cleaner to split the two, and I thought it would be good to revisit it later.
> Today as I was looking at SOLR-2338, it became pretty clear that we should do this, it makes things a lot cleaner. I think currently its confusing to users to see the two apis mixed if they are trying to subclass.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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