Bug 463830 - Summary: Differences between Dolphin's filenamesearch and baloosearch
Summary: Summary: Differences between Dolphin's filenamesearch and baloosearch
Status: REPORTED
Alias: None
Product: frameworks-baloo
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: baloo-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-04 13:10 UTC by tagwerk19
Modified: 2024-02-24 19:46 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tagwerk19 2023-01-04 13:10:35 UTC
SUMMARY:

    A review of the differences between Dolphin's filenamesearch and baloosearch -
    surprises and traps for the unwary.

BASE ISSUE:

    Dolphin search asks baloo when it thinks baloo has indexed the folders. If Dolphin
    thinks baloo has not indexed the files, it will fall back to using it's own "there
    and then" search.

    The two searches behave differently

    You can see whether Dolphin will ask baloo or doing a "there and then" search
    by looking at the search prompt. If you do a Ctrl-F to get the prompt and it
    looks like this:

        https://bugsfiles.kde.org/attachment.cgi?id=137170

    then you will be doing the "there and then" (filenamesearch) search. If however
    you see extra search options as here:

        https://bugsfiles.kde.org/attachment.cgi?id=137169

    then Dolphin knows it can ask baloo for its search results (baloosearch)

    As always this is a "best efforts" summary, no doubt there's something I've missed,
    quite likely something I've got wrong. The behaviours have been checked on Neon
    Testing and Fedora 36.

TERMINOLOGY:

    Beware, there are twisty passages all alike...

    Dolphin can call baloo or do its own "there and then" search, the code it uses to
    do these are "baloosearch" and "filenamesearch". The search prompts you get
    are dependent on which code Dolphin has decided to use.

    Separately, Dolphin gives you options for searching for filenames or content. A
    "filename" search and the filenamesearch code are not related and a "content"
    search does not necessarily depend on baloo. Dolphin tries to provide search
    functions irrespective of whether baloo is enabled.

    There is also a command line "baloosearch", useful for troubleshooting.

OBSERVED RESULTS:

    These are split up into "traps for the unwary" for Dolphin's "there and then" search,
    listed under Comment 1, and for Dolphin's "baloo" searches, listed under Comment 2

WISHED FOR RESULTS:

    Ideally, Dolphin should give the same results (as far as is possible) irrespective of
    whether it is asking baloo or doing its own search.

    Dolphin should ask baloo whether it has indexed a folder, rather than assume it has 
    (or hasn't). If baloo has indexed a folder, Dolphin should query baloo in preference
    to doing its own "there and then" search.
Comment 1 tagwerk19 2023-01-04 13:17:07 UTC
OBSERVED RESULTS:

    "There and Then" searches...

    If Dolphin gives a simple prompt:

        https://bugsfiles.kde.org/attachment.cgi?id=137170

    It will do a "there and then" search, calling "filenamesearch". Despite the name,
    "filenamesearch" can do either "Filename" or "Content" searches.

    1...
        If you are have clicked on "content", you will not get matches from the filename.
        This may not be what you expect.

    2...
        Content search is limited in comparison to baloo's search. You can search through
        text files but not documents. You will also not search xattr or embedded (such as
        EXIF or ID3) tags.

    3...
        You can search for parts of words, looking for "amp" will find you "example" as
        well as "ampersand". Wildcards as you might expect them to work, don't.

    4...
        Searches for the phrase "as is", which is straightforward and predictable. You don't
        get any "search logic", so looking for "one three" will not find "one two three" or
       "three one"

    5...
        If you are typing a search phrase, you will start getting shown matches after typing
        the first character.

    6...
        The recursive search follows symlinks. If you've set up links to folders outside
        your home directory, the search will follow them. This is probably the expected
        behaviour. You may find that files are "found" more than once.

    7...
        It can be slow
Comment 2 tagwerk19 2023-01-04 13:33:42 UTC
OBSERVED RESULTS:

    Dolphin using baloo's index...

    If Dolphin gives you additional options in the search prompt:

        https://bugsfiles.kde.org/attachment.cgi?id=137169

    then Dolphin thinks that baloo has indexed the data and can give faster and
    more comprehensive results.

    If you have baloo disabled or you have moved to folder in Dolphin that is excluded
    from indexing, Dolphin will do a "there and then" search (comment 1) and you won't
    see the additional options.

    1...
        If you have baloo enabled but haven't enabled "content indexing", you won't be
        able to do "Content" searches (Bug 446387)

    2...
        You cannot use wildcards. Looking for "amp" will find you "ampersand" but not
        "example", "*amp*" will not get you anything (Bug 453291)

    3...
        Provides search logic; a search for "one three" is treated as a search for "one AND
        three" so it will find "one two three" (and also "three two one").

        You can quote the search phrase to find the exact match

        The search logic behaves differently depending on whether you are searching
        for filenames or content:

            With baloosearch, if you search for "content" in Dolphin, the search will look for
            matches in both the filename and the content.

            When searching for filenames a search for "file - 1" seems to ignore the "-" and
            looks for filenames containing "file" and "1"

            However when doing a content search, searching for "file - 1" will not find the file.
            There's something strange with the handling of "separators", such as a "-"
            (Bug 434589)

        Issues with hyphens arise more frequently than expected as they are often used in
        track names, as in Bug 438850:

           https://bugsfiles.kde.org/attachment.cgi?id=139469

    4...
        If you are typing a search phrase character by character, you will notice:

            In filename searches, you will get exact matches even if you type a single
            character, so searching for "1" will find a "file 1" but not "file 1a"

            Again in a filename search, if you don't find an exact match, you need to
            type two characters, so you need to type "fi" to find "file 1"

            In content searches, you need to type three characters to find matches
            within the content.

    5...
        You can search metadata, examples include searching for anything changed in
        the last week or anything with a two star or more rating.
        In order to search for embedded EXIF or ID3 tags you need to have "content
        indexing" enabled.

    6...
        Dolphin makes assumptions about whether baloo has indexed a folder - which
        may not be right.

        Baloo does not follow symlinks when indexing so if you move to a symlinked folder
        in Dolphin and do a search "From Here", you will not will not get any results
        (Bug 442786 and the summary in Bug 447119).

    7...
        Baloo does not index "remote" filesystems. If you move to a remote folder in Dolphin
        and search from it, you will be doing a "there and then" search.
Comment 3 tagwerk19 2023-03-20 20:02:37 UTC
If dolphin is doing its own "There and Then" searches...

    Dolphin will not search down into "hidden" folders.

    You can see hidden files and folders if you enable "Show Hidden Files" but a Dolphin "There and Then"
    search will not list hidden files in the results or hunt down into hidden folders.

If dolphin is using baloo's index...

    The behaviour depends on whether baloo is "Indexing hidden files and folders", if so:

    You will see hidden files in the results if you have enabled "Show Hidden Files". The search will
    list normal files in hidden folders.

See Bug 467216.