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

Android: How to get search suggestions asynchronously from the web?

I have created a searchable activity. Now, i want to add search suggestions that are taken from web service. I want to get those suggestions asynchronously. According to Adding Custom Suggestions I need to override the query method, do my suggestion…
toko
  • 91
  • 1
  • 4
9
votes
5 answers

Bash scripting: Find all filetypes and paths

Using Bash, how can you traverse folders within specified folder, find all files of specified file type, and every time you find a file, get full file path with file name and full file path without file name as a variables and pass them to another…
LinuxUser
9
votes
2 answers

How to use Jquery to retrieve ajax search results for wordpress

I need to set up wordpress ajax search results but my method isn't retrieving the results when the button is clicked and is instead redirecting me to another site ( myurl.com?s=term ). I called admin-ajax.php correctly but set this up incorrectly.…
Pollux Khafra
  • 862
  • 5
  • 17
  • 32
9
votes
4 answers

C# text file search for specific word and delete whole line of text that contains that word

Basically I have a text file that I read in and display in a rich text box, which is fine, but I then want to be able to search through the text for a specific word and delete the whole line of text that contains this word. I can search through the…
user1364063
  • 93
  • 1
  • 1
  • 3
8
votes
1 answer

Alternative API for google blog search API

I am developing an application using Google blog search API. But google announcement says it has been deprecated and it will be available for another 1 year from here. So i am in trouble in continuing the developement. Is there any other API…
sanpalraj
  • 91
  • 5
8
votes
1 answer

Sort different groups using different sort orders in solr

We are using solr to build an e-commerce application, and we have products getting grouped by subcategory within a parent category. We use dynamic sort order to determine where the product belongs within a subcategory and the same product can appear…
Prakash
  • 423
  • 2
  • 5
  • 15
8
votes
2 answers

What's a faster way to look up a value in a list of tuples?

I'm looking up country by ip range for tens of millions rows. I'm looking for a faster way to do the lookup. I have 180K tuples in this form: >>> data = ((0, 16777215, 'ZZ'), ... (1000013824, 1000079359, 'CN'), ... (1000079360,…
exzackley
  • 365
  • 1
  • 2
  • 8
8
votes
2 answers

IMAP "search header" command failing when search-text contains exclamation mark (!), ampersand (&), etc

I'm accessing GMail's IMAP interface through python. I run a command like this: UID SEARCH HEADER Message-ID "abcdef@abc.com" That succeeds (returns 1 UID of the matching message, or 0 if it doesn't exist). However, if the search-text contains…
rocketmonkeys
  • 5,473
  • 5
  • 28
  • 21
8
votes
2 answers

In Visual Studio 2010, how do you search for text that is not within a single line comment?

In Visual Studio 2010, how do you search for text that is not within a single line comment? E. G. how to find "bas" in: foo bar bas but not in foo bar // bas Note that it should find the line: foo / bar / bas (edit) And it should not find the…
Tony
  • 953
  • 1
  • 10
  • 22
8
votes
5 answers

How fast does Google take to crawl new page, and can we influence Google's crawler?

I want to submit my site to Google. How much time does it take to crawl a new post on the website? Also, is there a way to feed this post to Google crawler as soon as a post is created?
Usama Khalil
  • 436
  • 1
  • 4
  • 14
8
votes
2 answers

how to check whether a set has element(s) in certain range in C++

I need to check if a std::set contains element/elements in a range. For example, if the set is a set {1, 2, 4, 7, 8}, and given an int interval [3, 5] (inclusive with both endpoints), I need to know if it has elements in the set. In this case,…
Qiang Li
  • 10,593
  • 21
  • 77
  • 148
8
votes
5 answers

magento search issue

I have one issue which I am in desperate need for your help. I am on Magento ver. 1.6.1.0, whenever I am searching with a sentence like "baby's cute shoes" in magento then the results are not accurate but when I search only a word like "cute" or…
fear_matrix
  • 4,912
  • 10
  • 44
  • 65
8
votes
6 answers

Why put search input inside a form tag?

I found that SO put the search input inside a form tag, and i found some other websites do the same, such as google, they put the search input and search button inside this:
I want to just…
Amr Elgarhy
  • 66,568
  • 69
  • 184
  • 301
8
votes
3 answers

Mysql Search - InnoDB and transactions vs MyISAM for FULLTEXT search

I'm currently doing research on the best ways to provide an advanced search for my php project. I have narrowed it down to using FULLTEXT search rather than using LIKE to find matching strings in a table row. However, to do this it appears I need to…
Daniel West
  • 1,808
  • 2
  • 24
  • 34
8
votes
5 answers

Optimizing a simple search algorithm

I have been playing around a bit with a fairly simple, home-made search engine, and I'm now twiddling with some relevancy sorting code. It's not very pretty, but I'm not very good when it comes to clever algorithms, so I was hoping I could get some…
Ace
  • 4,443
  • 6
  • 38
  • 46