FAQ
Hi,

I have documents with a field (data type definition for that field is
below) values as ear phones, sony ear phones, philips ear phones. when i
query for earphones sony ear phones is the top result where as i want ear
phones as top result. please suggest how to boost exact matches. PS: I have
earphones => ear phones in my synonyms.txt and the datatype definition for
that field keywords is <fieldType name="text" class="solr.TextField"
positionIncrementGap="100"> <analyzer type="index"> <tokenizer class=
"solr.WhitespaceTokenizerFactory"/> <filter class="solr.StopFilterFactory"
ignoreCase="true" words="stopwords.txt"/> <filter class=
"solr.LowerCaseFilterFactory"/> <filter class="solr.SynonymFilterFactory"
synonyms="synonyms.txt" ignoreCase="true" expand="true"/> <filter class=
"solr.RemoveDuplicatesTokenFilterFactory"/> </analyzer> <analyzer type=
"query"> <tokenizer class="solr.WhitespaceTokenizerFactory"/> <filter class=
"solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/> <filter
class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true"
expand="true"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class=
"solr.RemoveDuplicatesTokenFilterFactory"/> </analyzer> </fieldType> REGARDS,
Naveen

Search Discussions

  • Erick Erickson at Jun 14, 2016 at 3:49 pm
    If these are the complete field, i.e. your document
    contains exactly "ear phones" and not "ear phones
    are great" use a copyField to put it into an "exact_match"
    field that uses a much simpler analysis chain based
    on KeywordTokenizer (plus, perhaps things like
    lowercaseFilter, maybe strip punctuation and the like".
    Then you add a clause on exact_match boosted
    really high.

    Best,
    Erick

    On Tue, Jun 14, 2016 at 1:01 AM, Naveen Pajjuri
    wrote:
    Hi,

    I have documents with a field (data type definition for that field is
    below) values as ear phones, sony ear phones, philips ear phones. when i
    query for earphones sony ear phones is the top result where as i want ear
    phones as top result. please suggest how to boost exact matches. PS: I have
    earphones => ear phones in my synonyms.txt and the datatype definition for
    that field keywords is <fieldType name="text" class="solr.TextField"
    positionIncrementGap="100"> <analyzer type="index"> <tokenizer class=
    "solr.WhitespaceTokenizerFactory"/> <filter class="solr.StopFilterFactory"
    ignoreCase="true" words="stopwords.txt"/> <filter class=
    "solr.LowerCaseFilterFactory"/> <filter class="solr.SynonymFilterFactory"
    synonyms="synonyms.txt" ignoreCase="true" expand="true"/> <filter class=
    "solr.RemoveDuplicatesTokenFilterFactory"/> </analyzer> <analyzer type=
    "query"> <tokenizer class="solr.WhitespaceTokenizerFactory"/> <filter class=
    "solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/> <filter
    class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true"
    expand="true"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class=
    "solr.RemoveDuplicatesTokenFilterFactory"/> </analyzer> </fieldType> REGARDS,
    Naveen
  • Alessandro Benedetti at Jun 15, 2016 at 2:32 pm
    In addition to what Erick correctly proposed,
    are you storing norms for your field of interest ( to boost documents with
    shorter field values )?
    If you are, I find suspicious "Sony Ear Phones" to win over "Ear Phones"
    for your "Ear Phones" query.
    What are the other factors currently involved in your relevancy score
    calculus ?

    Cheers
    On Tue, Jun 14, 2016 at 4:48 PM, Erick Erickson wrote:

    If these are the complete field, i.e. your document
    contains exactly "ear phones" and not "ear phones
    are great" use a copyField to put it into an "exact_match"
    field that uses a much simpler analysis chain based
    on KeywordTokenizer (plus, perhaps things like
    lowercaseFilter, maybe strip punctuation and the like".
    Then you add a clause on exact_match boosted
    really high.

    Best,
    Erick

    On Tue, Jun 14, 2016 at 1:01 AM, Naveen Pajjuri
    wrote:
    Hi,

    I have documents with a field (data type definition for that field is
    below) values as ear phones, sony ear phones, philips ear phones. when i
    query for earphones sony ear phones is the top result where as i want ear
    phones as top result. please suggest how to boost exact matches. PS: I have
    earphones => ear phones in my synonyms.txt and the datatype definition for
    that field keywords is <fieldType name="text" class="solr.TextField"
    positionIncrementGap="100"> <analyzer type="index"> <tokenizer class=
    "solr.WhitespaceTokenizerFactory"/> <filter
    class="solr.StopFilterFactory"
    ignoreCase="true" words="stopwords.txt"/> <filter class=
    "solr.LowerCaseFilterFactory"/> <filter class="solr.SynonymFilterFactory"
    synonyms="synonyms.txt" ignoreCase="true" expand="true"/> <filter class=
    "solr.RemoveDuplicatesTokenFilterFactory"/> </analyzer> <analyzer type=
    "query"> <tokenizer class="solr.WhitespaceTokenizerFactory"/> <filter class=
    "solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/> <filter
    class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
    ignoreCase="true"
    expand="true"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class=
    "solr.RemoveDuplicatesTokenFilterFactory"/> </analyzer> </fieldType> REGARDS,
    Naveen


    --
    --------------------------

    Benedetti Alessandro
    Visiting card : http://about.me/alessandro_benedetti

    "Tyger, tyger burning bright
    In the forests of the night,
    What immortal hand or eye
    Could frame thy fearful symmetry?"

    William Blake - Songs of Experience -1794 England
  • Elisabeth benoit at Jun 16, 2016 at 1:24 pm
    In addition to what was proposed

    We use the technic described here

    https://github.com/cominvent/exactmatch

    and it works quite well.

    Best regards
    Elisabeth

    2016-06-15 16:32 GMT+02:00 Alessandro Benedetti <abenedetti@apache.org>:
    In addition to what Erick correctly proposed,
    are you storing norms for your field of interest ( to boost documents with
    shorter field values )?
    If you are, I find suspicious "Sony Ear Phones" to win over "Ear Phones"
    for your "Ear Phones" query.
    What are the other factors currently involved in your relevancy score
    calculus ?

    Cheers
    On Tue, Jun 14, 2016 at 4:48 PM, Erick Erickson wrote:

    If these are the complete field, i.e. your document
    contains exactly "ear phones" and not "ear phones
    are great" use a copyField to put it into an "exact_match"
    field that uses a much simpler analysis chain based
    on KeywordTokenizer (plus, perhaps things like
    lowercaseFilter, maybe strip punctuation and the like".
    Then you add a clause on exact_match boosted
    really high.

    Best,
    Erick

    On Tue, Jun 14, 2016 at 1:01 AM, Naveen Pajjuri
    wrote:
    Hi,

    I have documents with a field (data type definition for that field is
    below) values as ear phones, sony ear phones, philips ear phones. when
    i
    query for earphones sony ear phones is the top result where as i want
    ear
    phones as top result. please suggest how to boost exact matches. PS: I have
    earphones => ear phones in my synonyms.txt and the datatype definition for
    that field keywords is <fieldType name="text" class="solr.TextField"
    positionIncrementGap="100"> <analyzer type="index"> <tokenizer class=
    "solr.WhitespaceTokenizerFactory"/> <filter
    class="solr.StopFilterFactory"
    ignoreCase="true" words="stopwords.txt"/> <filter class=
    "solr.LowerCaseFilterFactory"/> <filter
    class="solr.SynonymFilterFactory"
    synonyms="synonyms.txt" ignoreCase="true" expand="true"/> <filter
    class=
    "solr.RemoveDuplicatesTokenFilterFactory"/> </analyzer> <analyzer type=
    "query"> <tokenizer class="solr.WhitespaceTokenizerFactory"/> <filter class=
    "solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/> <filter
    class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
    ignoreCase="true"
    expand="true"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class=
    "solr.RemoveDuplicatesTokenFilterFactory"/> </analyzer> </fieldType> REGARDS,
    Naveen


    --
    --------------------------

    Benedetti Alessandro
    Visiting card : http://about.me/alessandro_benedetti

    "Tyger, tyger burning bright
    In the forests of the night,
    What immortal hand or eye
    Could frame thy fearful symmetry?"

    William Blake - Songs of Experience -1794 England

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupsolr-user @
categorieslucene
postedJun 14, '16 at 8:01a
activeJun 16, '16 at 1:24p
posts4
users4
websitelucene.apache.org...

People

Translate

site design / logo © 2019 Grokbase