Oct 30, 2012 at 8:10 PM
Edited Oct 30, 2012 at 8:12 PM
I also would like to search by field, or rather filter a list based on the values in the field, can you let me know if I am on the right track for using FieldIndexPartRecord to create my query?
First off...I don't see any way to do this query without adding a project ref to Orchard.Projections so that I can get access to the IRepository<FieldIndexPartRecord>. Is this correct or is there a different/better way to accomplish the same
thing without having to create the dependancy on Orchard.Projections in my own module?
I plan to use this repository to query the table based on the PropertyName and Value fields and then get the ContentItemRecord.Id property to populate a list of ids that I can then use to get only the content whose id in in that list.
I essentially want/need to be able to get a list of items that have a field with the selected value/filter. In this specific case I would like to query a list of Work Orders whose Status (Drop Down List w/values Open,Closed,etc.) is "Open".
var ids = _fieldIndexPartRepository.Fetch(
f => f.StringFieldIndexRecords.Any<StringFieldIndexRecord>(
r.PropertyName == "MyPart.MyPropertyName." &&
r.Value == "MyValue"
).Select(c => c.Id);