I'm looking for an STL sort that returns the element "closest" to the target value if the exact value is not present in the container. It needs to be fast, so essentially I'm looking for a slightly modified binary search... I could write it, but it seems like something that should already exist...
...
I have a question regarding searching a complete document.
1 - I have indexed a lot of documents on lucene.
2 - Each document has a single word per line. Suppose 200 words which becomes 200 lines.
3 - I know how to search lucene via Solr but;
If suppose that i indexed the document mydoc.txt on lucene containing 200 words along with o...
For an array of size N, what is the # of comparisons required?
...
$array = array('a', 'b', 'c', 'd', /*... letters from 3 alphabets*/);
$letter = 'some symbol, posted by user'; // real length = 1
How to get know, is $letter one of the symbols, listed in $array?
Like, if $letter = 'G' and there is no G in $array, well then return false.
Yep, I tried in_array(), but there are too many symbols, is ...
Hi,
We have a .NET application on which has grown beyond what we can develop in-house to search. We can certainly try to make the best search algorithm we can be it's not what we do and someone else has certainly done it better.
We have an IEnumerable of object which has a title and a description and we'd like to search and rank it b...
I'm trying to figure out a decent way to parse keywords from location words within a single string before or after geocoding the string or part of the string. For example: "iphone battery accessories toronto, on", or "2010 volvo 90210", or "circus texas", etc.
It turns out I can pass the entire string to most geocoders and get a valid l...
Hi,
I have developed a cake php application.
In this there are tables like students,placements,batches,companies
In placements table there is student_id,company_id and in students table there is batch_id column.
In placements index page i have applied jq grid. Here is the screen shot.
I want to give searching on student,company and...
Usually when using any web page that is used to search for huge amount of data, like searching for cheap flights, user is first redirected to a page that shows progress bar e.g. 'Now Searching Multiple Travel Sites..', and when search on the server is done, then is redirected to actual search results.
How that is done? Is it some javasc...
What is the problem with this query and how can I fix it?
public JsonResult Find(string q)
{
var k = new List<string>(q.Split(' '));
return Json(_dataContext.Jobs
.OrderBy(p => new List<string>(p.Keywords.Split(' ')).Where(n => k.Contains(n)).Count())
.Select(p => new { p.Title, p.IsFullTime, p.Location, p.Categ...
Hi all,
I'm sure I found a similar question on here the other day with no definite answer - now I can't find it to reference it.
A simplistic version of what I'm trying to achieve would be a couple of selects in the form:
color: red, blue or green
flavor: apple, pear, banana
and a keyword text box.
That's it, but I can't work out how ...
I'll list what I'm planning to do and need pointers on how to go about building it.
I have millions of business records. New businesses are added everyday. Every time a new Business is added, we need to determine if the particular business already exists. We query our database and search for businesses with matching keywords as entered ...
Stackoverflow implemented its "Related Questions" feature by taking the title of the current question being asked and removing from it the 10,000 most common English words according to Google. The remaining words are then submitted as a fulltext search to find related questions.
How do I get such a list of the most common English words?...
I need to make some complex, feature rich search forms for my silverlight application, but I need to do it in a way that the user understands, so it's not only me as a developer who thinks that it's really smart. Are there any guidelines or guides that can help me to do this? I think I've created the form and erased it 3 times now, I rea...
I'm facing a decision on how to store URL (bookmark) in a table. I have following requirements:
Customer must be able to search the title of a bookmark.
I decided to use a FTS with ranking option for this requirement
Customer must be able to search an address
Here is where I have doubts on how to store URL. First of all, UR...
I want to implement a 'live search' or 'search suggestions' feature in a web application that uses the Dojo Framework. It would be similar to the way Google and Bing searches display matches as you type: when you type in the search box, a list of potential matches appears below. Searches would be performed server side, with the results s...
I was trying to reverse engineer Twitter-Live Search. Maybe we could discuss it here. I am talking about the feature where Tweets are shown even latest to "1 sec ago" etc. Trying to understand how the following might happen -
There must be some layer between when the user tweets & when the index (updates) happen. Is this layer MySQL or...
Hi,
I'm trying to get the code of a html document in specific tags.
My method works for some tags, but not all, and it not work for the tag's content I want to get.
Here is my code:
<html>
<head></head>
<body>
<?php
$url = "http://sf.backpage.com/MusicInstruction/";
$data = file_get_contents($url);
$pattern = "/<di...
Currently, I am using Lucene version 3.0.2 to create a search application that is similar to a dictionary. One of the objects that I want to display is a sort of "example", where Lucene would look for a word in a book and then the sentences where the words were used are displayed.
I've been reading the Lucene in Action book and it menti...
So I have picture (not the best one)
I want to detect where the lights come from and what types of lights are they. What algorithm\framework can do such things with static images?
I mentioned shadows because in general if you can separate a shadow from a surface than you can probably determine light type and other its parameters.
I me...
Searching for "OR" queries on facebook is an exercise in futility as "OR" gets filtered.
Cannot find a way to search for " X or Y or Z "
https://graph.facebook.com/search?q=cats%20OR%20Dogs&type=post
Results in it only finding posts which contains both Cats and Dogs:
{
"id": "100000895865837_129212313793038",
"from": {
...