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

Visual similarity search algorithm

I'm trying to build a utility like this http://labs.ideeinc.com/multicolr, but I don't know which algorithm they are using, Does anyone know?
Emrah
  • 279
  • 7
  • 14
10
votes
4 answers

Substring search in RavenDB

I have a set of objects of type Idea public class Idea { public string Title { get; set; } public string Body { get; set; } } I want to search this objects by substring. For example when I have object of title "idea", I want it to be found…
jwaliszko
  • 16,942
  • 22
  • 92
  • 158
10
votes
3 answers

Hamming Distance / Similarity searches in a database

I have a process, similar to tineye that generates perceptual hashes, these are 32bit ints. I intend to store these in a sql database (maybe a nosql db) in the future However, I'm stumped at how I would be able to retrieve records based on the…
oPless
  • 618
  • 1
  • 8
  • 18
10
votes
4 answers

Indexing Mysql Database with elasticsearch

I recently started looking ElasticSearch to implement search in my application. I have my database in Mysql which have approx. >2 mn records. I know in sphinx we could create an index directly on any mysql table column. I wanted to know if its…
Mohit Jain
  • 337
  • 1
  • 5
  • 11
10
votes
3 answers

Fast search algorithm with std::vector

for (std::vector::const_iterator it = serverList.begin(); it != serverList.end(); it++) { // found a match, store the location if (index == *it) // index is a string { …
maffo
  • 1,393
  • 4
  • 18
  • 35
10
votes
2 answers

Using A* search algorithm to solve 3x3 three-dimensional box puzzle?

I am working on a 3x3 three-dimensional box puzzle problem in my homework. I will code with C. There are 26 boxes and at first, first place is empty. By sliding boxes I must arrange them in correct order. Red numbers shows correct order and 27th…
Jemo
  • 309
  • 6
  • 19
10
votes
5 answers

Finding duplicate values in arraylist

I have an ArrayList For Example class Car{ String carName; int carType; } Now, I have to find if the list has any cars having same name. What is the best way to do this?
Makky
  • 17,117
  • 17
  • 63
  • 86
10
votes
1 answer

Search ElasticSearch via GET using JSON

Anyone know of a way to send a JSON query to an ElasticSearch server via HTTP GET? I know you can POST the JSON content to _search, but POST is not available because this is cross-domain. For example, if my query looks like this: { "query": { …
inxilpro
  • 20,094
  • 2
  • 24
  • 28
10
votes
4 answers

How to color my vimgrep result patterns

When using Vim is there a way that :grep or :vimgrep will color the patterns returned to the buffer?
Luis
  • 1,828
  • 2
  • 19
  • 27
10
votes
2 answers

Search JavaDoc in Eclipse

Is there a way to search in javadoc comments only (via Eclipse)? I just want to find text within a javadoc comment...
Tobias
  • 7,238
  • 10
  • 46
  • 77
10
votes
3 answers

Lucene or Mysql Full text search

Nowadays when starting a web/mobile app project in which search is going to be an important variable. Is it better to go with Lucene from the start or quickly deploy a MySQL based solution and hope for the best?
smaura777
  • 326
  • 1
  • 3
  • 10
10
votes
1 answer

GitHub search: how to exclude multiple authors from the search result?

I know I can exclude one author by -author:someone, but it looks like excluding 2 authors doesn't work: -author:user1 -author:user2. The result will include the user2. I read GitHub search syntax doc but could find a solution. Is there a way to…
Ran
  • 101
  • 6
10
votes
6 answers

How can I hide certain text from search engines?

In my WordPress blog, I have "Posted ? days ago" on every post. I have 10 posts on my homepage. So according to most keyword analysis tools, "days ago" is a top keyword on my blog, but I don't want it to be. How can I hide those words from search…
Linksku
  • 1,449
  • 6
  • 17
  • 22
10
votes
6 answers

Search with a mask

There is big array of entries having the following type: typedef struct { int value; int mask; int otherData; } Entry; I'd like to find an entry in this array according to provided int key; as fast as posible. The entry is required to…
Serge C
  • 2,205
  • 16
  • 23
10
votes
6 answers

PHP Good practices - Methods with too many parameters

I've made a class and method just for search things on my website. It has too many parameters, the search parameters. My controller grabs data from forms and then pass to the model. public function search($name, $age, $foo, ... $bar, $lorem) { Are…
thom
  • 103
  • 1
  • 5