What are Fetch Index Elements in the CoreData Model?
Asked Answered
A

1

19

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?

Screenshot of Xcode xcdatamodel highlighting compoundIndex field

Annabelannabela answered 6/12, 2017 at 0:16 Comment(4)
#44387114 may be this helpTangible
... or this.Rathbone
Please look at this answer. Explained here. stackoverflow.com/a/46845344Matchless
I much prefer the given answer below to the links supplied above.Cards
L
31

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: https://developer.apple.com/documentation/coredata/nsmanagedobjectmodel#2888062

Lisa answered 17/12, 2017 at 5:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.