You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by hkmortensen <ko...@yahoo.com> on 2010/04/15 22:45:33 UTC
Re: SOLR Exact match problem - Punctuations, double quotes etc.
Does the text being searched contain the dot at that place (after doctor)?
Hid-Mubarmij wrote:
>
> Hi,
> I am searching on SOLR and want to search exact match keywords.
> Punctualtion(Dot, Period), comma, double quotes or any other single
> charecter is being problematic when searching in SOLR for exact match
> keywords.
> For example a keyword:
>
> if i use
>
> "he is my doctor."
>
> then SOLR is returning the exact record which is correct bu t if I ommit
> the Punctualtion(Dot, Period) like
>
> "he is my doctor"
>
> SOLR returns Zero results. same case with comma, double quotes etc.
>
> Anybody have any idea about this.
>
> Many thanks in advance.
>
--
View this message in context: http://n3.nabble.com/SOLR-Exact-match-problem-Punctuations-double-quotes-etc-tp720807p722298.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: SOLR Exact match problem - Punctuations, double quotes etc.
Posted by Hid-Mubarmij <sh...@gmail.com>.
Thanks a lot Erick,
I just used this "solr.PatternReplaceFilterFactory" in my field and the
problem is solved.
Thanks
--
View this message in context: http://n3.nabble.com/SOLR-Exact-match-problem-Punctuations-double-quotes-etc-tp720807p725630.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: SOLR Exact match problem - Punctuations, double quotes etc.
Posted by Erick Erickson <er...@gmail.com>.
Well, I think that's part of your problem. WhitespaceAnalyzer does
exactly what it says, splits on whitespace. So indexing "carbon" and
searching "carbon." won't generate a hit.
If KeywordAnalyzer doesn't work for you, you could consider either
using one of the Pattern* guys or write your own.....
HTH
Erick
On Fri, Apr 16, 2010 at 12:18 AM, Hid-Mubarmij <sh...@gmail.com> wrote:
>
> Hi Erick,
>
> Thanks, I am using solr.WhitespaceTokenizerFactory and
> solr.LowerCaseFilterFactory for both index and query time.
> Following is the complete field i am using schema.xml:
> ==============================================
> <fieldType name="text_ws" class="solr.TextField"
> positionIncrementGap="100">
>
> <analyzer type = "index">
>
> <tokenizer class="solr.WhitespaceTokenizerFactory"/>
>
> <filter class = "solr.LowerCaseFilterFactory"/>
>
> </analyzer>
>
>
> <analyzer type="query">
>
> <tokenizer class = "solr.WhitespaceTokenizerFactory"/>
>
> <filter class="solr.LowerCaseFilterFactory"/>
>
> </analyzer>
>
>
> </fieldType>
> ==============================================
>
>
> --
> View this message in context:
> http://n3.nabble.com/SOLR-Exact-match-problem-Punctuations-double-quotes-etc-tp720807p723099.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
Re: SOLR Exact match problem - Punctuations, double quotes etc.
Posted by Hid-Mubarmij <sh...@gmail.com>.
Hi Erick,
Thanks, I am using solr.WhitespaceTokenizerFactory and
solr.LowerCaseFilterFactory for both index and query time.
Following is the complete field i am using schema.xml:
==============================================
<fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
<analyzer type = "index">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class = "solr.LowerCaseFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class = "solr.WhitespaceTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
==============================================
--
View this message in context: http://n3.nabble.com/SOLR-Exact-match-problem-Punctuations-double-quotes-etc-tp720807p723099.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: SOLR Exact match problem - Punctuations, double quotes etc.
Posted by Hid-Mubarmij <sh...@gmail.com>.
Hi hkmortensen,
Thanks, Yes the text contain the dot at that place (after doctor).
--
View this message in context: http://n3.nabble.com/SOLR-Exact-match-problem-Punctuations-double-quotes-etc-tp720807p723087.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: SOLR Exact match problem - Punctuations, double quotes etc.
Posted by Erick Erickson <er...@gmail.com>.
What analyzer is your field using at index and query time?
See:
http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters
<http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters>Some analyzers
strip punctuation, some don't. Some lowercase,
some don't. You can chain filters together to do most anything
you want...
HTH
Erick
On Thu, Apr 15, 2010 at 4:45 PM, hkmortensen <ko...@yahoo.com> wrote:
>
> Does the text being searched contain the dot at that place (after doctor)?
>
>
>
> Hid-Mubarmij wrote:
> >
> > Hi,
> > I am searching on SOLR and want to search exact match keywords.
> > Punctualtion(Dot, Period), comma, double quotes or any other single
> > charecter is being problematic when searching in SOLR for exact match
> > keywords.
> > For example a keyword:
> >
> > if i use
> >
> > "he is my doctor."
> >
> > then SOLR is returning the exact record which is correct bu t if I ommit
> > the Punctualtion(Dot, Period) like
> >
> > "he is my doctor"
> >
> > SOLR returns Zero results. same case with comma, double quotes etc.
> >
> > Anybody have any idea about this.
> >
> > Many thanks in advance.
> >
>
> --
> View this message in context:
> http://n3.nabble.com/SOLR-Exact-match-problem-Punctuations-double-quotes-etc-tp720807p722298.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>