locked
Exclude Results from a Dynamic Page RRS feed

  • Question

  • Hi, I have a situation where we are using vanity urls, and it is causing us a bit of trouble.  I've got the following code for the search

        function Search(formValues,offSet)
        {
    		existingobject = document.getElementById("output");
    		existingobject.innerHTML="";
    		queryTermInternal = document.getElementById("SearchTerm2")
    		if (queryTermInternal.value != "")
    		{
    			document.internalSearchForm.SearchTerm2.value = formValues.SearchTerm.value;
    			document.internalSearchForm.SearchDomain2.value = formValues.SearchDomain.value;
    		}
    		else
    		{
    		}
    		//alert("Search Term = "+formValues.SearchTerm.value+", Search Domain = "+formValues.SearchDomain.value+", Offset = "+offSet);
            var requestStr = "http://api.search.live.net/json.aspx?"
            
                // Common request fields (required)
                + "AppId=" + AppId
                + "&Query="+formValues.SearchTerm.value+"%28site%3A"+formValues.SearchDomain.value
                + "&Sources=Web"
                
                // Common request fields (optional)
                + "&Version=2.0"
                + "&Market=en-us"
                + "&Adult=Moderate"
                + "&Options=EnableHighlighting"
    
                // Web-specific request fields (optional)
                + "&Web.Count=10"
                + "&Web.Offset="+offSet
                + "&Web.Options=DisableHostCollapsing+DisableQueryAlterations"
    
                // JSON-specific request fields (optional)
                + "&JsonType=callback"
                + "&JsonCallback=SearchCompleted";
    
            var requestScript = document.createElement("script");
            requestScript.type = "text/javascript";
            requestScript.src = requestStr;
            
            var head = document.getElementsByTagName("head");
            head[0].appendChild(requestScript);
        }
    I would like to be able to exclude everything that has "EventsDetail.do" and "MakeReservation.do" , in the URL, as the "EventsDetail.do" and "MakeReservation.do" do weird cross-URL things in our situation.  I am currently doing some filtering on the client side, but this results in the count being off, and some other issues.  Is there a way to exclude results when requesting?
    Wednesday, April 22, 2009 11:12 PM

Answers

  • Did you try adding "-MakeReservation.do -EventsDetail.do" to the query string before you send it?

    HTH

    --Alessandro
    • Marked as answer by MrRong Monday, April 27, 2009 10:12 PM
    Thursday, April 23, 2009 4:52 AM

All replies

  • Did you try adding "-MakeReservation.do -EventsDetail.do" to the query string before you send it?

    HTH

    --Alessandro
    • Marked as answer by MrRong Monday, April 27, 2009 10:12 PM
    Thursday, April 23, 2009 4:52 AM
  • I tried changing the query string to
    "&Query="+formValues.SearchTerm.value+"%28site%3A"+formValues.SearchDomain.value+"-MakeReservation.do -EventsDetail.do"

    When I do, I don't get any results for any queries.  Am I using the wrong formatting?
    Friday, April 24, 2009 4:28 PM
  • I really need someone's help on this.  Anyone have any ideas?
    Monday, April 27, 2009 6:55 PM
  • I are not so smart.  Figured out what I was doing wrong.  Nothing to see here foks, move along.
    Monday, April 27, 2009 9:18 PM