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
3 answers

.Net based open source search engine?

I am looking for an easy to use, maintain and extensible search engine (intranet, enterprise search engine) based on .Net technologies, better open source which is more capable of extension. Just similar to Apache Lucene and Apache Solr. I want to…
George2
  • 44,761
  • 110
  • 317
  • 455
8
votes
1 answer

WinSCP: Text search on remote files

I use WinSCP to get access on the remote files of our project. How can I search for some text/words in all remote files/directories using WinSCP?
Max_Salah
  • 2,407
  • 11
  • 39
  • 68
8
votes
1 answer

eclipse - search only opens one file at a time

In eclipse, when i do a global search (open search dialog), i can get a list of results. However, when i open these results, eclipse will ever only open one file at a time. That is, given results: A B C i can double-click on A and will see that…
bharal
  • 15,461
  • 36
  • 117
  • 195
8
votes
3 answers

Locate an ASCII art image inside a body of text with a certain toleration for error

Are there any algorithms that would find the following ASCII-art image? + + +++ +++++++ ++ ++ ++ + ++ ++ +++ ++ ++ + ++ ++ ++ +++++++ +++ Inside the following body of text? complete_file_here + + + …
magister
  • 105
  • 6
8
votes
6 answers

PostgreSQL's and MySQL's full text search

How do the full text search systems of PostgreSQL and MySQL compare? Is any clearly better than the oder? In which way are they different?
Pablo Fernandez
  • 279,434
  • 135
  • 377
  • 622
8
votes
8 answers

Which is the fastest search technique/method? (In context of file searching)

I don't know what they use in normal windows searching.But there is a technique in which you use indexing of files at once and then use the index later for faster searching.(e.g. Windows search 4.0) Is there any other way for faster searching than…
Ravindra S
  • 6,302
  • 12
  • 70
  • 108
8
votes
3 answers

How do I select all elements in a list that are out-of-order?

This question arose from the discussion in the comments of this answer. First, let's say it's quite difficult to define what out-of-order is. Taking the example Pavel Shved gave, in the list [1,5,10,2,3,4,5,6,7,8,9,10,11] we can "clearly" see that 5…
R. Martinho Fernandes
  • 228,013
  • 71
  • 433
  • 510
8
votes
4 answers

How can we prove by induction that binary search is correct?

I'm having a hard time understanding how induction, coupled with some invariant, can be used to prove the correctness of algorithms. Namely, how is the invariant found, and when is the inductive hypothesis used- particularly for binary search? I…
Bob John
  • 3,688
  • 14
  • 43
  • 57
8
votes
1 answer

Implementation of popular algorithms in JavaScript

Can anybody suggest a good book or website which explains all popular search/sort/tree/Graph algorithms using JavaScript? I am looking for something like the book introduction to algorithms, but providing implementation examples and code snippets in…
8
votes
3 answers

Add Google search in web page

I'd like to add search to a static site. The simplest way is to simply query Google by appending "site:www.acme.com" to the actual query so that Google will limit search to that site. Ideally, I'd like to do this in the browser, to avoid having to…
Gulbahar
  • 5,343
  • 20
  • 70
  • 93
8
votes
2 answers

Code fragment repository search on github.com

How can I search for code fragments on github.com? When I search for MSG_PREPARE in the repository ErikZalm/Marlin github shows up nothing. I'm using the repository code search syntax described on https://github.com/search with…
powtac
  • 40,542
  • 28
  • 115
  • 170
8
votes
2 answers

Android : Providing auto autosuggestion in android places Api?

I am very new to android Google maps i write the following program for displaying the auto sugesstion in the android when i am type the text in the Autocomplete text box it is going the input to the url but the out put is not showing in the program…
user1787493
  • 179
  • 1
  • 4
  • 10
8
votes
4 answers

Android - How to disable Search button, how to implement onSearchRequested()?

Checked out the following: How to have clicking the phone's search button do nothing? But it does not work for me. Anybody has any other suggestions? Thank you. Following Phil's suggestion updating the code according to his answer. Shows the bug…
Noman Arain
  • 1,172
  • 4
  • 19
  • 45
8
votes
2 answers

Finding the position of search hits from Lucene

With Lucene, what would be the recommended approach for locating matches in search results? More specifically, suppose index documents have a field "fullText" which stores the plain-text content of some document. Furthermore, assume that for one of…
VoidPointer
  • 17,651
  • 15
  • 54
  • 58
8
votes
4 answers

Simple file text search tool?

I'm looking for an open source tool that can be used to search text files on the local machine. I've looked at elasticsearch but it seems too complicated with more features than I need. I need to search only text files on the local machine. I'm…
bea
  • 273
  • 1
  • 5
  • 13