In my xcdatamodel two new fields, byTitleIndex
and compoundIndex
, are showing under Fetch Index Elements. I have not seen this section before in Xcode. What is a Fetch Index Element?
Asked
Active
Viewed 6,386 times
18

lostAtSeaJoshua
- 1,695
- 2
- 21
- 34
-
https://stackoverflow.com/questions/44386614/ios-cant-compile-coredata-model-because-of-fetched-indexes-in-xcode-9 may be this help – narasimha Dec 12 '17 at 09:29
-
... or [this](https://stackoverflow.com/a/45922581/3985749). – pbasdf Dec 12 '17 at 17:24
-
Please look at this answer. Explained here. https://stackoverflow.com/a/46845344 – Yogendra Singh Oct 25 '18 at 13:11
-
1I much prefer the given answer below to the links supplied above. – C. Skjerdal Aug 26 '19 at 14:44
1 Answers
30
Fetch Index Elements are part of Apple’s new indexing API, announced at WWDC 2017. They allow you to specify one or more Index Elements; properties that are used to create an index for faster database searches. In your case, the "title" property will be used to create an index called “compoundIndex” under your "Passage" entity, allowing for faster title searches.
Announcement: https://developer.apple.com/videos/play/wwdc2017/210/?time=628
Demo: https://developer.apple.com/videos/play/wwdc2017/210/?time=997
Documentation (scroll down to "Working with Indexes"): https://developer.apple.com/documentation/coredata/nsmanagedobjectmodel

rymerej
- 553
- 5
- 5