Best method to search username - search

I am working in Xcode obj-c and integrating with parse. I am calling a query to search a username. The issue I have is that the search is too literal, so for example if I have a username like 'Manny' I have to search with a Capitol 'M' in order for the search to find it, which isn't what I want. So how can I make the search more flexible?

while siging up save the username as .lowercaseString
and when user search for it, convert the search.text.lowercaseString too.

Actually just had a brain wave. Just save a copy of the username as a lowercase, search against that then simply display actual username in table view.

Related

How to build a facebook-like fast search by starting of words?

I have to build a search textbox in a web page similar to facebook search box. Client side there will be ajax calls. The user need to search into around 300.000 elements that have a description of a few words or an alphanumeric code. When user enters the beginning of a word, a call is made to the server which return best match based on the starting of any word or code but also suggest first the elements most recently by the user, then by the group the user belongs to and finally from the entire set. Result can be limited to 10-20 items.
How can I build a fast search by key with the value just the description of the element? We use SQL server but any other DB could be OK.
The implementation at the time was very complex to summarise here but I came across recently to UI-select that solve the front end problem nicely and it's very good component if you are using Angular
https://github.com/angular-ui/ui-select
then backend you can put whatever you have (I did with Redis)

How to fetch the Document/Assignment manager name using # formula

I have a view in which I need to fetch the document manager name but not the hierarchical name. I need to fetch the last name and the first name. I have used the #Name function but I'm not sure how to use it. Any help will be appreciated.
Many people are under the impression that #Name([G];theName) will give the first name and #Name([S];theName) will give the last name -- because that's what the Lotus documentation says. That's actually true, but it only ever worked for hierarchical names that came in messages received via the old Lotus X.400 gateway, which could include G and S components (e.g., CN=first last/G=first/S=last/OU=ou1/O=org/C=US).
The best you can do with #Name for an ordinary Notes/Domino user is to use #Name([CN];theName), as suggested by #Mike Zens, and then if you need to separate first and last names you can use #Left and #Right. Unfortunately, there's no perfect way to do this because the CN could look like this: "Mary Ann Jones" where the first name might be "Mary" or it might be "Mary Ann". (And I've actually been confronted by a user with that name who was angry that a piece of software I was supporting made the assumption that "Ann" was her middle name!) Or you could run into a name like this: "Jose de la Madrid". There's just no possible algorithm that will always parse a name into the correct parts.
So if you really need to get first and last names separately, the best thing to do is use #NameLookup to retrieve the FirstName and LastName fields from the Domino Directory. Of course, that will only work if those fields are filled in, which isn't 100% guaranteed.
If you are looking for ways to just format the name, as mentioned already you can use the #Name formula:
#Name([CN]; DocumentManager);
If you are looking for specific information on that user, you can use the #NameLookup formula:
lastNameList := #NameLookup([ForceUpdate]; DocumentManager; "Lastname");
(where DocumentManager is the item that has your user's name, and "Lastname" is the value from the Person doc you are trying to retrieve);
This example returns "Mary Tsen" if the AUTHOR field in the document contains "CN=Mary Tsen/OU=Illustration/O=Acme":
#Name([CN]; AUTHOR)
Replace AUTHOR with the field name storing the document managers name.

Sphinx "reverse" search

We have a website where users put up ads for stuff they want to sell, with parameters such as price, location, title and description. These can then be searched for using sphinx and allowing users to specify min- and maxprice, a location with a searchradius (using google maps) etc. Users can choose to save these searches and get emails when new ads appear that fit their search. Herein lies the problem: We want to perform a reverse search every time an ad is posted. With the price, location, title and description as parameters we want to search through all the saved "searches" and get the ones that would have found the ad. The min- and maxprice should just be performed in a query i suppose, and some Quorom syntax to get all ads with at least 2 or mby just 1 occurance in the title/description. Our problem lies mostly in the geo-search. How do we find all searches where the "search-circles" would include our newly posted location without performing a search for every saved search?
That is the main-question, any comment on our suggested solution to the other problems is also very welcome. Thank you in advance / Jenny
The standard 'geo-search' support on sphinx should work just as well on a Prospective Index, as a normal retrospective search.
Having built a sphinx 'index' of all the saved searches...
And you run a query using the 'ad' as the search query:- rather than the 'filter' using a fixed radius, you just use the radius from the attribute (ie the radius stored on the particular query) - if using the API cant use setFilterRange directly, need to use setSelect, to make a new virtual attribute.
$cl->setSelect("*,IF(#geodist<radius,1,0) as myfilter");
$cl->setFilter('myfilter',array(1));
(and yes, the min/maxprice can just be done with normal filters too - just inverting the logic to that you would use in a retrospective search)
... the complication is in the 'full-text' query, if the saved search is anything more than a single keyword, but you appear to have already figured out that part.

Sharepoint 2010 Search - Auto add property to QueryString

Have a bit of a difficult question which as far as I can see, no one has really managed to fix yet.
Here's the scenario. Sharepoint 2010 EnterPrise Search Centre.
I've created a custom Search Results Page. I want people who type any word in the Search box to only display results where the Value provided by the user matches with a specific Managed Search Property.
Now I know a user can search for People with specific criteria by entering for example
Continent:Europe in the actual Search Box. Sharepoint will refresh the page with the following added to the Query String: k=Continent:Europe and the results will only show people who are from Europe.
So my question is : How can I fix this so that the user does not have to enter the Continent:Europe in the Search box and can just type Europe?
Thanks
One option is to create your own webpart that acts as the search box and replaces the standard one with your custom search box. The advantage of this is that you can more tightly control the user interface and then set up the query passed to the server (with the "k" parameter). You could prepend "Continent:" before the search term entered to help narrow the search.
Another use for this is to append * onto any search term because the People search does include partial words by default.
We did this on one site to simplify the input and allow users to search with one text box (without the advanced features) and then users can use the refinements to narrow the search.

Designing a one EVERYTHING search box (date+address+keywords)

I'm storing information about local "events". They are described by 3 things - address, date, keywords(tags). I want to have only one search box for at least address and keywords. The date might go to a separate field. I'm assuming that most people will search for events that are taking place "today" so this filter won't get that much traffic.
I need those addresses to be correct (because I'm geocoding them afterwards) so I need to validate them before submitting the form and display a list of "did you mean" if a user made a typo there. I can't do life search here. I can do a live search on keywords. Keep in mind that a user can make a typo there too and I want to catch that.
Is there a clever way to design the input's parser in this case to guess which is supposed to be address and which keywords?
OR
Is there a way to actually parse it as user is entering his query? Maybe I should show autocomplete hints for keywords, after 3 first characters are entered, and if user denies to use them then to assume that it's a part of an address he's typing.
What do You think?
Take a look at Document Cloud's Visual search
http://documentcloud.github.com/visualsearch/#demo

Resources