1

I have a SharePoint Library 'Contact'

In this library i have created some custom column. Have gone through all the steps of 1st Full Crawl, automatic generation of crawl properties, creation of managed properties, mapping of them 2nd full crawl.

Now when i search in SharePoint search textbox using these crawl properties e.g. firstname:'John' it works. But my below XML generation code and query is not yeilding results.

private static string GetXMLString(string searchQuery)
    {
        StringBuilder xmlString = new StringBuilder();

        try
        {
            xmlString.Append("<QueryPacket xmlns='urn:Microsoft.Search.Query'>");
            xmlString.Append("<Query><SupportedFormats><Format revision='1'> urn:Microsoft.Search.Response.Document:Document</Format></SupportedFormats>");

            xmlString.Append("<Context><QueryText language='en-US' type='MSSQLFT'>");
            xmlString.Append(searchQuery);
            xmlString.Append("</QueryText></Context>");

            xmlString.Append("<ResultProvider>Default</ResultProvider>");
            xmlString.Append("<Range>");

            xmlString.Append("<StartAt>7</StartAt>");
            xmlString.Append("<Count>3</Count>");
            xmlString.Append("</Range>");

            xmlString.Append("</Query>");
            xmlString.Append("</QueryPacket>");
        }
        catch
        {
            throw;
        }

        return xmlString.ToString();
    }

"select    Path,crmcontactid,crmfirstname,crmlastname,crmfullname,crmcontacttype, crmrank,crmworkstatus,crmcity,crmstate,crmphoneone,crmphonetwo,crmmobilenumber,crmconsultantentrydate,crmcontactcreatedon,crmcountry from SCOPE()  where freetext('Java')   and \"crmcontacttype\" = 'Employee'"

The datatable remains empty. Whereas when i remove the custom column 'contacttype' i get results.

Thanks in advance

Your Answer

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

Browse other questions tagged or ask your own question.