Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I try to use following codes, but it does not work. Results is Status=ERROR_NO_RESULTS_FOUND Total count =null. If I use "88x211", I can get the right result. How to write queryXml to search out "88X211.doc" using keyword "211"?

String query_select_xml="<QueryPacket xmlns='urn:Microsoft.Search.Query' Revision='1000'><Query>"+"<Range><Count>50</Count></Range>"+"<Context>"+
            "<QueryText language='en-US' type='MSSQLFT'>"+
            "SELECT filename,Title, Path, Description, Write, Rank, Size,author,hitHighlightedSummary,hitHighlightedProperties,contentclass FROM Scope()";
    query_select_xml+=" WHERE \"Scope\" = '"+Scope.toString();
    //query_select_xml+="' AND FREETEXT(contents,'"+Keyword.toString()+"')";
    query_select_xml+="' And (\"Filename\" like '211%') ";
    //query_select_xml+="' AND FreeText(filename,'211*')";
    query_select_xml+="ORDER BY \"Rank\" Desc "+"</QueryText>"+"</Context>" +
            "<ImplicitAndBehavior>true</ImplicitAndBehavior>"+
            "<IncludeRelevanceResults>true</IncludeRelevanceResults>"+
            "<IncludeSpecialTermResults>true</IncludeSpecialTermResults>"+
            "<IncludeHighConfidenceResults>true</IncludeHighConfidenceResults>" +
            "</Query></QueryPacket>";
share|improve this question
add comment

1 Answer

I have found the solution. Setting the "Reduce storage requirements for text properties by using a hash for comparison" option in the settings of the managed property makes the LIKE predicate work.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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