3

Following code is returing me all the component list in 'compList' where Test_Date field in metadata is having value.

var Querydata = new SearchQueryData
{
FullTextQuery = "Test_Date",
ItemType = New ItemType[] {ItemType.Component}
};

ItendifiableObjectData[] compList = Client.GetSearchResult(queryData);

My question is if i need to list only those component whose "Test_Date" metadata field value is equal to a specific date. How to use this FullTextQuery?

Tried FullTextQuery = "Test_Date=2014-01-29T10:58:05" But not able to get any result.

3

Looking at the API and at what's possible through the GUI, I'd say you need to specify a schema using a BasedOnSchemaData object and set its Field and FieldValue property

something like:

BasedOnSchemaData basedSchemaNote = new BasedOnSchemaData();
basedSchemaNote.Schema = new LinkToSchemaData() { IdRef = "{your schema id}" };
basedSchemaNote.Field = "{schema DateField name}";
basedSchemaNote.FieldValue = "{date value}";
| improve this answer | |
  • Thanks @Reinder .. actually i have a Test_Date date field common in more than four Schemas, that is why i was trying to list all the components having date field value equal to a specific date without specifying a single Schema. – SDLBeginner Jan 29 '14 at 9:30
  • I checked from my end the above code is working for all the other metadata fields like dropdown, textbox. The only thing its not working is for date field. Suppose we are passing FullTextQuery = " Test_dropdowncontrol = testcontent", it will return list of all the components where the perticular metadata field Test_dropdowncontrol is having value as testcontent – SDLBeginner Jan 29 '14 at 13:24
  • what are you passing as a date value? – Reinder Wit Jan 29 '14 at 15:04
  • 2014-01-28T10:58:05 this is what i am passing as a value for date field. – SDLBeginner Jan 30 '14 at 5:04
2

just tried the below query and it now returning all the components with the specific date value: FullTextQuery = " 2014-01-29T10\\:58\\:05* in Test_Date ",

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.