Simplify search bar and menu

The option "contents" has been removed from the search bar. This field
is not intended to be used alone, but rather in conjunction with other
fields. Otherwise it may be really slow on large databases.

The "name" option has been removed from the search menu. This doesn't
provide anything better over the "Names" field, that search more
fields, including item names.
This commit is contained in:
Eike Kettner
2020-08-01 00:14:33 +02:00
parent 5bf302a40e
commit 46b784cc33
3 changed files with 57 additions and 48 deletions

View File

@ -599,24 +599,6 @@ view flags settings model =
]
]
]
, div
[ classList
[ ( "field", True )
, ( "invisible hidden", not flags.config.fullTextSearchEnabled )
]
]
[ label [] [ text "Content Search" ]
, input
[ type_ "text"
, onInput SetFulltext
, Util.Html.onKeyUpCode KeyUpMsg
, model.fulltextModel |> Maybe.withDefault "" |> value
]
[]
, span [ class "small-info" ]
[ text "Fulltext search in document contents."
]
]
, formHeaderHelp nameIcon "Names" ToggleNameHelp
, span
[ classList
@ -632,7 +614,7 @@ view flags settings model =
, text " to start searching."
]
, div [ class "field" ]
[ label [] [ text "All Names" ]
[ label [] [ text "Names" ]
, input
[ type_ "text"
, onInput SetAllName
@ -649,24 +631,6 @@ view flags settings model =
[ text "Looks in correspondents, concerned entities, item name and notes."
]
]
, div [ class "field" ]
[ label [] [ text "Name" ]
, input
[ type_ "text"
, onInput SetName
, Util.Html.onKeyUpCode KeyUpMsg
, model.nameModel |> Maybe.withDefault "" |> value
]
[]
, span
[ classList
[ ( "small-info", True )
, ( "invisible hidden", not model.showNameHelp )
]
]
[ text "Looks in item name only."
]
]
, formHeader (Icons.folderIcon "") "Folder"
, div [ class "field" ]
[ label [] [ text "Folder" ]
@ -681,6 +645,25 @@ view flags settings model =
[ label [] [ text "Exclude (or)" ]
, Html.map TagExcMsg (Comp.Dropdown.view settings model.tagExclModel)
]
, formHeader (Icons.searchIcon "") "Content"
, div
[ classList
[ ( "field", True )
, ( "invisible hidden", not flags.config.fullTextSearchEnabled )
]
]
[ label [] [ text "Content Search" ]
, input
[ type_ "text"
, onInput SetFulltext
, Util.Html.onKeyUpCode KeyUpMsg
, model.fulltextModel |> Maybe.withDefault "" |> value
]
[]
, span [ class "small-info" ]
[ text "Fulltext search in document contents and notes."
]
]
, formHeader (Icons.correspondentIcon "")
(case getDirection model of
Just Data.Direction.Incoming ->