accent insensitive search in SOQL - soql

I am trying to do some accent insensitive search in SOQL. Using things like:
SELECT name WHERE name LIKE '%andre%'
I would like the database to return me a list of names like Alexandre, Andre or André. I already checked SalesForce link: http://www.salesforce.com/us/developer/docs/soql_sosl/index_Left.htm#CSHID=sforce_api_calls_sosl_where.htm|StartTopic=Content%2Fsforce_api_calls_sosl_where.htm|SkinName=webhelp discussing about the different comparison operators but without success. Has anyone already been confronted to that type of problem in SOQL, and found an answer to it?
Thank you.

Related

Wildcard search not returning results for search terms containing single-quote ( ' ) character

We're using Google Cloud-Search and searching a particular datasource for "O'Conn*" doesn't returned any results.
...
"valueFilter": {
"operatorName": "lastname",
"value": {
"stringValue": "O'CONN*"
}
...
The field is set as wildcardsearchable:true and all the records were re-indexed after. The datasource contains over 40 records that should match. The wildcard search does work but not for any wildcard search terms that contains a single quote ('). Here's a few test I've done
"O'CONN*" - No match
"*CONN*" - Plenty of matches including "O'Connor"
"O'CONNOR" - Matches all "O'Connor" (not a wildcard search)
Would you know a way to perform the search? Do we need to escape the single quote in anyway?
I thought about replacing the single quote by another character, removing it or adding an alternative form of the term before indexing, but then we'd be opening a can of worm. Needing to process search terms before sending, detect and update before the field is displayed on our search result page, etc...
I found a post that likely explains why I'm experiencing this behaviour, but it's for Lucene search. I couldn't find a setting similar to the one described in that post in Google Cloud Search settings or documentation.
Thanks
I tried:
Escaping the single quote in different ways;
Putting the wild card character at different position to test different theories
I've search Google's documentation for "Cloud Search wildcard single quote", but no satisfactory results.

Drupal 8 Search Bug

I have a problem with the Search API on Drupal 8.7.14; the site is in Hebrew.
When I try to search for more than one word, I get no results. If I search for only one word, all results that contain that word appear. The search view is already configured with a full search filter criterion.
Do you have any ideas?
https://www.screencast.com/t/Pv6jC1X6n
(8.x-1.8 search API version)
I guess you're using the wrong operator for this filter, use "contains any of these words", like on screenshot https://i.stack.imgur.com/6nB1k.png

WP_Term_Query - How to search only beginning of term name?

I'm building a WordPress autocomplete search which uses custom taxonomy terms as suggestions, and I'm using WP_Term_Query to query for the terms from what the user types in the search field.
WP_Term_Query has a parameter called "search" which according to the documentation uses the search criteria to match terms and will be SQL-formatted with wildcards before and after. I would need it to only include the wildcard after, so that from the input "ad" it would match "Addaday" and "Adidas", but not "Diadora" or "Fitness Mad" for example. Is this possible to accomplish somehow?
Another approach would be to write a bit more code to weed out the results you don't want and keep just the ones you do. How that would look would depend on the code you already have, but preg_match() might get you on the right track.

Querying multiple project names Odata Feeds in Project Server 2013

I am trying to query multiple projects in an Odata feed for our project server, but I have been unsuccessful so far. I am able to get individual project names and even exclude them, but when I try to query more than one project name I do not get the results I want. Perhaps my syntax is wrong. Any help with this would be greatly appreciated..
When I run this one it breaks and tells me that 'and' is an unknown operator:
http://$server/pwa/_api/ProjectData/Projects$filter=ProjectName -eq 'name1' and 'name2'
When I run this one it runs, but it still only looks at one value:
http://$server/pwa/_api/ProjectData/Projects$filter=ProjectName -eq 'name1' & 'name2'
According to this article this would be the right syntax the above statement using AND, but I am told that the syntax is wrong.
https://msdn.microsoft.com/en-us/library/ff478141.aspx
Also I even read this article to start with, which is a general overview of odata queries, but this is not really answering my question.
https://msdn.microsoft.com/en-us/library/office/jj163048.aspx
I think there are a few changes you may need to make to get this to work the way you want:
The property name on the PublishedProject entity, according to the $metadata, is 'Name' and not 'ProjectName'.
Using conditional AND means that the project name would have to equal both 'name1' AND 'name2'. I think you really want conditional OR, so that the project name equals either 'name1' OR 'name2'
You need two full expressions joined by conditional OR in order to filter for projects with 'name1' or 'name2'.
'-eq' is the wrong syntax for an equality expression. Drop the hyphen and use just 'eq' (this is shown in the examples on the MSDN page you linked to.)
So your filter changes to:
?$filter=Name eq 'name1' or Name eq 'name2'
Or, the Url-encoded form:
?$filter=Name+eq+'name1'+or+Name+eq+'name2'
Optionally, you can use grouping in this query to make it a little easier to read:
?$filter=(Name eq 'name1') or (Name eq 'name2')
Disclaimer: I've only verified these filter examples work on a Project Online instance, not 2013.
#RyanY I figured out just realized what I did wrong It was a problem with the logic I was using. Just as you said my syntax was wrong. I had checked earlier and no one answered my post. I was about to answer my own question just now and I saw your post..lol
To get my result I was looking for all I have to do is issue a REST query such as this:
http://$server/pwa/_api/ProjectData/Projects$filter=ProjectName eq 'name1' or ProjectName eq 'name2' or ProjectName eq 'name3'..ect
I like this idea btw I'll use that in the future its much more organized: ?$filter=(Name eq 'name1') or (Name eq 'name2')
Thanks for the feedback. Also my real name is Ryan too. What a coincidence :)

How to search for a perfect match in xCode 4?

Is there a way in xCode4 to search for all variables with a specific name and not just trying to match part of the name over all code ?
I need perfect match, for example, I have a variable called "myVar", and when I search for it, I don't want results with longer names including "myVar", such as "myVar2" or "allmyVars".
thanks
Of course there is a way. Just bring up the advanced options on search navigator (click on the magnifying glass > Show Find Options) and choose match search term

Resources