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

Apache Directory LDAP - Paged searches

I've looking for information to perform paged searches using the Apache Directory API, but I haven't found any example or any information about how build a SearchRequest with the proper PagedResults control and then perform the search. Any of you…
Ruben Romero
  • 611
  • 8
  • 15
8
votes
1 answer

Fulltext search vs standard database search

What I want to know what is difference between fulltext searching (searching data in files) and standard database searching (LIKE, IN ect). What I notice here is that in files you don't have data types, but in database you can define data types for…
zajke
  • 1,675
  • 2
  • 12
  • 13
8
votes
2 answers

Tweepy (Twitter API) Not Returning all Search Results

I'm using the search feature with Tweepy for Twitter and for some reason the search results are limited to 15. Here is my code results=api.search(q="Football",rpp=1000) for result in results: print "%s" %(clNormalizeString(result.text)) print…
user1893354
  • 5,778
  • 12
  • 46
  • 83
8
votes
2 answers

Notepad++ Any Character

Does anyone know how to search something like this in the search box of Notepad++ ? ID. 213 Debt: 13 $ I want this to be searched like : "ID. (don'care for the number/any character),newline, Debt(don'care for the number/any character)"
Themis Beris
  • 980
  • 1
  • 11
  • 25
8
votes
4 answers

which numbers in list 2 are bigger and smaller than each number in list 1

I am using python. I have two lists, list 1 is 7000 integers long, list 2 is 25000 integers. I want to go through each number in list 1 and find the closest number in list 2 that is bigger and the closest number that is smaller than each number in…
8
votes
6 answers

Fast Text Search Over Logs

Here's the problem I'm having, I've got a set of logs that can grow fairly quickly. They're split into individual files every day, and the files can easily grow up to a gig in size. To help keep the size down, entries older than 30 days or so are…
ReaperUnreal
  • 970
  • 7
  • 19
8
votes
3 answers

How do AV engines search files for known signatures so efficiently?

Data in the form of search strings continue to grow as new virus variants are released, which prompts my question - how do AV engines search files for known signatures so efficiently? If I download a new file, my AV scanner rapidly identifies the…
Charles Saag
  • 611
  • 5
  • 20
8
votes
1 answer

Fuzzy file searching by directory?

I'm attempting to use RubyMine, but there's one feature that's consistently killing my productivity. I use this all the time in Sublime. Say I have a hundred index.html.haml files strewn across my view folder. In Sublime Text 2, I can search for…
Clinton
  • 2,296
  • 4
  • 19
  • 21
8
votes
1 answer

Recommended improved match-finding algorithm for Bejeweled game?

I'm trying to determine a sensible method of finding matches of 3, 4, or 5, for each rows and column. The player looks for areas (rows or columns) in the game board where the same "gem" will, after swapping two adjacent pieces (one swap each turn),…
Jamal
  • 763
  • 7
  • 22
  • 32
8
votes
1 answer

Is it possible to search YouTube videos by the language of their captions?

There isn't a way to do it directly on YouTube, so I wondered if there's a way to do it via the API? On the website, you can just filter videos that have captions, but if you want to search videos that have French captions for example, you…
user1011444
  • 1,389
  • 2
  • 15
  • 25
8
votes
4 answers

search for multiple keywords with php and mysql (where X like)

I have a code that dynamically search for data in the database using ajax but I can search for only 1 keyword in a time. I would like to modify it so I can search for multiple keywords. Now, if I type 2 keywords separated by a space and in the…
user1932820
  • 109
  • 2
  • 2
  • 7
8
votes
4 answers

how does searchsort in python work?

To make my question clear say if I have an array a as Out[123]: [1, 3, 4, 6, 9, 10, 54] When I try to search the numbers in the list, searchsort returns correct value but when I try something not in the list, it returns an absurd value here is some…
Ars3nous
  • 136
  • 1
  • 1
  • 8
8
votes
4 answers

How to search the web for pages containing certain source code?

I wanted to find the origin page of a CSS file that somebody once included in a project I'm working on. Unfortunately, the guy that included it didn't write where from it came and has only a vague memory that 'somebody' sent the source file to…
Jesper Rønn-Jensen
  • 106,591
  • 44
  • 118
  • 155
8
votes
4 answers

Combining TF-IDF (cosine similarity) with pagerank?

Given a query I have a cosine score for a document. I also have the documents pagerank. Is there a standard good way of combining the two? I was thinking of multiply them Total_Score = cosine-score * pagerank Because if you get to low on either…
user1506145
  • 5,176
  • 11
  • 46
  • 75
8
votes
2 answers

What is the difference between "hill climbing" and "branch-and-bound" search algorithms?

Hill-climbing search and branch-and-bound are two heuristic search algorithms used in artificial intelligence. What is the difference between these two approaches?