Trouble with Search using MSSQLFT and Like

I am using SPServices to run a search on a scope I have defined. When the page first loads, I run a query that retrieves all the items from the search scope using
var queryExtra = '';
var q = "SELECT Title,Path,Description,Write,Rank,Size,SiteTitle FROM SCOPE() WHERE ";
q += queryExtra + " (\"SCOPE\"='LC Engagement Sites') ORDER BY Rank";
var queryText = makeQuery(q);
$().SPServices({
operation: "Query",
queryXml: queryText,
completefunc: function(xData, Status) {
The function makeQuery turns the sql into the required xml.  When run, this works.
I also have a textbox that allows the user to show only ones where the title contains some text.  I have tried using like and contains to restrict the search but both return no results.
var queryExtra = getAll || title == "" ? "" : " Title like '%" + title + "%' AND ";
var queryExtra = getAll || title == "" ? "" : " CONTAINS(title,'" + title + "') and ";
The query ends up looking like this
SELECT Title,Path,Description,Write,Rank,Size,SiteTitle FROM SCOPE() WHERE  CONTAINS(title,'taiwan') and  ("SCOPE"='LC Engagement Sites') ORDER BY Rank
or 
SELECT Title,Path,Description,Write,Rank,Size,SiteTitle FROM SCOPE() WHERE  title LIKE '%taiwan%' and  ("SCOPE"='LC Engagement Sites') ORDER BY Rank
and the query packet looks like this
<QueryPacket xmlns='urn:Microsoft.Search.Query' Revision='1000'>
<Query>
<Context>
<QueryText language='en-US' type='MSSQLFT'><!
[CDATA[SELECT Title, Path, Description, Write, Rank, Size, SiteTitle
FROM SCOPE()
WHERE CONTAINS(title,'taiwan') and
("SCOPE"='LC Engagement Sites') ORDER BY Rank
]]>
</QueryText>
</Context>
<IncludeSpecialTermResults>
true
</IncludeSpecialTermResults>
<Range>
<Count>1000</Count>
</Range>
</Query>
</QueryPacket>
Is there something I'm doing wrong? I've seen many examples that show that this is possible but so far no luck.

Hi,
The following code for your reference:
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta name="WebPartPageExpansion" content="full" />
<script language="javascript" src="jquery-1.8.2.min.js"></script>
<script language="javascript" src="jquery.SPServices-0.7.2.min.js"></script>
<script language="javascript">
(function () {
function querySearchService(scopeName, keywordToSearch, maxItemCount) {
keywordToSearch = keywordToSearch.trim().replace(/\s+/g, "+");
var queryText = "<QueryPacket xmlns='urn:Microsoft.Search.Query' Revision='1000'>"
queryText += "<Query>"
queryText += "<Range><StartAt>1</StartAt><Count>" + maxItemCount + "</Count></Range>"
queryText += "<Context>"
queryText += "<QueryText language='en-US' type='MSSQLFT'>"
queryText += "SELECT Title,Path,Description,Write,Rank,Size,SiteTitle FROM scope() WHERE CONTAINS ('" + keywordToSearch + "') AND \"scope\"='" + scopeName + "' AND ISDOCUMENT=true ORDER BY Rank DESC"
queryText += "</QueryText>"
queryText += "</Context>"
queryText += "</Query>"
queryText += "<EnableStemming>True</EnableStemming>"
queryText += "<TrimDuplicates>True</TrimDuplicates>"
queryText += "</QueryPacket>";
//alert(queryText);
$().SPServices({
operation: "Query",
queryXml: queryText,
completefunc: function (xData, Status) {
$(xData.responseXML).find("QueryResult").each(function () {
var array = new Array();
alert($(this).text());
var result = $.parseXML($(this).text());
var matches = result.find("Document");
if (matches.length == 0) {
alert("Nothing Found!");
return;
$("#dynamic-search-results").empty();
matches.each(function () {
url = $("Properties>Property:nth-child(2)>Value", $(this)).text();
title = $("Properties>Property:nth-child(1)>Value", $(this)).text();
$("#resultDiv").append($("<p></p>").append($("<a></a>").prop("href", url).text(title)));
$(document).ready(function () {
querySearchService("LC Engagement Sites", "SharePoint", 10);
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled 2</title>
</head>
<body>
<div id="resultDiv"></div>
</body>
</html>
More information is here:
http://jeffywang.blogspot.com/2014/01/utilizing-spservices-to-call-sharepoint.html
Best Regards
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected].

Similar Messages

  • UCM Search using firstname and lastname

    Hi,
    One of our requirement is to enable the search using firstname and lastname. We store users, groups, roles, and accounts in Oracle Internet Directory and integrated with UCM. I would like to know the ways to show firstname and lastname fields in the search so that users can search with those properties instead of author metadata .
    Thanks,
    Raj

    If I got the question, first name and last name refer to first and last names of document authors, right? Otherwise, I miss the link between search for documents and people identities in an identity pool.
    Note that search dialogs support "wild-characters" - that is, you can enter "Jiri Mac*" instead of "Jiri Machotka" - alternatively, use "Contains" rather than "Equals To" criteria.
    Furthermore, I'm wondering how you intend to use first and last names in GUI - do you prefer to have two names that you somehow construct together? Do you want to display the names to users? (How many names will be in first names? How many in last names?)

  • Having trouble with pop-up windows and ads for MacKeeper

    I've been having trouble with pop-up windows and ads for MacKeeper and similar "services." Tried to download "MPlayerX" a week ago and it all started then. I thought I deleted the file but I'm still having trouble. I've been digging for solutions on here, but nothing I've found on here has worked yet--the VSearch stuff (I think) isn't on my hard drive. Any advice?

    You installed a variant of the "VSearch" trojan. Remove it as follows.
    This malware has many variants. Anyone else finding this comment should not expect it to be applicable.
    Back up all data before proceeding.
    Triple-click anywhere in the line below on this page to select it:
    /Library/LaunchAgents/com.venus.agent.plist
    Right-click or control-click the line and select
              Services ▹ Reveal in Finder (or just Reveal)
    from the contextual menu.* A folder should open with an item selected. Drag the selected item to the Trash. You may be prompted for your administrator login password.
    Repeat with each of these lines:
    /Library/LaunchDaemons/com.venus.daemon.plist
    /Library/LaunchDaemons/com.venus.helper.plist
    Restart the computer and empty the Trash. Then delete the following items in the same way:
    /Library/Application Support/venus
    /System/Library/Frameworks/v.framework
    The problem may have started when you downloaded and ran an application called "MPlayerX." That's the name of a legitimate free movie player, but the name is also used fraudulently to distribute VSearch. If there is an item with that name in the Applications folder, delete it, and if you wish, replace it with the genuine article from mplayerx.org.
    This trojan is often found on illegal websites that traffic in pirated content such as movies. If you, or anyone else who uses the computer, visit such sites and follow prompts to install software, you can expect more of the same, and worse, to follow. Never install any software that you downloaded from a bittorrent, or that was downloaded by someone else from an unknown source.
    In the Security & Privacy pane of System Preferences, select the General tab. The radio button marked Anywhere  should not be selected. If it is, click the lock icon to unlock the settings, then select one of the other buttons. After that, don't ignore a warning that you are about to run or install an application from an unknown developer.
    Then, still in System Preferences, open the App Store or Software Update pane and check the box marked
              Install system data files and security updates (OS X 10.10 or later)
    or
              Download updates automatically (OS X 10.9 or earlier)
    if it's not already checked.
    *If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combination  command-C. In the Finder, select
              Go ▹ Go to Folder...
    from the menu bar and paste into the box that opens by pressing command-V. You won't see what you pasted because a line break is included. Press return.

  • I'm having trouble with my sound up and sound down keys. They're doing other functions. This is only a new thing.

    I'm having trouble with my 'sound up' and 'sound down' keys. They're doing other functions. This is only a relatively new thing.

    You didn't mention what those "other functions" were.  That might help!
    First thing to check is System Preferences > Keyboard > Keyboard tab - make sure "Use all F1, F2, etc. keys as standard function keys" is un-checked.  Hopefully that still works in Mountain Lion.

  • Problem in creating client side PDF with image using flex and AlivePD

    I need a favor I am creating client side PDF with image using flex and AlivePDF for a web based application. Images have been generated on that pdf but it is creating problem for large size images as half of the image disappeared from that pdf.I am taking the image inside a canvas . How do i control my images so that they come fit on that pdf file for any image size that i take.
    Thanks in advance
    Atishay

    I am having a similar and more serious problem. It takes a
    long time to execute, but even attaching a small image balloons the
    pdf to 6MB plus. After a few images it gets up to 20MB. These are
    100k jpeg files being attached. The resulting PDF is too large to
    email or process effectively. Does anyone know how to reduce
    size/processing?

  • I am having trouble with the Jpeg icons and also now thumbnails not being visable in bith teh Apple finder and now also Adobe Bridge. Can anyone shed any light on this ?

    I am having trouble with the Jpeg icons and also now thumbnails not being visable in bith teh Apple finder and now also Adobe Bridge. Can anyone shed any light on this ?

    Argh - once again, I find my solution right after posting this. Left out one modification to the SWIG script, now it runs in 29 seconds vs C 16 seconds, I can live with that.

  • Trouble with iMovie '11 transitions and themes? I'm running Lion, Mac OS X and just noticed today that the transitions and themes don't seem to be working at all when I start new projects or try to add to old projects.  What is the solve here?

    Trouble with iMovie '11 transitions and themes? I'm running Lion, Mac OS X and just noticed today that the transitions and themes don't seem to be working at all when I start new projects or try to add to old projects.  What is the solve here?
    I've seen notes about clearing the cache but it seems that this is an older OS and I can't find the plist mentioned here because it's an older system.  http://www.youtube.com/watch?v=2cL9RuDV3Qc 
    Thoughts?  Anyone? 

    GUYS, I NEED HELP !
    ANYONE?

  • I am creating a slideshow with elements using photos and videos but the video sound doesnt play?

    I am creating a slideshow with elements using photos and videos but the video sound doesnt play?

     Hello jive
         I am playing it back in the slideshow editor/setting up part of
    programme where you determine photos/video to be included gaps between
    slides, music to play etc This goes through each phot and when comes
    to a video the background sound doesnt play, I am using windows 7 and
    elements 10.
         regards gins51

  • How Achieve timedseries calculations with out using AGO And ToDate function

    Hi,,
    1)
    How Achieve timedseries calculations with out using AGO And ToDate functionion
    this question asking in interview ..is it possible..?
    if yes please response as soon as possible..
    2) i have 2 cloumns Product and value...
    client requirement is they need ranks based on Value ..in dashboard .using dashboard prompt..edit box...if user enter any number (ex :5 ) report should show top 5 ranks if he enter 20 should be top 20 ranks..
    how to achive this ?
    thanks,
    raj

    Consider yor first question:
    1. Yes, we can create timeseries measures without using AGO and TODATE
    1. Create ALIAS of fact tabe in the physical layer
    2. Join the Time id from the ALIAS fact table with the YAGO_MONTH_ID column from your time dimension table (For calculating Year Ago variants) similarly join with MAGO_MONTH_ID column for Month Ago measures.
    3.Pull the ALIAS tables as an additional Logical table source in the Lgical layer
    4.Keep the mapping of the columns from the ALIAS table as its is
    5. For e.g If you pick Revenue from the Year Ago Alias table it will give you the "Prior Year Revenue"
    See if this helps you

  • I had a trouble with my lap top and had to format hard disk and install all soft ware again. could any body tell me how to transfer the application and data in my i phone back to my laptop.

    I had a trouble with my lap top and had to format hard disk and install all soft ware again. could any body tell me how to transfer the application and data in my i phone back to itune.

    You can't. It still thinks that your iPhone is synced with another iTunes library (the one that you had before you reformatted the hard drive.

  • Having trouble with getting on messages and facetime

    having trouble with getting on messages and facetime.  Got two new ipods, one works fine, the other keeps giving us the error: iMessage Activation Could not sign in.  Please check your network connection and try again.  We have tried to reset the factory settings, and verified that the internet is working.  Please help!

    FaceTime, Game Center, Messages: Troubleshooting sign in issues

  • HT4623 Anyone having trouble with App Store install and cloud store buttons not working after 6.1 update?

    Anyone having trouble with App Store install and cloud store buttons not working after 6.1 update? I go to install an app. I hit install and nothing happens. About a minute later it asks me for my password and then it does nothing. The install button goes back to saying install. However the app shows up in my installed list and in cloud but no app installed.

    OK - I found a helpful post - closed app store app and under Settings/General/Date and Time I reset the date and time by switching off "Set Automatically" and then switching it on again. Went back to App Store, launched it and Updatesseems to be working again.
    Go figure? Logical, No!

  • HT5621 I am having trouble with my Apple ID and AppStore Here are the steps I have taken and the results: 1.     Changed my Apple ID with new email address. 2.     Changed my iCloud with above new email address. 3.     NOW - Apple ID appears correct in Ap

    I am having trouble with my Apple ID and AppStore
    Here are the steps I have taken and the results:
    Changed my Apple ID with new email address.
    Changed my iCloud with above new email address.
    NOW - Apple ID appears correct in AppStore Settings, iCloud and AppStore*
    If I scroll to bottom of screen in *App Store/Featured, I can see that the Apple ID is my new email.
    Upon “updating” Apple ID reflects OLD email.
    Deleted accounts, re-added accounts.
    Signed out and signed in with new UN/Email
    Issue remains the same.

    To migrate your data to a new iCloud account go to Settings>iCloud and turn off all synced data (contacts, calendars, etc.), when prompted choose to keep the data on your phone.  After everything is set to off, scroll to the bottom and tap Delete Account.  Next, create the new iCloud account on your phone and turn on syncing for contacts, calendars, etc again.  If prompted, choose Merge.  This will upload your data to the new iCloud account.

  • Downloaded new OS and having trouble with wifi, bluetooth Facebook and Skype performanc​e

    Dowloaded 10.2.1.537
    When I first loaded this it had a lot of trouble finding my Wifi again and would disengage.  Problem went away after a few hours but it recurred this am.  Also affected Facebook.
    Skype is loading more slowly and jumps to a black screen for 10-20 seconds.  Then it will load and function but only for a few seconds to a minute and then shuts off completely. 
    Launching Skype also resultd in my bluetooth headset being disengaged sometimes.
    Reinstalled Skype to see if that fixed anything. 
    Tried turning off bluetooth to see if that fixed the skype problem - nope still disengaged.
    Cycled my router and cable and still no fix...
    Running Z30
    Would love to get a fix on this.

    Hello,
    Given all of your issues, I'd guess that something did not go well with the update, and a clean reload would be in order. You accomplish that either through the LINK software or by obtaining an AutoLoader.
    Good luck!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Networking troubles with ABIT BP6 board and Solaris 8

    Hi, Im trying to install the Solaris 8 software on my ABIT BP6 board with a Compaq NetFlex3 10TX NIC. This is a SMP board (dual celeron) but is not on the HCL (the NIC is).
    The installation gives no problems at all (except for a memory conflict between memory devices), and SunOS works pretty well except for networking... using ifconfig -a shows me the networking interface and the loopback interface but I can't ping outside of the Solaris machine (or ping to the Solaris machine from an other machine).
    I know that the board is not on the HCL but I had no networking troubles with Solaris 8 early access.
    After instalation of the software and the reboot, I get the status as below:
    >
    configuring IPv4 interfaces: cnft0.
    Hostname: MILLIWAYS
    Configuring /dev and /devices
    Configuring the /dev directory (compatibility devices)
    The system is coming up. Please wait.
    checking ufs filesystems
    /dev/rdsk/c0d0s7: is clean.
    All devices are configured...
    Configuring network interface addresses: cnft0.
    RPC: Timed out
    Starting IPv4 routing deamon.
    starting rpc services: rpcbind done.
    Setting netmask of cnft0 to 255.255.255.0
    <
    As you can see I get a time out while configuring the NIC. I tried a lot of different things (and some bad ones like using the device driver disk of the EA version with the cd's of the final version but no luck there...)
    Anyone with the same problems or any help?
    Thanx, Marcel

    Hi maeck,
    I'm sorry that my message is off the topic. Could you help me with a problem that I have with Abit BP6 + Solaris 8 combo?
    I'm encountering error message on console screen during booting/reboot/shutting down like "APIC error interrupt on CPU 0. Status=2" where CPU can be 0 or 1, status can be 0, 2, 4 or 6.
    If I let my dual Celeron400 run at 400MHz, the frequency of errors is few and far between. Though it still happens. If I overclock them to 558MHz like I udually do, it will show at least 4 times during a booting process. I've tried MPS 1.1 and 1.4 settings. I've also tried turning off all cache, delayed transaction, passive release settings.
    In addition, the overclocked system tends to lock up while it runs flawless in Windows 2000 Professional and Redhat 6.1. Do you have any similar experience?
    My system config:
    Abit BP6 motherboard
    400 MHz CPU X 2
    GlobalWin FEP32 X 2
    128M SDRAM
    Creative Labs 3DBlaster TNT2
    13GB Maxtor DiamondPlus 6800
    Acer 10x DVD drive

Maybe you are looking for