Synonym in Query_string not working as expected

Hey, Thank you in advance, any help would be greatly appreciated.
I am not clear why this happening.

when i execute the given(below) query its return 200. but the synonym created for the query is not correct. so results are not as expected.
it also exclude the original word from query while creating synonym.

"analysis":{

   "filter":{
      "my_multiplexer":{

         "type":"multiplexer",
         "filters":[
            "lowercase",
            "job_title_filter_search",
            "english_stop",
            "porter_stem"
         ]
      },

      "english_stop":{
         "type":"stop",
         "stopwords":"_english_"
      },

      "job_title_filter_search":{
         "type":"synonym_graph",
         "synonyms_path":"synonyms/synonym_job_titles_search_inthensive.txt",
         "updateable":"true"
      }
   },

  "analyzer":{
     
      
     "synonym_analyzer_for_search":{
         "type":"custom",
         "char_filter":[
            "my_char_filter",
            "alphabets_char_filter"
         ],
         "tokenizer":"whitespace",
         "filter":[
            "lowercase",
            "my_multiplexer",
            "remove_duplicates"
         ]
      }
   },

   "char_filter":{
      "my_char_filter":{
         "type":"html_strip",
         "replacement":" "
      },
      "alphabets_char_filter":{
         "pattern":" |[-,/]|&",
         "type":"pattern_replace",
         "replacement":" "
      }
   }
},
  1. query = "location.address.city:delhi OR location.address.city:noida"

     "profile":True,
     "query":{
        "boosting":{
           "positive":{
              "bool":{
                 "must":[
                    {
                       "query_string":{
                          "query":"query",
                          "fields":[
                             "title^4",
                             "role^2"
                          ],
                          "quote_field_suffix":".keyword",
                          "#"                     "default_operator":"AND",
                          "type":"most_fields",
                          "tie_breaker":1,
                          "auto_generate_synonyms_phrase_query":True,
                          "#"                     "phrase_slop":2
                       }
                    }
                 ]
              }
           },
           "negative":{
              "term":{
                 "external":True
              }
           },
           "negative_boost":0.5
        }
     },
    

Synonyms in txt file

the synonym output

  1. if query = "location.address.city:delhi OR location.address.city:noida", it's creating "noida noida"
    (Synonym(location.address.city:delhi location.address.city:new) location.address.city:delhi location.address.city:\"noida noida\" location.address.city:\"greater noida\" location.address.city:\"gautam buddh nagar\" location.address.city:\"gautam buddh noida\")

  2. if query = "qa", it will remove the qa from query.
    (title:\"qa assurance\" title:\"quality assurance\" title:assurance title:qc)^4.0

  3. example if query = "qc"
    (title:\"qc assurance\" title:\"quality assurance\" title:qa title:assurance)^4.0

solved: don't use multiplexer with synonym_graph, they are buggy together.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.