Bug 475326

Summary: Search doesn't return items based on substring comparing
Product: [Frameworks and Libraries] frameworks-baloo Reporter: medin <med.medin.2014>
Component: generalAssignee: baloo-bugs-null
Status: REPORTED ---    
Severity: normal CC: kfm-devel, nate, tagwerk19
Priority: NOR    
Version: 5.110.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Search doesn't return items based on substring comparing
Wrong result for "*data"

Description medin 2023-10-07 15:55:56 UTC
Created attachment 162146 [details]
Search doesn't return items based on substring comparing

The comparing is working only if the searched word is found between two separators like '.', space or '_', but it doesn't work if the word is concatenated to other non separator characters. See attached image for more info.
Comment 1 medin 2023-10-07 18:07:04 UTC
Created attachment 162148 [details]
Wrong result for "*data"
Comment 2 Nate Graham 2023-10-11 16:07:23 UTC
Does the same thing happen in the command-line `baloosearch` program?
Comment 3 medin 2023-10-11 16:45:45 UTC
(In reply to Nate Graham from comment #2)
> Does the same thing happen in the command-line `baloosearch` program?

Yes, the same results are returned by "baloosearch" command.
Comment 4 tagwerk19 2023-10-11 18:43:31 UTC
If you using the Baloo index, then this is not supported as per Bug 452628 (and also Bug 453291)

Dolphin's "There and Then" search - that it falls back to if Baloo is not available - does however manage wildcards.
Comment 5 medin 2023-10-11 18:56:21 UTC
(In reply to tagwerk19 from comment #4)
> If you using the Baloo index, then this is not supported as per Bug 452628
> (and also Bug 453291)
> 
> Dolphin's "There and Then" search - that it falls back to if Baloo is not
> available - does however manage wildcards.


If I disable Baloo I get much more weird results:

Consider the following files inside a folder : 
lessdata.txt
godata_test.txt
datatest.txt
data.test.txt
data_test.txt

- Searching for "*data*" returns nothing
- Searching "data" returns all files
- Searching "data*" returns all files
Comment 6 tagwerk19 2023-10-12 07:07:13 UTC
(In reply to medin from comment #5)
> - Searching for "*data*" returns nothing
> - Searching "data" returns all files
> - Searching "data*" returns all files
Apologies, you are quite right.

The filenamesearch copes with substrings (searches for "ata" and "ess" work for me) but not with arbitrary wildcards (searches for "*ata*", "*ess*" don't).