Using whitespace as analyzer reduces too much the matched items (#174)
This commit is contained in:
parent
48c05f60ed
commit
2ffaefeba0
|
@ -288,9 +288,9 @@ makeRequest options channel query from size sort =
|
|||
sort
|
||||
"option"
|
||||
"option_name"
|
||||
[ "option_name^2"
|
||||
, "option_name_query^2"
|
||||
, "option_description^1"
|
||||
[ "option_name^2.2"
|
||||
, "option_name_query^2.1"
|
||||
, "option_description^1."
|
||||
]
|
||||
)
|
||||
("latest-" ++ String.fromInt options.mappingSchemaVersion ++ "-" ++ channel)
|
||||
|
|
|
@ -414,11 +414,11 @@ makeRequest options channel query from size sort =
|
|||
sort
|
||||
"package"
|
||||
"package_attr_name"
|
||||
[ "package_attr_name^2"
|
||||
, "package_attr_name_query^2"
|
||||
, "package_pname^2"
|
||||
, "package_description^1"
|
||||
, "package_longDescription^1"
|
||||
[ "package_attr_name^2.3"
|
||||
, "package_pname^2.2"
|
||||
, "package_attr_name_query^2.1"
|
||||
, "package_description^1."
|
||||
, "package_longDescription^1."
|
||||
]
|
||||
)
|
||||
("latest-" ++ String.fromInt options.mappingSchemaVersion ++ "-" ++ channel)
|
||||
|
|
|
@ -748,17 +748,17 @@ search_fields query fields =
|
|||
(\queryIndex queryWord ->
|
||||
[ ( "multi_match"
|
||||
, Json.Encode.object
|
||||
[ ( "type", Json.Encode.string "most_fields" )
|
||||
[ ( "type", Json.Encode.string "bool_prefix" )
|
||||
, ( "query", Json.Encode.string queryWord )
|
||||
, ( "fuzziness", Json.Encode.int <| String.length queryWord // 5 )
|
||||
, ( "analyzer", Json.Encode.string "whitespace" )
|
||||
, ( "prefix_length", Json.Encode.int 3 )
|
||||
, ( "operator", Json.Encode.string "or" )
|
||||
, ( "_name"
|
||||
, Json.Encode.string <| "multi_match_" ++ queryWord ++ "_" ++ (queryIndex + 1 |> String.fromInt)
|
||||
)
|
||||
, ( "fields"
|
||||
, Json.Encode.list Json.Encode.string
|
||||
(List.map (\field -> field ++ "." ++ (queryIndex + 1 |> String.fromInt)) fields)
|
||||
(List.map (\field -> field ++ (queryIndex + 1 |> String.fromInt)) fields)
|
||||
)
|
||||
]
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue