using whitespace analyzer and not the default one (#172)

fixes #171
This commit is contained in:
Rok Garbas 2020-08-30 14:48:04 +02:00 committed by GitHub
parent b4a653519c
commit 48c05f60ed
Failed to generate hash of commit

View file

@ -751,6 +751,7 @@ search_fields query fields =
[ ( "type", Json.Encode.string "most_fields" ) [ ( "type", Json.Encode.string "most_fields" )
, ( "query", Json.Encode.string queryWord ) , ( "query", Json.Encode.string queryWord )
, ( "fuzziness", Json.Encode.int <| String.length queryWord // 5 ) , ( "fuzziness", Json.Encode.int <| String.length queryWord // 5 )
, ( "analyzer", Json.Encode.string "whitespace" )
, ( "operator", Json.Encode.string "or" ) , ( "operator", Json.Encode.string "or" )
, ( "_name" , ( "_name"
, Json.Encode.string <| "multi_match_" ++ queryWord ++ "_" ++ (queryIndex + 1 |> String.fromInt) , Json.Encode.string <| "multi_match_" ++ queryWord ++ "_" ++ (queryIndex + 1 |> String.fromInt)