Questions tagged [search]

Questions about search algorithm mechanics and implementation. *NOT* for questions about using search tools within an API (e.g. Google, Bing, Facebook).

Searching is one of the most common and important tasks in Computer Science.

The most basic search algorithm is a (also called "sequential search"). Each item in a collection of data is examined in sequence until the sought item is found.

If the collection in question has already been sorted, for instance, then a more efficient is possible.

Search can become more complex when, rather than finding one instance of a specific item, we want to find all items meeting a certain set of criteria. For instance a query can specify extremely complex search criteria, and much of relational database design involves the planning of an efficient way to perform those searches.

Another more complex search scenario is graph search, in which a series of nodes and edges must be traversed. Common algorithms for this domain include and . In many cases, a heuristic search algorithm such as can achieve more efficient results by making use of additional information about the problem.


Do not use this tag for questions about specific search tools within an API. Some more relevant tags for that would be the following:

37207 questions
8
votes
1 answer

Need some help for understanding search algorithms (A*, IDA*, DFS, BFS, IDDFS, etc. )

I have some troubles understanding some of the algorithms for searching, used in AI (artificial intelligence). What is the exact difference between A* and IDA* (Iterative Deeping A Star)? Is just the heuristic function? If so, I still just can't…
Kiril Kirov
  • 37,467
  • 22
  • 115
  • 187
8
votes
4 answers

link_to with jquery params in rails

I want to make an in-place search in my rails app. I used button_to_remote with prototype, but now I'm using JQuery, so I changed to link_to. This is my code: <%= link_to "Search", {:action => "geocode", :with =>…
pasine
  • 11,311
  • 10
  • 49
  • 81
8
votes
1 answer

How can I find out on which page of Google's search results my site appears?

My website "http://www.cpcells.com" is related to computer cells. So when I enter "computer cells" in Google search, my page maybe appear in the 12112th page of results. Is there an easy way to know where exactly my page appears? (The 10th page or…
Madan
  • 81
  • 1
  • 2
8
votes
9 answers

Most efficient way to search a sorted matrix?

I have an assignment to write an algorithm (not in any particular language, just pseudo-code) that receives a matrix [size: M x N] that is sorted in a way that all of it's rows are sorted and all of it's columns are sorted individually, and finds a…
Bob
  • 185
  • 1
  • 4
8
votes
2 answers

Good practices between SQL and elasticsearch

Imagine you have a SQL database like mysql or postgresql. You have two tables : user and car. One user can drive N cars, a car can be driven by N users, so you have a third "drive" table with two foreign key. Now, you want that your table user goes…
Oreste Viron
  • 3,592
  • 3
  • 22
  • 34
8
votes
2 answers

Google Cloud Storage Search Files

I'm developing an application that will serve a lot of file. Lets say it's a car company. Each car has a folder with documents/files for that car. These files are uploaded into categories, represented as "folders" in GStorage. 2 files for 2…
JohanLejdung
  • 353
  • 1
  • 4
  • 18
8
votes
5 answers

Php/ MySql 'Advanced Search' Page

I'm working on an 'advanced search' page on a site where you would enter a keyword such as 'I like apples' and it can search the database using the following options: Find : With all the words, With the exact phrase , With at least one of the…
Ali
  • 261,656
  • 265
  • 575
  • 769
8
votes
3 answers

Get all children from parent child JSON data

I have parent-child JSON data and I want get all children (nested children) from selected parent. For example, I have JSON data : [{ "id": 1, "parent": 0, "name": "Parent" }, { "id": 2, "parent": 1, "name": "Child 1" }, { "id": 3, …
Hidayat
  • 83
  • 1
  • 1
  • 9
8
votes
1 answer

Are there any C# facial recognition libraries that work?

Are there any C# facial recognition libraries that work? I would like to locate people in my data base by having them stare in a camera :-). This is not used for security or authentication just to help with a quick lookup so if it is good enough to…
Jamey McElveen
  • 18,135
  • 25
  • 89
  • 129
8
votes
9 answers

jqGrid - how to reset search options?

Using jqGrid multiple searching how can you programatically "clear" the search options? The "clear" should ensure no filters are being sent to the server and that the GUI search box does not contain any search criteria.. We are currently calling…
Marcus Leon
  • 55,199
  • 118
  • 297
  • 429
8
votes
1 answer

Best way to import/export data from Elasticsearch using Java client

I am ingesting millions of records into Elasticsearch and also extracting records from Elasticsearch. I am actually using Elasticsearch Java client. I am creating only one client on each JVM. Using this client, ingesting data into Elasticsearch and…
Sky
  • 2,509
  • 1
  • 19
  • 28
8
votes
3 answers

How can I bundle search terms into more efficient queries?

I need to convert a list of search terms into the most efficient set of combined search terms. Any word or quoted phrase can be separated by an OR. Many terms can be combined within parentheses. ANDs can also be used. For example, foo bar and boo…
OneCleverMonkey
  • 422
  • 4
  • 15
8
votes
3 answers

How do I find/search/grep an SVN repository history?

I need to search through all revisions of a Subversion repository to find file names and revision numbers that contain a particular string. I know that this will find occurrences in a dump: svnadmin dump $REPO_PATH | grep -i "Verdana" but the…
Liam
  • 19,819
  • 24
  • 83
  • 123
8
votes
2 answers

Searching with ModelChoiceField in django

Suppose I have a form field as below: admin = forms.ModelChoiceField(queryset=Profile.objects.all(), help_text=_('select an admin for this organization'), label=_('Organization Admin'), ) when this form is rendered in a template and I can…
cjahangir
  • 1,773
  • 18
  • 27
8
votes
3 answers

What is the base class for STL containers list, deque, vector etc.?

I want to write a function that can take either of STL generic list, deque or vector and search for a key in it. What would be method signature of this function and how can we implement it? What I know is that if we are accepting any of the derived…
shaffooo
  • 1,478
  • 23
  • 28