How to exclude a country in a Shodan search? - shodan

I have a query I want to perform on Shodan that I want to exclude a certain country with.
I know I am able to select certain countries using the "country" filter like thingy country:"US". But in this case I want to exclude the UK, using the country code "GB", is there any possible way to do so?
Thanks in advance.

Yes, you can exclude results by prepending a "-" to the search filter:
thingy -country:"US"
You can also search for multiple values at the same time:
thingy country:US,DE,CH
Here are some more example queries:
https://beta.shodan.io/search/examples

Related

How to filter using multiple keywords in google sheets or excel

I'm using google sheets, and I've been trying to filter data based on if the B value contains any of multiple keywords. I'm trying to sort account data, and the names aren't consistent, so I can't just say =FILTER(C:C,(B:B="BK's Stuff")+(B:B="Book")). I need something that will take information out of a lot of text like a wild card. What works great for a single entry is:
=FILTER(C:C,SEARCH("BK",B:B))
But I can't figure out how to combine it so it will filter all values that contain EITHER "BK" or "Book."
Thanks in advance.
You can do it replacing SEARCH through a combination of REGEXMATCH and ARRAYFORMULA
REGEXMATCH allows you to search for multiple keywords separated by |
Sample:
=FILTER(C:C,REGEXMATCH(B:B,"BK|book")=TRUE)
Note:
Regexp is case sensitive, so you need to specify separately
REGEXMATCH(B:B,"BK|bk|Bk|bK|") etc.
This is for Excel:
You can combine several SEARCH()s as follows:
=FILTER(C1:C20,ISNUMBER(SEARCH("Book",B1:B20,1))+ISNUMBER(SEARCH("BK",B1:B20,1)))
(should be similar for Google Sheets)

Azure Search Index - Search For Exact Word

We are using Azure Search Index for one of our Search API. We have a field in Azure Search Index say Display Name (which is a string field. The requirement is from the API when we do a search using the Display Name, the search should be an exact search against the fields.
Eg:
If we search for "George Joseph", the Search Index should return only records that exactly match the Display Name as "George Joseph" and it should not return records with names - "George Joseph John" or John George Joseph"
Is there any way I can accomplish this?
Regards,
John
You can use a filter to achieve this, assuming you are interested in case-sensitive matches. For example, DisplayName eq 'George Joseph' will match exactly George Joseph but will not match george JOSEPH. You can find details about the filter syntax here.
You can specify "&searchMode=All"
When you set searchMode=all you tell the search engine that all query terms must be matched at least once in the document-
agency temps&$count=true&$top=30&$skip=0&searchMode=All&$filter=(CompanyCode eq '13453' and VNumber eq '00023232312016') &scoringProfile=BusinessProfile1&searchFields=VCategory
https://learn.microsoft.com/en-us/azure/search/query-lucene-syntax
The searchMode=all parameter is relevant in this example. Whenever operators are on the query, you should generally set searchMode=all to ensure that all of the criteria is matched.
GET /indexes/hotels/docs?search=category:budget AND "recently renovated"^3&searchMode=all&api-version=2020-06-30&querytype=full

How to apply filters automatically based on search term?

Is it possible to apply filters/facets automatically based on search term?
For example, If there are two facets called "Category" and "Material" ,and If user searches for the term "plastic water bottles" where bottle is one of the category
(Catergory=bottle) and plastic is one of the material facet(Material = Plastic).
I am looking for the option to enable/force search engine to filter based on category=bottle and material=plastic automatically when it has matching terms in the query.
Please help.
This is not possible. It is possible to trigger oneboxes, keymatches and related queries based on keywords.

How to config Solr to exclude certain documents from search result?

To exclude some documents from the search result, I can use the not in or - negative sign to specify the ids like this through a query.
select/?q=*:*&fq=-id:86+-id:338
This is ok if there are only a few ids needed to be excluded, but the query will be very very long if I have thousands of ids needed to be excluded from the search. I need to conditionally exclude a list of documents from the search result. How can I do it through solr configuration file such as creating an exclusion list? For example, I need to exclude the documents from search result if usstate is equal to NY, CA, VA, and zip code ending with 3
You can use the QueryElevationComponent to add a list of documents to exclude for a certain query. This will require you to perform a search that matches the query mentioned in the configuration file for it to work.
If you meant "i don't want to have any documents with usstate as NY, CA, VA where the zip code ends with 3" for your example, you're probably better off by just using that criteria directly in your query (with a modified version of -(usstate:(NY OR CA OR VA) AND zipcode:*3) to get the behavior you want) (see ReverseWildcardFilterFactory for faster reverse matches).

excel search for multiple items

I am trying to search for multiple items in a cell. If any of the terms I am looking for is present, I want cell D to display "Laptop", otherwise, display "Desktop". I can get the following to work, with just one term to search for:
=IFERROR(IF(SEARCH("blah",A2),"Laptop",""),"Desktop")
But I want to search for the presence of blah, blah2, and blah3. I don't know how to get Excel to search for any of the following terms. (Not all of them mind you, just any of the following.
I did see that there is an or option for the logic.
=OR(first condition, second condition, …, etc.)
I am not sure how to get these two to work together. Any thoughts on how to get them to display "Laptop" if any of the words are present?
This should work:
=IF(SUM(COUNTIF(A2,"*" &{"blah1";"blah2";"blah3"}& "*"))>0,"laptop","desktop")
You could use the combination of OR, IFERROR and SEARCH as you suggest, but I think the simpler construct would be ...
=IF(AND(ISERROR(SEARCH("value1",A2)),ISERROR(SEARCH("value2",A2))),"Desktop","Laptop")

Resources