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 (Created) (JIRA)" <ji...@apache.org> on 2012/04/18 16:51:37 UTC
[jira] [Created] (LUCENE-3998) facet module should have no
dependencies, consolidate examples into demo/
facet module should have no dependencies, consolidate examples into demo/
-------------------------------------------------------------------------
Key: LUCENE-3998
URL: https://issues.apache.org/jira/browse/LUCENE-3998
Project: Lucene - Java
Issue Type: Task
Components: modules/facet
Affects Versions: 4.0
Reporter: Robert Muir
currently facets depends on analyzers-common, but this is unnecessary.
additionally it has a nice examples/ package (even with javadocs! are they actually seen anywhere?!),
as well as tests for those examples.
I think instead it would be better if facet/ had no dependencies,
and if examples+examples tests were in demo/.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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-3998) facet module should have no
dependencies, consolidate examples into demo/
Posted by "Robert Muir (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-3998?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robert Muir updated LUCENE-3998:
--------------------------------
Attachment: LUCENE-3998.patch
here's an initial patch (all tests pass), but there are things i don't like: see the comments in the script (which you must run first, before applying the patch):
{noformat}
mkdir -p lucene/demo/src/java/org/apache/lucene/facet
svn add lucene/demo/src/java/org/apache/lucene/facet
svn mv lucene/facet/src/examples/org/apache/lucene/facet/example lucene/demo/src/java/org/apache/lucene/facet
svn delete lucene/facet/src/examples
mkdir -p lucene/demo/src/test/org/apache/lucene/facet
svn add lucene/demo/src/test/org/apache/lucene/facet
svn mv lucene/facet/src/test/org/apache/lucene/facet/example lucene/demo/src/test/org/apache/lucene/facet
# move to test-framework
svn move lucene/facet/src/test/org/apache/lucene/util/SlowRAMDirectory.java lucene/test-framework/src/java/org/apache/lucene/util
# nocommit: can we improve this? some facet tests testing real functionality, but
# using example stuff... if the tests arent actually testing the example they should stay in facet/
# and we won't need to bogusly code-dup the FacetTestUtils?
svn copy lucene/facet/src/test/org/apache/lucene/facet/FacetTestUtils.java lucene/demo/src/test/org/apache/lucene/facet
svn move lucene/facet/src/test/org/apache/lucene/facet/enhancements/EnhancementsPayloadIteratorTest.java lucene/demo/src/test/org/apache/lucene/facet/example
svn move lucene/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCounts.java lucene/demo/src/test/org/apache/lucene/facet/example
svn move lucene/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCountsCache.java lucene/demo/src/test/org/apache/lucene/facet/example
svn move lucene/facet/src/test/org/apache/lucene/facet/index/FacetsPayloadProcessorProviderTest.java lucene/demo/src/test/org/apache/lucene/facet/example
{noformat}
> facet module should have no dependencies, consolidate examples into demo/
> -------------------------------------------------------------------------
>
> Key: LUCENE-3998
> URL: https://issues.apache.org/jira/browse/LUCENE-3998
> Project: Lucene - Java
> Issue Type: Task
> Components: modules/facet
> Affects Versions: 4.0
> Reporter: Robert Muir
> Attachments: LUCENE-3998.patch
>
>
> currently facets depends on analyzers-common, but this is unnecessary.
> additionally it has a nice examples/ package (even with javadocs! are they actually seen anywhere?!),
> as well as tests for those examples.
> I think instead it would be better if facet/ had no dependencies,
> and if examples+examples tests were in demo/.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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-3998) facet module should have no
dependencies, consolidate examples into demo/
Posted by "Shai Erera (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-3998?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13257286#comment-13257286 ]
Shai Erera commented on LUCENE-3998:
------------------------------------
These are not general utilities -- they are really example code that show how to index all sort of facet stuff. The examples generate some docs randomly, while other methods use example text as documents, and some predefined categories (with weights). Really, the examples package is meant to be whole in the sense that it comes with some example data, evaluation methods and example code.
Some facet tests just use these methods as convenient *test* utilities to index a bunch of documents, but that's it. Moving these utils into e.g. FacetTestUtils will remove them from the examples, which is not good. Keeping them there introduces a dependency on lucene-demo. So seems to me that we need to duplicate a lot of code just to avoid the dependency on lucene-demo, that exist anywhere for test purposes only.
Are there other modules with example code? If not, perhaps we should wait until we have some more modules with such examples, before we refactor things?
Another option would be to keep the examples in facet, but package them into lucene-demo/examples-4.0.0.jar. That way, someone can take the demo.jar, or the lucene-facet.jar. If he wants to run tests (why would he?), he'll need to put the lucene-demo in the classpath.
> facet module should have no dependencies, consolidate examples into demo/
> -------------------------------------------------------------------------
>
> Key: LUCENE-3998
> URL: https://issues.apache.org/jira/browse/LUCENE-3998
> Project: Lucene - Java
> Issue Type: Task
> Components: modules/facet
> Affects Versions: 4.0
> Reporter: Robert Muir
> Attachments: LUCENE-3998.patch
>
>
> currently facets depends on analyzers-common, but this is unnecessary.
> additionally it has a nice examples/ package (even with javadocs! are they actually seen anywhere?!),
> as well as tests for those examples.
> I think instead it would be better if facet/ had no dependencies,
> and if examples+examples tests were in demo/.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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-3998) facet module should have no
dependencies, consolidate examples into demo/
Posted by "Shai Erera (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-3998?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13257209#comment-13257209 ]
Shai Erera commented on LUCENE-3998:
------------------------------------
I think that having one place for all our examples is a great idea. lucene-demo (or maybe we rename it to lucene-examples) sounds like the right place.
I took a look at all the nocommit moves, and some are easy to resolve, but others not so easy. For example:
* FacetsPayloadProcessorProviderTest tests PayloadProcessorProvider, through TaxonomyMergeUtils. TMU, imo, should remain in examples, but I don't think that we should duplicate its logic in facet/src/test/. If we move to test to the examples, it will show as if PPP is not tested by the facets package ...
* MultiCLIndexer/Searcher are good examples of how to create multiple category lists for different facets. They are used by some facet tests code, even though they have tests of their own, as utilities to indexing such documents. Duplicating the logic seems wrong to me, and moving them to facet/src/test is also wrong.
So question -- what's wrong with having tests depend on other modules? None of the facet/src/java code depends on any module now, but what if facet tests would depend on demo?
> facet module should have no dependencies, consolidate examples into demo/
> -------------------------------------------------------------------------
>
> Key: LUCENE-3998
> URL: https://issues.apache.org/jira/browse/LUCENE-3998
> Project: Lucene - Java
> Issue Type: Task
> Components: modules/facet
> Affects Versions: 4.0
> Reporter: Robert Muir
> Attachments: LUCENE-3998.patch
>
>
> currently facets depends on analyzers-common, but this is unnecessary.
> additionally it has a nice examples/ package (even with javadocs! are they actually seen anywhere?!),
> as well as tests for those examples.
> I think instead it would be better if facet/ had no dependencies,
> and if examples+examples tests were in demo/.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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-3998) facet module should have no
dependencies, consolidate examples into demo/
Posted by "Robert Muir (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-3998?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13257214#comment-13257214 ]
Robert Muir commented on LUCENE-3998:
-------------------------------------
{quote}
So question – what's wrong with having tests depend on other modules? None of the facet/src/java code depends on any module now, but what if facet tests would depend on demo?
{quote}
Its a sign stuff is in the wrong place.
If that stuff is really utility methods (which it looks like to me), it shouldnt be in examples anyway.
it should be in facet/src/java as a utility method.
> facet module should have no dependencies, consolidate examples into demo/
> -------------------------------------------------------------------------
>
> Key: LUCENE-3998
> URL: https://issues.apache.org/jira/browse/LUCENE-3998
> Project: Lucene - Java
> Issue Type: Task
> Components: modules/facet
> Affects Versions: 4.0
> Reporter: Robert Muir
> Attachments: LUCENE-3998.patch
>
>
> currently facets depends on analyzers-common, but this is unnecessary.
> additionally it has a nice examples/ package (even with javadocs! are they actually seen anywhere?!),
> as well as tests for those examples.
> I think instead it would be better if facet/ had no dependencies,
> and if examples+examples tests were in demo/.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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