Find "star wars" when i'm looking for "starwars"


(Arnaud) #1

Hi,

I have 200 products with the trade name "star wars" (separated by white space) but I don't get results when I'm searching "starwars" (all of it in lower case letters, not "StarWars") ?

Is there a way please ?


#2

Hi,
the only way I see to match "starwars" with "star wars", is to use the synonyms.
In that case, by simple expansion, you could have :

starwars, star wars

The expansion will add the term "starwars" to the documents with "star wars", so these documents will match searches "starwars" and "star wars".


(Arnaud) #3

Thank you


(Dominik) #4

You may consider to include Fuzzyness, when searching. Have you tried Fuzzy-queries?

Cheers, Dominik


#5

You should consider building an analyzer that consider that "star wars" and "starwars" are the same word by making it think that a space (\u0020) is equal to nothing.

"settings": {
    "analysis": {
      "char_filter": {
        "Char_filter_ponctuation": {
          "type": "mapping",
          "mappings": [
            "\\u0020 => ",
          ]
        },
      "tokenizer": {
        "one_tokenizer": {
          "type": "keyword"
        }
      },
      "analyzer": {
        "one": {
          "tokenizer": "one_tokenizer",
          "char_filter": [
            "Char_filter_ponctuation",
            ]}}}}}

(system) #6

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