You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Chris Harris (JIRA)" <ji...@apache.org> on 2008/08/31 23:27:44 UTC

[jira] Created: (SOLR-744) Patch to make ShingleFilter.outputUnigramIfNoNgrams (LUCENE-1370) available in Solr schema files

Patch to make ShingleFilter.outputUnigramIfNoNgrams (LUCENE-1370) available in Solr schema files
------------------------------------------------------------------------------------------------

                 Key: SOLR-744
                 URL: https://issues.apache.org/jira/browse/SOLR-744
             Project: Solr
          Issue Type: Improvement
            Reporter: Chris Harris
         Attachments: SOLR-744.patch

See LUCENE-1370

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


[jira] Commented: (SOLR-744) Patch to make ShingleFilter.outputUnigramIfNoNgrams (LUCENE-1370) available in Solr schema files

Posted by "Tom Burton-West (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-744?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12681923#action_12681923 ] 

Tom Burton-West commented on SOLR-744:
--------------------------------------

I applied both this and LUCENE-1370 and there seems to be some problem with passing arguments from the ShingleFilterFactory to the ShingleFilter.  The admin analyzer says that outputUnigramIfNoNgram=true

org.apache.solr.analysis.ShingleFilterFactory {outputUnigrams=false, outputUnigramIfNoNgram=true}

However, this does not seem to be getting set within the ShingleFilter and the admin analyzer shows nothing coming out of the ShingleFilterFactory when analyzing a query with a single word.
when using the admin interface to query a single word, I also get no results.

If I hack the patch by always setting outputUnigramsIfNoNgrams to true, everything works fine.
(see below)

If I am missing something or obviously doing something wrong, please let me know.  In the meantime I will try to write a unit test and track down the problem.  Is there an already existing unit test I could use as a model?

Tom Burton-West
------------------------------------------------------

Hack 

public void init(Map<String, String> args) {
    super.init(args);
    maxShingleSize = getInt("maxShingleSize", 
                            ShingleFilter.DEFAULT_MAX_SHINGLE_SIZE);
    outputUnigrams = getBoolean("outputUnigrams", true);
    outputUnigramIfNoNgrams = true; 
   /** tbw lets always set it to true above
    * comment out the original code below
    getBoolean("outputUnigramIfNoNgram", false);
    **/
  }


> Patch to make ShingleFilter.outputUnigramIfNoNgrams (LUCENE-1370) available in Solr schema files
> ------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-744
>                 URL: https://issues.apache.org/jira/browse/SOLR-744
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Chris Harris
>         Attachments: SOLR-744.patch
>
>
> See LUCENE-1370

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


[jira] Commented: (SOLR-744) Patch to make ShingleFilter.outputUnigramIfNoNgrams (LUCENE-1370) available in Solr schema files

Posted by "Chris Harris (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-744?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12681962#action_12681962 ] 

Chris Harris commented on SOLR-744:
-----------------------------------

Tom,

The Lucene half of this patch pair adds unit tests to src/test/org/apache/lucene/analysis/shingle/ShingleFilterTest.java. Do those tests pass when you run them on your custom lucene build, after applying LUCENE-1370? (cd to the top-level of lucene and then run "ant test -Dtestcase=ShingleFilterTest".) I didn't add any tests for the Solr half of the patch pair, but I also don't know how you would test it in a productive manner.

> Patch to make ShingleFilter.outputUnigramIfNoNgrams (LUCENE-1370) available in Solr schema files
> ------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-744
>                 URL: https://issues.apache.org/jira/browse/SOLR-744
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Chris Harris
>         Attachments: SOLR-744.patch
>
>
> See LUCENE-1370

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


[jira] Commented: (SOLR-744) Patch to make ShingleFilter.outputUnigramIfNoNgrams (LUCENE-1370) available in Solr schema files

Posted by "Tom Burton-West (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-744?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12683661#action_12683661 ] 

Tom Burton-West commented on SOLR-744:
--------------------------------------

Hi Chris,

Thanks for your kind  reply.  The lucene unit tests passed.  It turns out that  we had a configuration error that left an unpatched version of ShingleFilter on the classpath when Solr started up.  Once we made sure that the patched version was loading, everything has been working  just fine.

Tom

> Patch to make ShingleFilter.outputUnigramIfNoNgrams (LUCENE-1370) available in Solr schema files
> ------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-744
>                 URL: https://issues.apache.org/jira/browse/SOLR-744
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Chris Harris
>         Attachments: SOLR-744.patch
>
>
> See LUCENE-1370

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


[jira] Updated: (SOLR-744) Patch to make ShingleFilter.outputUnigramIfNoNgrams (LUCENE-1370) available in Solr schema files

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

Chris Harris updated SOLR-744:
------------------------------

    Attachment: SOLR-744.patch

> Patch to make ShingleFilter.outputUnigramIfNoNgrams (LUCENE-1370) available in Solr schema files
> ------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-744
>                 URL: https://issues.apache.org/jira/browse/SOLR-744
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Chris Harris
>         Attachments: SOLR-744.patch
>
>
> See LUCENE-1370

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