Bing: search - match only exact literal strings? - search

I'm using PHP and the Bing API to search for certain domainnames.
I want only the results that are an EXACT match.
Somehow Bing returns results that do not match exactly.
When I search for :
"www.gebouw.nl"
I sometimes also get results like "www.gprgebouw.nl"
Is there a way to tell Bing to search only for EXACT matches?

Try adding a plus sign to your query. e.g. +www.gebouw.nl which is %2Bwww.gebouw.nl when url encoded
http://www.google.com/support/websearch/bin/answer.py?answer=136861
http://onlinehelp.microsoft.com/en-us/bing/ff808438.aspx

Could WebSearchOptions='DisableQueryAlterations' be the key to this?
As per API documentation, "DisableQueryAlterations Prevents Bing from altering the query string. Such alteration may have been done to correct apparent spelling error in the original query string."

Related

does filetype equals pdf in google cse list work in python

I am using google custom search through the api google_api_client python. I want to retrieve the pdf documents for a particular query. Below is the function that does it.
def query_results(service,q=None,startIndex=1,siteSearch=None,fileType=None):
return service.cse().list(
q=q,
cx='000906600611484344115:o9lfdh9y1m5',
start=startIndex,
siteSearch=siteSearch,
fileType=fileType,
safe='off'
).execute()
When i call the above method passing q="alienware", filetype="pdf" and siteSearch="google.com", I get hardly one result. But then when I type the same query filetype:pdf alienware in google search through browser, I got plenty of results. Did I do any wrong ? or Is there an issue with the api itself ?.
When i say I got plenty of results, I mean the below image
Below is the configuration of custom search
Specifying siteSearch="google.com" means you will only search pages on google.com. It is equivalent to searching for site:google.com on Google. Remove the siteSearch and you should get the expected results.

Fuzzy Search in the Search API

The Azure search api offers a fuzzy paramter for suggestions. like this:
https://blssuggestions.search.windows.net/indexes/cities/docs/suggest?api-version=2015-02-28&suggesterName=default&fuzzy=true&search=berlen
Would return "Berlin" as a result of berlen.
I can't find a documentation about this how to activate it in a normal search
setting there fuzzy = true seems to not change anything
https://blssuggestions.search.windows.net/indexes/cities/docs?api-version=2015-02-28&search=berlen&fuzzy=true
[Update]: Please see the other responsed about using querytype=full as this response is no longer correct.
This is correct. Fuzzy search is only available currently in the suggestions api.
You need to call:
https://blssuggestions.search.windows.net/indexes/cities/docs/suggest?api-version=2015-02-28&suggesterName=default&queryType=full&search=berlen~
You were missing querytype=full and the tilde after the character that you want to execute fuzzy searches on.
This is now in the preview version of the api:
https://{yourSite}.search.windows.net/indexes/{yourIndex}/docs?search={fieldToSearch}:{lookupValue}~&queryType=Full&api-version=2015-02-28-preview
Note the ~ and queryType=Full, both of which are required to force fuzzy matching.
Documentation is here:
https://msdn.microsoft.com/library/azure/mt589323.aspx
CAVEAT: The fuzzy search is very fuzzy! i.e. dog will match any 3 letter word with only a single matched letter - dim, now, bag
I am trying to figure out how to tune and tweak but as it is still in preview the documentation is sparse.
UPDATE: I just re-read the documentation and it has since been updated with details of an optional distance parameter. I will investigate.

Exact match in google search

I am trying to make an application which find all the copied code in a project.
But basically my question is purely related to google search.
I made a search for the keyword "public void bubbleSort(int[] arr){"
and this was the result.
In the first page of search results, only the last url makes a perfect match with my keyword.
Can i tell google with some search keywords so that it will give more importance to pages with an exact match of my search keyword?
although the plus sign, +, is no longer an available Google search filter, you can use quotes, or after running the query selecting Search Tools and then verbatim under the All Results drop down.
You can also search the Google code archives, https://code.google.com/ or try some of the other code search engines around the Internet.
+"public void bubbleSort(int[] arr){"
the plus sign means to include this term no matter what. the quotes turn the loosely coupled words into a single term.
for a full list of Google syntax operators:
[web]: https://support.google.com/websearch/answer/136861?hl=en

Search for words with a Dash in Twitter API

How can I get the results for the phrase "E-Contact" In a normal twitter search it returns results with E-Contact but also results without the dash anything but
The same happens for a Williams-Sonoma search I tried using quotes and also replacing the dash with the URL encoded %2D but still no luck.
I don't think you can. You will have to manually filter the search results on your side.

Get Altavista number of hits

I need a program that -Given a search query- uses altavista and returns the number of hits for this search query. I prefer java but other languages are fine with me. Is there an API that can be used for this purpose?
This should be simple...
Make a web request to Altavista passing in your search query.
Get the resulting HTML back.
Then parse out the hit count from the html.
You could adapt the code here:
http://nadeausoftware.com/node/73
Which will allow you to specify a URL to search for, get the results and parse out the returned number of matches all in Java
Altavista does not have a search API and I could not locate an up-to-date third-party solution.

Resources