lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SOLR-2477) add analyzer type="phrase"
Date Mon, 25 Apr 2011 20:25:03 GMT

    [ https://issues.apache.org/jira/browse/SOLR-2477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13024946#comment-13024946
] 

Robert Muir commented on SOLR-2477:
-----------------------------------

Well, we could maybe add something to the example, I thought it was sort of expert.

Well in my example, they would get matches for things that WDF normally splits, but only if
the punctuation is exactly as they entered it:
assume doc 3 is 'foo bar' and doc4 is 'foo-bar'
{noformat}
  /** 
   * test punctuation, we preserve the original for this purpose
   */
  public void testPunctuation() {
    assertQ("normal query: ",
       req("fl", "id", "q", "foo-bar", "sort", "id asc" ),
              "//*[@numFound='2']",
              "//result/doc[1]/int[@name='id'][.=3]",
              "//result/doc[2]/int[@name='id'][.=4]"
    );
    
    assertQ("phrase query: ",
        req("fl", "id", "q", "\"foo-bar\"", "sort", "id asc" ),
               "//*[@numFound='1']",
               "//result/doc[1]/int[@name='id'][.=4]"
     );
  }
{noformat}

But, this was just an example, you don't have to involve WDF to take advantage of this (probably
stopwords/synonyms/decompounders are the simplest way). I was just coming up with an examples
to have some unit tests.


> add analyzer type="phrase"
> --------------------------
>
>                 Key: SOLR-2477
>                 URL: https://issues.apache.org/jira/browse/SOLR-2477
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Robert Muir
>             Fix For: 4.0
>
>         Attachments: SOLR-2477.patch
>
>
> This is just exposing LUCENE-2892, so you can easily configure things
> so that if users put things in double quotes they get a more precise search.

--
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


Mime
View raw message