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

Github Issues Partial Match

Is it possible to perform a partial word match query for github issues: For example, if the Issue title is "Missing Polygon", is it possible to query with a syntax similar to: poly* in:title
Jzl5325
  • 3,898
  • 8
  • 42
  • 62
8
votes
1 answer

Search tool in Meteor JS

Im quite a newbie when it comes to DBs and search so please bear with me. Im trying to implement a search function in Meteor app. Ive checked through atmosphere and chanced upon these 4 options. Mattodem easy search Search Source Elastic search…
Thinkerer
  • 1,606
  • 6
  • 23
  • 43
8
votes
2 answers

Elastic(search): Get docs with max and min timestamp values

I got a problem with a search I just can't figure out how to do it. My docs are of the following form: { "timestamp":"2015-03-17T15:05:04.563Z", "session_id":"1", "user_id":"jan" } Let's say the first timestamp of a session id is the "Login" and…
Jan
  • 337
  • 1
  • 2
  • 11
8
votes
6 answers

Image/"most resembling pixel" search optimization?

The situation: Let's say I have an image A, say, 512x512 pixels, and image B, 5x5 or 7x7 pixels. Both images are 24bit rgb, and B have 1bit alpha mask (so each pixel is either completely transparent or completely solid). I need to find within image…
SigTerm
  • 26,089
  • 6
  • 66
  • 115
8
votes
1 answer

make SOLR spellchecker search case insensitive but return original case

I'm implementing an search service with SOLR 4.10 and would like to provide search suggestions based on the already specified term. Pretty standard feature for todays search applications... What I want is that SOLR searches case insensitive for…
TekTimmy
  • 3,066
  • 2
  • 29
  • 33
8
votes
1 answer

Search and replace across multiple lines with conversion to lower case in Vim

Here's what I'd like to do, for each one of many files: search for all occurrences of convert the entire match to lowercase
Olivier Pons
  • 15,363
  • 26
  • 117
  • 213
8
votes
2 answers

What's a solid but basic search algorithm for php?

I am working on a project that involves searching for videos, these videos are tagged similar to how questions are tagged on stack overflow. I was wondering if anyone knows of a good 'tag-based' search algorithm. Thanks!
ThinkingInBits
  • 10,792
  • 8
  • 57
  • 82
8
votes
2 answers

Using OR operator in re.search for multiple strings in python 3

Sorry if this is already been asked, though i couldn't find it. Im trying to detect if a website uses wordpress. here is the sample code. url = input("Please enter the URL") if 'http://' in url: append = url else: append = 'http://' + url r…
Haider Qureshi
  • 83
  • 1
  • 1
  • 4
8
votes
1 answer

Laravel search engine

I am building a REST api using Laravel for a mobile app. And now I need a search engine. First off, I have never used any search engine. So I am looking for one thats simple to work with but still good at fulltext searching and filtering "where" The…
user2722667
  • 8,195
  • 14
  • 52
  • 100
8
votes
5 answers

Can php query the results from a previous query?

In some languages (ColdFusion comes to mind), you can run a query on the result set from a previous query. Is it possible to do something like that in php (with MySQL as the database)? I sort of want to do: $rs1 = do_query( "SELECT * FROM animals…
eaolson
  • 14,717
  • 7
  • 43
  • 58
8
votes
1 answer

Windows Phone 7 Search Button

BASED ON OUT DATED BETA Is there support for the Search Button yet in WinPhone 7 sdk? I can't find it, nor anything info on it. Just thought someone might know.
Chris Nicol
  • 10,256
  • 7
  • 39
  • 49
8
votes
8 answers

highlight multiple keywords in search

i'm using this code to highlight search keywords: function highlightWords($string, $word) { $string = str_replace($word, "".$word."", $string); /*** return the highlighted string ***/ return…
input
  • 7,503
  • 25
  • 93
  • 150
8
votes
1 answer

Using multiple types or indexes in Elasticsearch php API

I want to query multiple types and indices using Elasticsearch PHP API. but I don't Know how. should I pass an array of types and indices to $params ? : $params['index'] = $index;//array of indices $params['type'] = $types;//array of…
Ramin Omrani
  • 3,673
  • 8
  • 34
  • 60
8
votes
3 answers

Google Chrome DevTools elements search not working

Since about a week ago, I haven't been able to search for elements or the contents of an element in Google Chrome DevTools. Did the latest Chrome update break this functionality or has something else changed that I should be aware of? I first…
Juha Liikala
  • 93
  • 1
  • 6
8
votes
2 answers

Passing file directly to nano fails with sighup or sigterm

was want to search for a specific file on my server and directly edit it within nano. i tried it like this, but it wont work find -name file.php | xargs nano $1 the file is found, but it wont work like that Received SIGHUP or SIGTERM how to do…
easteregg
  • 509
  • 4
  • 9