Spotlight

RSS for tag

Search for files and index your app’s content for searching using Spotlight.

Posts under Spotlight tag

108 Posts

Post

Replies

Boosts

Views

Activity

Multiple Spotlight indexers for the same file types?
I'd like to add additional metadata regarding image files to Spotlight's index, so that I can see the data in Get Info in Finder. I don't want to replace Apple's image indexer; I just want to add one more field. I am able to successfully create a new Spotlight indexer for a custom file type, and it works; in particular, I can see the new metadata in the Get Info window for the file in Finder. When I modify the indexer to also accept jpeg files, I'm seeing that Spotlight is choosing to use macOS' built-in image indexer all the time, and never my custom indexer. (I'm using mdimport -d2 -t sample.jpeg for testing) Before I start asking about code-level questions, it seems prudent to start with the basics: Is Spotlight willing to leverage multiple indexers for the same file type? Does mdimport -d2 -t sample.jpeg only test one single indexer? If not, what is the correct way to test an indexer that accepts file types already accepted by an Apple indexer?
1
0
759
Dec ’21
Xcode 13 simulator high CPU Spotlight
I'm on a MacBook Air M1 with Monterey and XCode 13 beta. On the first night my MBA ran out of battery within three hours. I check cpu usage, and it was Spotlight. Left it running for hours and hours, but Spotlight did not complete it's tasks. Then I noticed in an Activity Monitor sample output that it seemed to have a relation to the Xcode simulator. I quit that, and the cpu utilisation went down. I can reproduce it. Nothing special, an empty iOS App in an iPhone 12 Pro or mini simulator will cause busy cpu cores with Spotlight. I recommend not leaving the simulator running when on battery if you have the same issue ;) Anyone else seeing Spotlight taking up a lot of CPU resources when the Xcode simulator is running?
22
1
17k
Dec ’21
Attributes provided in CSImportExtension are not searchable in Files.app or UIDocumentBrowserViewController
I created a CSImportExtension in my UIDocument-based app to make the content of my documents searchable. Now I can successfully search for the content from the iOS home-screen search. But when I try the same search in the Files.app or from the document browser in my app, no results are shown. In the update attributes function in the extension, I am populating the following fields of the passed-in CSSearchableItemAttributeSet: keywords, contentDescription, displayName Does anybody know what I have to do to make the content searchable from all locations? I tried the same within the Pages, Numbers and Keynote apps and their document contents is found beautifully from the Files.app or from their document browsers. So it seems to work in principle. Thanks and cheers Frank
0
2
1.1k
Nov ’21
Searching for Shortcuts with NSMetadataQuery?
Using Spotlight, the currently available shortcuts of the Shortcuts app can be displayed and opened/started under macOS 12. Since I would like to display a list of available shortcuts in my application, I wonder how this could be realized. Using NSMetadataQuery and the corresponding NSPredicate Spotlight can be accessed and searched. Files, directories and various other information can be requested from Spotlight this way, but I can't find a suitable search filter to give me the available shortcuts. Does anyone here have any ideas?
1
0
836
Oct ’21
App cannot by sound in Appstore search by name
Hello everyone, this is my first question here, we (me and my wife) wrote our first iOS app, GraphMath, which is a graphic calculator, and released it in August, it is in AppStore, can be downloaded, here is the link, https://apps.apple.com/us/developer/yuri-morozov/id1582368813 but cannot be found by its name, GraphMath. If you put "graphmath" in the search, it will return a lot of related or unrelated apps. When we first released it on Aug 24, this was the case, then after an update and call to Customer service the second version appeared in the search for a day or two, but then, after the next release, disappeared again, and this was and still is the case for the last almost 2 months, despite multiple calls to App Developer support and their assurances that they are "actively working on it". There is no other app called GraphMath, there is only a GraphMath2, which also cannot be found by searching "graphmath", but can be by its full name, "graphmath2" What is also interesting that AppStore algorithm knows about our app: if you add almost any word, like "graphmath math" or "graphmath graph" or "graphmath calculator" or even "graphmath ipad", it will find it, along with that other Graphmath2. Even more interestingly, if you put "graphmath graphmath" (meaning do not add ANY extra info, besides the keyword graphmath), it returns our app, but it still does not return it if you just put "graphmath"... I have searched the forum and found several questions like this (mostly from 3-4 years ago), but could not find any resolution, does anybody know anything about it? thanks!
2
0
896
Oct ’21
Questions about CSSearchQuery and Spotlight
I have added the contents of my app to iOS Spotlight via the CSSearchableItemAttributeSet and it is very easy to find them from spotlight in use. I'd like to achieve a similar effect in the app via CSSearchQuery, but I'm currently running into a problem. In the system's spotlight, users can use fuzzy queries to find the information they want. I can't enter Chinese characters in the forum, 'hello' should be Chinese characters for example, if my content is in Chinese, 'hello', users can find the content not only by 'hello' but also by using 'nihao' to find the same content.('nihao' is the Latin pinyin equivalent of the Chinese word 'hello'). However, I am unable to achieve a similar effect in CKSearchQuery. At the moment CKSearchQuery only has [cdwt] four ways, is there any other means to achieve the above query capability. Or perhaps Apple does not have this capability open in CKSearchQuery.
2
0
1.4k
Sep ’21
How to determine why my spotlight importer is not working?
I have a SpotLight importer for my custom document type. At one point it was working, but apparently it stopped working a while ago. After rebuilding the SpotLight index (-E) in the course of debugging, the few documents that previously worked no longer work. I have tested the importer using mdimport -t -d3 and the output looks reasonable. However, if I do a simple search such as mdfind 'kMDItemTextContent == "gasoline or propane"', the text is not found, even though it is present in the importer output. In fact, if I save the importer output to a file, the text is found in that file. The console log contains many instances of this error from mdworker_shared: All kCFPreferencesCurrentUser domains in this process will be volatile, because homeDirPath starts with /var/empty Is there anything I can do to figure out what is going wrong? I'm running on macOS 11.5.1.
10
0
2.7k
Aug ’21
Multiple Spotlight indexers for the same file types?
I'd like to add additional metadata regarding image files to Spotlight's index, so that I can see the data in Get Info in Finder. I don't want to replace Apple's image indexer; I just want to add one more field. I am able to successfully create a new Spotlight indexer for a custom file type, and it works; in particular, I can see the new metadata in the Get Info window for the file in Finder. When I modify the indexer to also accept jpeg files, I'm seeing that Spotlight is choosing to use macOS' built-in image indexer all the time, and never my custom indexer. (I'm using mdimport -d2 -t sample.jpeg for testing) Before I start asking about code-level questions, it seems prudent to start with the basics: Is Spotlight willing to leverage multiple indexers for the same file type? Does mdimport -d2 -t sample.jpeg only test one single indexer? If not, what is the correct way to test an indexer that accepts file types already accepted by an Apple indexer?
Replies
1
Boosts
0
Views
759
Activity
Dec ’21
Xcode 13 simulator high CPU Spotlight
I'm on a MacBook Air M1 with Monterey and XCode 13 beta. On the first night my MBA ran out of battery within three hours. I check cpu usage, and it was Spotlight. Left it running for hours and hours, but Spotlight did not complete it's tasks. Then I noticed in an Activity Monitor sample output that it seemed to have a relation to the Xcode simulator. I quit that, and the cpu utilisation went down. I can reproduce it. Nothing special, an empty iOS App in an iPhone 12 Pro or mini simulator will cause busy cpu cores with Spotlight. I recommend not leaving the simulator running when on battery if you have the same issue ;) Anyone else seeing Spotlight taking up a lot of CPU resources when the Xcode simulator is running?
Replies
22
Boosts
1
Views
17k
Activity
Dec ’21
Attributes provided in CSImportExtension are not searchable in Files.app or UIDocumentBrowserViewController
I created a CSImportExtension in my UIDocument-based app to make the content of my documents searchable. Now I can successfully search for the content from the iOS home-screen search. But when I try the same search in the Files.app or from the document browser in my app, no results are shown. In the update attributes function in the extension, I am populating the following fields of the passed-in CSSearchableItemAttributeSet: keywords, contentDescription, displayName Does anybody know what I have to do to make the content searchable from all locations? I tried the same within the Pages, Numbers and Keynote apps and their document contents is found beautifully from the Files.app or from their document browsers. So it seems to work in principle. Thanks and cheers Frank
Replies
0
Boosts
2
Views
1.1k
Activity
Nov ’21
use UTTypeApplication on the CSSearchableItemAttributeSet
Could you help me find the answer to the following question: Can I use UTTypeApplication on the CSSearchableItemAttributeSet to index the app data in the Appstore? If yes, please tell me how or send a link to instructions
Replies
0
Boosts
0
Views
682
Activity
Nov ’21
Searching for Shortcuts with NSMetadataQuery?
Using Spotlight, the currently available shortcuts of the Shortcuts app can be displayed and opened/started under macOS 12. Since I would like to display a list of available shortcuts in my application, I wonder how this could be realized. Using NSMetadataQuery and the corresponding NSPredicate Spotlight can be accessed and searched. Files, directories and various other information can be requested from Spotlight this way, but I can't find a suitable search filter to give me the available shortcuts. Does anyone here have any ideas?
Replies
1
Boosts
0
Views
836
Activity
Oct ’21
App cannot by sound in Appstore search by name
Hello everyone, this is my first question here, we (me and my wife) wrote our first iOS app, GraphMath, which is a graphic calculator, and released it in August, it is in AppStore, can be downloaded, here is the link, https://apps.apple.com/us/developer/yuri-morozov/id1582368813 but cannot be found by its name, GraphMath. If you put "graphmath" in the search, it will return a lot of related or unrelated apps. When we first released it on Aug 24, this was the case, then after an update and call to Customer service the second version appeared in the search for a day or two, but then, after the next release, disappeared again, and this was and still is the case for the last almost 2 months, despite multiple calls to App Developer support and their assurances that they are "actively working on it". There is no other app called GraphMath, there is only a GraphMath2, which also cannot be found by searching "graphmath", but can be by its full name, "graphmath2" What is also interesting that AppStore algorithm knows about our app: if you add almost any word, like "graphmath math" or "graphmath graph" or "graphmath calculator" or even "graphmath ipad", it will find it, along with that other Graphmath2. Even more interestingly, if you put "graphmath graphmath" (meaning do not add ANY extra info, besides the keyword graphmath), it returns our app, but it still does not return it if you just put "graphmath"... I have searched the forum and found several questions like this (mostly from 3-4 years ago), but could not find any resolution, does anybody know anything about it? thanks!
Replies
2
Boosts
0
Views
896
Activity
Oct ’21
Questions about CSSearchQuery and Spotlight
I have added the contents of my app to iOS Spotlight via the CSSearchableItemAttributeSet and it is very easy to find them from spotlight in use. I'd like to achieve a similar effect in the app via CSSearchQuery, but I'm currently running into a problem. In the system's spotlight, users can use fuzzy queries to find the information they want. I can't enter Chinese characters in the forum, 'hello' should be Chinese characters for example, if my content is in Chinese, 'hello', users can find the content not only by 'hello' but also by using 'nihao' to find the same content.('nihao' is the Latin pinyin equivalent of the Chinese word 'hello'). However, I am unable to achieve a similar effect in CKSearchQuery. At the moment CKSearchQuery only has [cdwt] four ways, is there any other means to achieve the above query capability. Or perhaps Apple does not have this capability open in CKSearchQuery.
Replies
2
Boosts
0
Views
1.4k
Activity
Sep ’21
How to determine why my spotlight importer is not working?
I have a SpotLight importer for my custom document type. At one point it was working, but apparently it stopped working a while ago. After rebuilding the SpotLight index (-E) in the course of debugging, the few documents that previously worked no longer work. I have tested the importer using mdimport -t -d3 and the output looks reasonable. However, if I do a simple search such as mdfind 'kMDItemTextContent == "gasoline or propane"', the text is not found, even though it is present in the importer output. In fact, if I save the importer output to a file, the text is found in that file. The console log contains many instances of this error from mdworker_shared: All kCFPreferencesCurrentUser domains in this process will be volatile, because homeDirPath starts with /var/empty Is there anything I can do to figure out what is going wrong? I'm running on macOS 11.5.1.
Replies
10
Boosts
0
Views
2.7k
Activity
Aug ’21