lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <erickerick...@gmail.com>
Subject Re: Phrase Query Issue
Date Mon, 30 Nov 2009 14:17:35 GMT
You didn't say what field you're searching on, but if it's any
field with one of the stemmers involved, then this is expected
behavior. That is, "test" and "tests" are both stemmed to
"test". I do see SnowballPorterFilterFactory in your schema,
so this is what I'd check first....

Think carefully about removing this though. Depending on the
intent of the field users may well *want* this behavior.

Best
Erick

On Mon, Nov 30, 2009 at 6:02 AM, ravicv <ravichandrab4u@gmail.com> wrote:

>
> Hi I have a problem with phrase search.
>
> If I search test then tests is also coming in search result.
>
> Please help me ...
>
> My schema continues...
> "
>  <fieldType name="text" class="solr.TextField" positionIncrementGap="100">
>      < type="index">
>        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
>        <!-- in this example, we will only use synonyms at query time
>        <filter class="solr.SynonymFilterFactory"
> synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
>        -->
>
>        <filter class="solr.StopFilterFactory"
>                ignoreCase="true"
>                words="stopwords.txt"
>                enablePositionIncrements="true"
>                />
>        <filter class="solr.WordDelimiterFilterFactory"
> generateWordParts="0" generateNumberParts="0" catenateWords="1"
> catenateNumbers="1" catenateAll="1" splitOnCaseChange="0"
> preserveOriginal="1"/>
>        <filter class="solr.LowerCaseFilterFactory"/>
>        <filter class="solr.SnowballPorterFilterFactory" language="German"
> protected="protwords.txt"/>
>        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
>
>      < a nalyzer type="query">
>        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
>        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
> ignoreCase="true" expand="false"/>
>        <filter class="solr.StopFilterFactory"
>                ignoreCase="true"
>                words="stopwords.txt"
>                enablePositionIncrements="true"
>                />
>        <filter class="solr.WordDelimiterFilterFactory"
> generateWordParts="0" generateNumberParts="0" catenateWords="1"
> catenateNumbers="1" catenateAll="1" splitOnCaseChange="0"
> preserveOriginal="1"/>
>        <filter class="solr.LowerCaseFilterFactory"/>
>        <filter class="solr.SnowballPorterFilterFactory" language="German"
> protected="protwords.txt"/>
>        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
>      </analyzer>
>    </fieldType>
>
>
>        <fieldType name="text_exact" class="solr.TextField"
> positionIncrementGap="100">
>      <ana lyzer type="index">
>        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
>        <!-- in this example, we will only use synonyms at query time
>        <filter class="solr.SynonymFilterFactory"
> synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
>        -->
>        <!-- Case insensitive stop word removal.
>          add enablePositionIncrements=true in both the index and query
>          analyzers to leave a 'gap' for more accurate phrase queries.
>        -->
>        <filter class="solr.StopFilterFactory"
>                ignoreCase="true"
>                words="stopwords.txt"
>                enablePositionIncrements="true"
>                />
>        <filter class="solr.WordDelimiterFilterFactory"
> generateWordParts="0" generateNumberParts="0" catenateWords="1"
> catenateNumbers="1" catenateAll="1" splitOnCaseChange="0"
> preserveOriginal="1"/>
>        <filter class="solr.LowerCaseFilterFactory"/>
>
>        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
>      </analyz er>
>      <analyzer type="query">
>        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
>        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
> ignoreCase="true" expand="false"/>
>        <filter class="solr.StopFilterFactory"
>                ignoreCase="true"
>                words="stopwords.txt"
>                enablePositionIncrements="true"
>                />
>        <filter class="solr.WordDelimiterFilterFactory"
> generateWordParts="0" generateNumberParts="0" catenateWords="1"
> catenateNumbers="1" catenateAll="1" splitOnCaseChange="0"
> preserveOriginal="1"/>
>        <filter class="solr.LowerCaseFilterFactory"/>
>
>        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
>      </analy zer>
>    </fieldType>"
>
> and copy field
>
>         <copyField source="title_de" dest="text"/>
>     <copyField source="title_de" dest="text_exact"/>
>
> Please help me ...
>
>
>
>
> Otis Gospodnetic wrote:
> >
> >
> > Let me second this.  People ask for this pretty often.
> >
> >  Otis
> > --
> > Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch
> >
> >
> >
> > ----- Original Message ----
> >> From: Erik Hatcher <erik@ehatchersolutions.com>
> >> To: solr-user@lucene.apache.org
> >> Sent: Saturday, April 4, 2009 8:33:46 PM
> >> Subject: Re: Phrase Query Issue
> >>
> >>
> >> On Apr 4, 2009, at 1:25 AM, dabboo wrote:
> >>
> >> >
> >> > Erik,
> >> >
> >> > Thanks a lot for your reply. I have made some changes in the solr code
> >> and
> >> > now field clauses are working fine with dismax request. Not only this,
> >> > wildcard characters are also working with dismax and q query
> parameter.
> >> >
> >> > If you want I can share modified code with you.
> >>
> >> That'd be good to share.  Simply open a Solr JIRA issue with this
> >> enhancement
> >> request and post your code there.  Test cases and documentation always
> >> appreciated too, but working code to start with is fine.
> >>
> >>     Erik
> >
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/Phrase-Query-Issue-tp22863529p26572797.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message